From cf11f6afcfb950c6be1c034be35174379bd530e7 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 23 Nov 2016 14:27:11 +0100 Subject: [PATCH] factorize currency symbol into --- .../controllers/admin/coupons.coffee | 15 ++++----------- .../controllers/admin/events.coffee.erb | 15 ++++----------- .../controllers/admin/members.coffee.erb | 5 +---- .../controllers/admin/plans.coffee.erb | 16 ++++------------ .../controllers/admin/pricing.coffee.erb | 7 ++----- .../controllers/application.coffee.erb | 8 ++++++-- .../javascripts/controllers/events.coffee.erb | 18 ++++++++---------- .../controllers/machines.coffee.erb | 14 ++++---------- .../javascripts/controllers/plans.coffee.erb | 16 +++++----------- .../controllers/trainings.coffee.erb | 18 ++++++++---------- .../admin/pricing/sendCoupon.html.erb | 12 ++++++------ 11 files changed, 52 insertions(+), 92 deletions(-) diff --git a/app/assets/javascripts/controllers/admin/coupons.coffee b/app/assets/javascripts/controllers/admin/coupons.coffee index 32a49bef3..21e0a65ae 100644 --- a/app/assets/javascripts/controllers/admin/coupons.coffee +++ b/app/assets/javascripts/controllers/admin/coupons.coffee @@ -8,18 +8,14 @@ userValidities = ['once', 'forever'] ## # Controller used in the coupon creation page ## -Application.Controllers.controller "NewCouponController", ["$scope", "$state", '$locale', 'Coupon', 'growl', '_t' -, ($scope, $state, $locale, Coupon, growl, _t) -> +Application.Controllers.controller "NewCouponController", ["$scope", "$state", 'Coupon', 'growl', '_t' +, ($scope, $state, Coupon, growl, _t) -> ## Values for the coupon currently created $scope.coupon = active: true type: 'percent_off' - - ## currency symbol for the current locale (cf. angular-i18n) - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; - ## Options for the validity per user $scope.validities = userValidities @@ -62,8 +58,8 @@ Application.Controllers.controller "NewCouponController", ["$scope", "$state", ' ## # Controller used in the coupon edition page ## -Application.Controllers.controller "EditCouponController", ["$scope", "$state", '$locale', 'Coupon', 'couponPromise', '_t' -, ($scope, $state, $locale, Coupon, couponPromise, _t) -> +Application.Controllers.controller "EditCouponController", ["$scope", "$state", 'Coupon', 'couponPromise', '_t' +, ($scope, $state, Coupon, couponPromise, _t) -> ### PUBLIC SCOPE ### @@ -77,9 +73,6 @@ Application.Controllers.controller "EditCouponController", ["$scope", "$state", ## Options for the validity per user $scope.validities = userValidities - ## currency symbol for the current locale (cf. angular-i18n) - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; - ## Default parameters for AngularUI-Bootstrap datepicker (used for coupon validity limit selection) $scope.datePicker = format: Fablab.uibDateFormat diff --git a/app/assets/javascripts/controllers/admin/events.coffee.erb b/app/assets/javascripts/controllers/admin/events.coffee.erb index 4e2665f5d..9ef91e1c5 100644 --- a/app/assets/javascripts/controllers/admin/events.coffee.erb +++ b/app/assets/javascripts/controllers/admin/events.coffee.erb @@ -382,8 +382,8 @@ Application.Controllers.controller "ShowEventReservationsController", ["$scope", ## # Controller used in the event creation page ## -Application.Controllers.controller "NewEventController", ["$scope", "$state", "$locale", 'CSRF', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise', '_t' -, ($scope, $state, $locale, CSRF, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise, _t) -> +Application.Controllers.controller "NewEventController", ["$scope", "$state", 'CSRF', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise', '_t' +, ($scope, $state, CSRF, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise, _t) -> CSRF.setMetaTags() ## API URL where the form will be posted @@ -425,10 +425,6 @@ Application.Controllers.controller "NewEventController", ["$scope", "$state", "$ {label: _t('every_year'), value: 'year'} ] - ## currency symbol for the current locale (cf. angular-i18n) - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; - - ## Using the EventsController new EventsController($scope, $state) ] @@ -438,8 +434,8 @@ Application.Controllers.controller "NewEventController", ["$scope", "$state", "$ ## # Controller used in the events edition page ## -Application.Controllers.controller "EditEventController", ["$scope", "$state", "$stateParams", "$locale", 'CSRF', 'eventPromise', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise' -, ($scope, $state, $stateParams, $locale, CSRF, eventPromise, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise) -> +Application.Controllers.controller "EditEventController", ["$scope", "$state", "$stateParams", 'CSRF', 'eventPromise', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise' +, ($scope, $state, $stateParams, CSRF, eventPromise, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise) -> ### PUBLIC SCOPE ### @@ -454,9 +450,6 @@ Application.Controllers.controller "EditEventController", ["$scope", "$state", " ## Retrieve the event details, in case of error the user is redirected to the events listing $scope.event = eventPromise - ## currency symbol for the current locale (cf. angular-i18n) - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; - ## List of categories for the events $scope.categories = categoriesPromise diff --git a/app/assets/javascripts/controllers/admin/members.coffee.erb b/app/assets/javascripts/controllers/admin/members.coffee.erb index 75b30126c..9c37206d8 100644 --- a/app/assets/javascripts/controllers/admin/members.coffee.erb +++ b/app/assets/javascripts/controllers/admin/members.coffee.erb @@ -421,10 +421,7 @@ Application.Controllers.controller "EditMemberController", ["$scope", "$state", modalInstance = $uibModal.open animation: true, templateUrl: '<%= asset_path "wallet/credit_modal.html" %>' - controller: ['$scope', '$uibModalInstance', 'Wallet', '$locale', ($scope, $uibModalInstance, Wallet, $locale) -> - - ## currency symbol for the current locale (cf. angular-i18n) - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM + controller: ['$scope', '$uibModalInstance', 'Wallet', ($scope, $uibModalInstance, Wallet) -> ## # Modal dialog validation callback diff --git a/app/assets/javascripts/controllers/admin/plans.coffee.erb b/app/assets/javascripts/controllers/admin/plans.coffee.erb index 8fb323c10..c632790b8 100644 --- a/app/assets/javascripts/controllers/admin/plans.coffee.erb +++ b/app/assets/javascripts/controllers/admin/plans.coffee.erb @@ -78,8 +78,8 @@ class PlanController ## # Controller used in the plan creation form ## -Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal', 'groups', 'plans', 'machines', 'prices', 'partners', 'CSRF', '$state', 'growl', '_t', '$locale' -, ($scope, $uibModal, groups, plans, machines, prices, partners, CSRF, $state, growl, _t, $locale) -> +Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal', 'groups', 'plans', 'machines', 'prices', 'partners', 'CSRF', '$state', 'growl', '_t' +, ($scope, $uibModal, groups, plans, machines, prices, partners, CSRF, $state, growl, _t) -> @@ -119,10 +119,6 @@ Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal', $scope.method = 'POST' - ## currency symbol for the current locale (cf. angular-i18n) - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; - - ## # Checks if the partner contact is a valid data. Used in the form validation process @@ -187,8 +183,8 @@ Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal', ## # Controller used in the plan edition form ## -Application.Controllers.controller 'EditPlanController', ['$scope', 'groups', 'plans', 'planPromise', 'machines', 'prices', 'partners', 'CSRF', '$state', '$stateParams', 'growl', '$filter', '_t', '$locale', 'Plan' -, ($scope, groups, plans, planPromise, machines, prices, partners, CSRF, $state, $stateParams, growl, $filter, _t, $locale, Plan) -> +Application.Controllers.controller 'EditPlanController', ['$scope', 'groups', 'plans', 'planPromise', 'machines', 'prices', 'partners', 'CSRF', '$state', '$stateParams', 'growl', '$filter', '_t', 'Plan' +, ($scope, groups, plans, planPromise, machines, prices, partners, CSRF, $state, $stateParams, growl, $filter, _t, Plan) -> @@ -208,10 +204,6 @@ Application.Controllers.controller 'EditPlanController', ['$scope', 'groups', 'p $scope.method = 'PATCH' - ## currency symbol for the current locale (cf. angular-i18n) - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; - - ## # If a parent plan was set ($scope.plan.parent), the prices will be copied from this parent plan into diff --git a/app/assets/javascripts/controllers/admin/pricing.coffee.erb b/app/assets/javascripts/controllers/admin/pricing.coffee.erb index 54bcaeb0f..76bcf7cf6 100644 --- a/app/assets/javascripts/controllers/admin/pricing.coffee.erb +++ b/app/assets/javascripts/controllers/admin/pricing.coffee.erb @@ -3,8 +3,8 @@ ## # Controller used in the prices edition page ## -Application.Controllers.controller "EditPricingController", ["$scope", "$state", '$uibModal', '$locale', '$filter', 'TrainingsPricing', 'Credit', 'Pricing', 'Plan', 'Coupon', 'plans', 'groups', 'growl', 'machinesPricesPromise', 'Price', 'dialogs', 'trainingsPricingsPromise', 'trainingsPromise', 'machineCreditsPromise', 'machinesPromise', 'trainingCreditsPromise', 'couponsPromise', '_t' -, ($scope, $state, $uibModal, $locale, $filter, TrainingsPricing, Credit, Pricing, Plan, Coupon, plans, groups, growl, machinesPricesPromise, Price, dialogs, trainingsPricingsPromise, trainingsPromise, machineCreditsPromise, machinesPromise, trainingCreditsPromise, couponsPromise, _t) -> +Application.Controllers.controller "EditPricingController", ["$scope", "$state", '$uibModal', '$filter', 'TrainingsPricing', 'Credit', 'Pricing', 'Plan', 'Coupon', 'plans', 'groups', 'growl', 'machinesPricesPromise', 'Price', 'dialogs', 'trainingsPricingsPromise', 'trainingsPromise', 'machineCreditsPromise', 'machinesPromise', 'trainingCreditsPromise', 'couponsPromise', '_t' +, ($scope, $state, $uibModal, $filter, TrainingsPricing, Credit, Pricing, Plan, Coupon, plans, groups, growl, machinesPricesPromise, Price, dialogs, trainingsPricingsPromise, trainingsPromise, machineCreditsPromise, machinesPromise, trainingCreditsPromise, couponsPromise, _t) -> ### PUBLIC SCOPE ### ## List of machines prices (not considering any plan) @@ -44,9 +44,6 @@ Application.Controllers.controller "EditPricingController", ["$scope", "$state", $scope.status = isopen: false - ## currency symbol for the current locale (cf. angular-i18n) - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; - $scope.findTrainingsPricing = (trainingsPricings, trainingId, groupId)-> diff --git a/app/assets/javascripts/controllers/application.coffee.erb b/app/assets/javascripts/controllers/application.coffee.erb index 095c50892..51c42a6a3 100644 --- a/app/assets/javascripts/controllers/application.coffee.erb +++ b/app/assets/javascripts/controllers/application.coffee.erb @@ -1,7 +1,7 @@ 'use strict' -Application.Controllers.controller 'ApplicationController', ["$rootScope", "$scope", "$window", "Session", "AuthService", "Auth", "$uibModal", "$state", 'growl', 'Notification', '$interval', "Setting", '_t', 'Version' -, ($rootScope, $scope, $window, Session, AuthService, Auth, $uibModal, $state, growl, Notification, $interval, Setting, _t, Version) -> +Application.Controllers.controller 'ApplicationController', ["$rootScope", "$scope", "$window", '$locale', "Session", "AuthService", "Auth", "$uibModal", "$state", 'growl', 'Notification', '$interval', "Setting", '_t', 'Version' +, ($rootScope, $scope, $window, $locale, Session, AuthService, Auth, $uibModal, $state, growl, Notification, $interval, Setting, _t, Version) -> @@ -18,6 +18,10 @@ Application.Controllers.controller 'ApplicationController', ["$rootScope", "$sco $scope.version = version: '' + ## currency symbol for the current locale (cf. angular-i18n) + $rootScope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM; + + ## # Set the current user to the provided value and initialize the session # @param user {Object} Rails/Devise user diff --git a/app/assets/javascripts/controllers/events.coffee.erb b/app/assets/javascripts/controllers/events.coffee.erb index 39083272f..344767c95 100644 --- a/app/assets/javascripts/controllers/events.coffee.erb +++ b/app/assets/javascripts/controllers/events.coffee.erb @@ -560,9 +560,9 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " member: $scope.ctrl.member coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'cgv', 'Auth', 'Reservation', 'growl', 'wallet', 'helpers', '$locale', '$filter', 'coupon', - ($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, growl, wallet, helpers, $locale, $filter, coupon) -> - # user wallet amount + controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'cgv', 'Auth', 'Reservation', 'growl', 'wallet', 'helpers', '$filter', 'coupon', + ($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, growl, wallet, helpers, $filter, coupon) -> + # User's wallet amount $scope.walletAmount = wallet.amount # Price @@ -574,8 +574,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " # Reservation $scope.reservation = reservation - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - + # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') # Callback for the stripe payment authorization @@ -616,9 +615,9 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " Wallet.getWalletByUser({user_id: reservation.user_id}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'Auth', 'Reservation', 'wallet', '$locale', 'helpers', '$filter', 'coupon', - ($scope, $uibModalInstance, $state, reservation, price, Auth, Reservation, wallet, $locale, helpers, $filter, coupon) -> - # user wallet amount + controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'Auth', 'Reservation', 'wallet', 'helpers', '$filter', 'coupon', + ($scope, $uibModalInstance, $state, reservation, price, Auth, Reservation, wallet, helpers, $filter, coupon) -> + # User's wallet amount $scope.walletAmount = wallet.amount # Price @@ -630,8 +629,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " # Reservation $scope.reservation = reservation - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - + # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') # Button label diff --git a/app/assets/javascripts/controllers/machines.coffee.erb b/app/assets/javascripts/controllers/machines.coffee.erb index 775dd441a..5d4f9b9b4 100644 --- a/app/assets/javascripts/controllers/machines.coffee.erb +++ b/app/assets/javascripts/controllers/machines.coffee.erb @@ -782,8 +782,8 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat CustomAsset.get({name: 'cgv-file'}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'cgv', 'Auth', 'Reservation', 'wallet', 'helpers', '$locale', '$filter', 'coupon', - ($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, wallet, helpers, $locale, $filter, coupon) -> + controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'cgv', 'Auth', 'Reservation', 'wallet', 'helpers', '$filter', 'coupon', + ($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, wallet, helpers, $filter, coupon) -> # user wallet amount $scope.walletAmount = wallet.amount @@ -796,9 +796,6 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat # Reservation $scope.reservation = reservation - # Currency symbol or abreviation for the current locale - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') @@ -842,8 +839,8 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat Wallet.getWalletByUser({user_id: reservation.user_id}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'Auth', 'Reservation', 'wallet', 'helpers', '$filter', '$locale', 'coupon', - ($scope, $uibModalInstance, $state, reservation, price, Auth, Reservation, wallet, helpers, $filter, $locale, coupon) -> + controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'Auth', 'Reservation', 'wallet', 'helpers', '$filter', 'coupon', + ($scope, $uibModalInstance, $state, reservation, price, Auth, Reservation, wallet, helpers, $filter, coupon) -> # user wallet amount $scope.walletAmount = wallet.amount @@ -857,9 +854,6 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat # Reservation $scope.reservation = reservation - # Currency symbol or abreviation for the current locale - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') diff --git a/app/assets/javascripts/controllers/plans.coffee.erb b/app/assets/javascripts/controllers/plans.coffee.erb index 14c74443e..fae71708c 100644 --- a/app/assets/javascripts/controllers/plans.coffee.erb +++ b/app/assets/javascripts/controllers/plans.coffee.erb @@ -200,9 +200,9 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop wallet: -> Wallet.getWalletByUser({user_id: $scope.ctrl.member.id}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'selectedPlan', 'member', 'price', 'Subscription', 'CustomAsset', 'wallet', 'helpers', '$locale', '$filter', 'coupon', - ($scope, $uibModalInstance, $state, selectedPlan, member, price, Subscription, CustomAsset, wallet, helpers, $locale, $filter, coupon) -> - # user wallet amount + controller: ['$scope', '$uibModalInstance', '$state', 'selectedPlan', 'member', 'price', 'Subscription', 'CustomAsset', 'wallet', 'helpers', '$filter', 'coupon', + ($scope, $uibModalInstance, $state, selectedPlan, member, price, Subscription, CustomAsset, wallet, helpers, $filter, coupon) -> + # User's wallet amount $scope.walletAmount = wallet.amount # Final price to pay by the user @@ -211,9 +211,6 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop # The plan that the user is about to subscribe $scope.selectedPlan = selectedPlan - # Currency symbol or abreviation for the current locale - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') @@ -266,8 +263,8 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop wallet: -> Wallet.getWalletByUser({user_id: $scope.ctrl.member.id}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'selectedPlan', 'member', 'price', 'Subscription', 'wallet', 'helpers', '$locale', '$filter', 'coupon', - ($scope, $uibModalInstance, $state, selectedPlan, member, price, Subscription, wallet, helpers, $locale, $filter, coupon) -> + controller: ['$scope', '$uibModalInstance', '$state', 'selectedPlan', 'member', 'price', 'Subscription', 'wallet', 'helpers', '$filter', 'coupon', + ($scope, $uibModalInstance, $state, selectedPlan, member, price, Subscription, wallet, helpers, $filter, coupon) -> # user wallet amount $scope.walletAmount = wallet.amount @@ -277,9 +274,6 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop # price to pay $scope.amount = helpers.getAmountToPay($scope.price, wallet.amount) - # Currency symbol or abreviation for the current locale - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') diff --git a/app/assets/javascripts/controllers/trainings.coffee.erb b/app/assets/javascripts/controllers/trainings.coffee.erb index 2c6cdfa39..f503e7472 100644 --- a/app/assets/javascripts/controllers/trainings.coffee.erb +++ b/app/assets/javascripts/controllers/trainings.coffee.erb @@ -533,9 +533,9 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta CustomAsset.get({name: 'cgv-file'}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'wallet', 'cgv', 'Auth', 'Reservation', '$locale', 'helpers', '$filter', 'coupon' - ($scope, $uibModalInstance, $state, reservation, price, wallet, cgv, Auth, Reservation, $locale, helpers, $filter, coupon) -> - # user wallet amount + controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'wallet', 'cgv', 'Auth', 'Reservation', 'helpers', '$filter', 'coupon' + ($scope, $uibModalInstance, $state, reservation, price, wallet, cgv, Auth, Reservation, helpers, $filter, coupon) -> + # User's wallet amount $scope.walletAmount = wallet.amount # Price @@ -547,8 +547,7 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta # Reservation $scope.reservation = reservation - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - + # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') ## @@ -594,9 +593,9 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta Wallet.getWalletByUser({user_id: reservation.user_id}).$promise coupon: -> $scope.coupon.applied - controller: ['$scope', '$uibModalInstance', '$state', '$filter', 'reservation', 'price', 'wallet', 'Auth', 'Reservation', '$locale', 'helpers', 'coupon' - ($scope, $uibModalInstance, $state, $filter, reservation, price, wallet, Auth, Reservation, $locale, helpers, coupon) -> - # user wallet amount + controller: ['$scope', '$uibModalInstance', '$state', '$filter', 'reservation', 'price', 'wallet', 'Auth', 'Reservation', 'helpers', 'coupon' + ($scope, $uibModalInstance, $state, $filter, reservation, price, wallet, Auth, Reservation, helpers, coupon) -> + # User's wallet amount $scope.walletAmount = wallet.amount # Price @@ -608,8 +607,7 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta # Reservation $scope.reservation = reservation - $scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM - + # Used in wallet info template to interpolate some translations $scope.numberFilter = $filter('number') # Button label diff --git a/app/assets/templates/admin/pricing/sendCoupon.html.erb b/app/assets/templates/admin/pricing/sendCoupon.html.erb index 54cbbdcb3..9de3c5d37 100644 --- a/app/assets/templates/admin/pricing/sendCoupon.html.erb +++ b/app/assets/templates/admin/pricing/sendCoupon.html.erb @@ -13,12 +13,12 @@ - {{'code'}}{{coupon.code}} - {{'percent_off'}}{{coupon.percent_off}} % - {{'validity_per_user'}}{{coupon.validity_per_user}} - {{'valid_until'}}{{coupon.valid_until | amDateFormat:'L'}} - {{'usages'}}{{coupon.usages}} / {{coupon.max_usages | maxCount}} - {{'enabled'}}{{coupon.active | booleanFormat}} + {{'code'}} {{coupon.code}} + {{'discount'}} {{coupon.percent_off}} %{{coupon.amount_off}} {{currencySymbol}} + {{'validity_per_user'}} {{coupon.validity_per_user}} + {{'valid_until'}} {{coupon.valid_until | amDateFormat:'L'}} + {{'usages'}} {{coupon.usages}} / {{coupon.max_usages | maxCount}} + {{'enabled'}} {{coupon.active | booleanFormat}}