diff --git a/app/assets/javascripts/darkswarm/filters/dates.js.coffee b/app/assets/javascripts/darkswarm/filters/dates.js.coffee index 0f5a36f3ee..7b5dd861d5 100644 --- a/app/assets/javascripts/darkswarm/filters/dates.js.coffee +++ b/app/assets/javascripts/darkswarm/filters/dates.js.coffee @@ -8,9 +8,3 @@ Darkswarm.filter "sensible_timeframe", (date_in_wordsFilter)-> t 'orders_open' else t('closing') + date_in_wordsFilter(date) - -Darkswarm.filter "changesAllowed", -> - (date) -> - return t('say_no') unless date? - return t('spree.users.open_orders.closed') if date < moment() - t('spree.users.open_orders.until') + " " + moment(date).calendar() diff --git a/app/serializers/api/order_serializer.rb b/app/serializers/api/order_serializer.rb index 354af5e878..4f07cdb962 100644 --- a/app/serializers/api/order_serializer.rb +++ b/app/serializers/api/order_serializer.rb @@ -19,7 +19,7 @@ module Api end def changes_allowed_until - object.order_cycle.andand.orders_close_at + I18n.l(object.order_cycle.andand.orders_close_at, format: :long) end def total diff --git a/app/views/spree/users/_open_orders.html.haml b/app/views/spree/users/_open_orders.html.haml index 6447589dfc..c8efbfb4f4 100644 --- a/app/views/spree/users/_open_orders.html.haml +++ b/app/views/spree/users/_open_orders.html.haml @@ -4,7 +4,7 @@ %tr %th.order1= t('.order') %th.order2= t('.shop') - %th.order3.show-for-large-up= t('.changes_allowed') + %th.order3.show-for-large-up= t('.changes_allowed_until') %th.order4.show-for-large-up= t('.items') %th.order5.text-right= t('.total') %th.order6.text-right.show-for-large-up= t('.edit') @@ -14,7 +14,7 @@ %td.order1 %a{"ng-href" => "{{::order.path}}", "ng-bind" => "::order.number"} %td.order2{"ng-bind" => "::order.shop_name"} - %td.order3.show-for-large-up{"ng-bind" => "order.changes_allowed_until | changesAllowed"} + %td.order3.show-for-large-up{"ng-bind" => "order.changes_allowed_until"} %td.order4.show-for-large-up{"ng-bind" => "::order.item_count"} %td.order5.text-right{"ng-class" => "{'credit' : order.total < 0, 'debit' : order.total > 0, 'paid' : order.total == 0}","ng-bind" => "::order.total | localizeCurrency"} %td.order6.text-right.show-for-large-up.brick diff --git a/config/locales/en.yml b/config/locales/en.yml index e247a3a4d1..712ab9706f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1683,7 +1683,7 @@ Please follow the instructions there to make your enterprise visible on the Open open_orders: order: Order shop: Shop - changes_allowed: Changes Allowed? + changes_allowed_until: Changes Allowed Until items: Items total: Total edit: Edit