Stop using inexistent en.order_state translations keys and use existing en.spree.order_state in haml code and new js.admin.orders.order_state in JS code

This commit is contained in:
luisramos0
2019-02-26 17:03:26 +00:00
parent b94c6c1fb6
commit 7c39c45f79
5 changed files with 7 additions and 7 deletions

View File

@@ -19,4 +19,4 @@ angular.module("admin.subscriptions").controller "OrdersPanelController", ($scop
text = if closes_at > moment() then t('js.subscriptions.closes') else t('js.subscriptions.closed')
"#{text} #{closes_at.fromNow()}"
$scope.stateText = (state) -> t("spree.order_state.#{state}")
$scope.stateText = (state) -> t("js.admin.orders.order_state.#{state}")

View File

@@ -11,7 +11,7 @@
.field
= label_tag nil, t(:status)
= select_tag("q[state_eq]",
options_for_select(Spree::Order.state_machines[:state].states.collect {|s| [t("order_state.#{s.name}"), s.value]}),
options_for_select(Spree::Order.state_machines[:state].states.collect {|s| [t("spree.order_state.#{s.name}"), s.value]}),
{include_blank: true, class: 'select2', 'ng-model' => 'q.state_eq'})
.four.columns
.field

View File

@@ -1,4 +1,4 @@
%a{'ng-click' => "sortOptions.toggle('#{column_name}')"}
= t(column_name.to_s, scope: 'activerecord.attributes.spree/order')
= t(".#{column_name.to_s}")
%span{'ng-show' => "sorting == '#{column_name} asc'"}= "▲".html_safe
%span{'ng-show' => "sorting == '#{column_name} desc'"}= "▼".html_safe

View File

@@ -59,14 +59,14 @@
= t('.note')
%td.align-center
%span.state{'ng-class' => 'order.state'}
{{'order_state.' + order.state | t}}
{{'js.admin.orders.order_state.' + order.state | t}}
%td.align-center
%span.state{'ng-class' => 'order.payment_state', 'ng-if' => 'order.payment_state'}
%a{'ng-href' => '{{order.payments_path}}' }
{{'payment_states.' + order.payment_state | t}}
{{'js.admin.orders.payment_states.' + order.payment_state | t}}
%td.align-center
%span.state{'ng-class' => 'order.shipment_state', 'ng-if' => 'order.shipment_state'}
{{'shipment_states.' + order.shipment_state | t}}
{{'js.admin.orders.shipment_states.' + order.shipment_state | t}}
%td
= mail_to "{{order.email}}"
%td.align-center

View File

@@ -19,7 +19,7 @@
%dd
- order_state_classes = "state #{@order.state}"
%span{ class: order_state_classes }
= t(@order.state, scope: :order_state)
= t(@order.state, scope: "spree.order_state")
%dt
= t(:total)
\: