Replace references to 'standing order' with 'subscription' (JS)

This commit is contained in:
Rob Harrington
2018-02-02 16:25:42 +11:00
parent 672f96b85b
commit b3eaa30f3d
19 changed files with 101 additions and 101 deletions

View File

@@ -1,9 +1,9 @@
# Used to display a message before redirecting to a link
angular.module("admin.standingOrders").directive "confirmOrderEdit", (ConfirmDialog, $window) ->
angular.module("admin.subscriptions").directive "confirmOrderEdit", (ConfirmDialog, $window) ->
restrict: "A"
link: (scope, element, attrs) ->
element.bind "click", (event) ->
unless scope.proxyOrder.order_id?
event.preventDefault()
ConfirmDialog.open('error', t('admin.standing_orders.orders.confirm_edit'), {confirm: t('yes_i_am_sure')}).then ->
ConfirmDialog.open('error', t('admin.subscriptions.orders.confirm_edit'), {confirm: t('yes_i_am_sure')}).then ->
$window.open(attrs.href)

View File

@@ -1,4 +1,4 @@
angular.module("admin.standingOrders").directive 'newStandingOrderDialog', ($compile, $window, $templateCache, DialogDefaults, shops) ->
angular.module("admin.subscriptions").directive 'newSubscriptionDialog', ($compile, $window, $templateCache, DialogDefaults, shops) ->
restrict: 'A'
scope: true
link: (scope, element, attr) ->
@@ -6,15 +6,15 @@ angular.module("admin.standingOrders").directive 'newStandingOrderDialog', ($com
scope.shops = shops
scope.shop_id = null
scope.newStandingOrder = ->
scope.new_standing_order_form.$setPristine()
scope.newSubscription = ->
scope.new_subscription_form.$setPristine()
scope.submitted = true
if scope.shop_id?
$window.location.href = "/admin/standing_orders/new?standing_order[shop_id]=#{scope.shop_id}"
$window.location.href = "/admin/subscriptions/new?subscription[shop_id]=#{scope.shop_id}"
return
# Compile modal template
template = $compile($templateCache.get('admin/new_standing_order_dialog.html'))(scope)
template = $compile($templateCache.get('admin/new_subscription_dialog.html'))(scope)
# Set Dialog options
template.dialog(DialogDefaults)
@@ -23,6 +23,6 @@ angular.module("admin.standingOrders").directive 'newStandingOrderDialog', ($com
element.bind 'click', (e) ->
if shops.length == 1
scope.shop_id = shops[0].id
scope.newStandingOrder()
scope.newSubscription()
else
template.dialog('open')