Add message to indicate missing orders_close_at date

This commit is contained in:
Rob Harrington
2018-03-01 14:03:41 +11:00
parent 9d8456cbf3
commit 05e6c3daa6
2 changed files with 8 additions and 4 deletions

View File

@@ -13,8 +13,10 @@ angular.module("admin.subscriptions").controller "OrdersPanelController", ($scop
OrderCycles.byID[id].name
$scope.orderCycleCloses = (id) ->
closes_at = moment(OrderCycles.byID[id].orders_close_at)
text = if closes_at > moment() then t('js.closes') else t('js.closed')
oc = OrderCycles.byID[id]
return t('js.subscriptions.close_date_not_set') unless oc?.orders_close_at?
closes_at = moment(oc.orders_close_at)
text = if closes_at > moment() then t('js.subscriptions.closes') else t('js.subscription.closed')
"#{text} #{closes_at.fromNow()}"
$scope.stateText = (state) -> t("spree.order_state.#{state}")