1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

factorize currency symbol into

This commit is contained in:
Sylvain 2016-11-23 14:27:11 +01:00
parent 51faeedfa8
commit cf11f6afcf
11 changed files with 52 additions and 92 deletions

View File

@ -8,18 +8,14 @@ userValidities = ['once', 'forever']
## ##
# Controller used in the coupon creation page # Controller used in the coupon creation page
## ##
Application.Controllers.controller "NewCouponController", ["$scope", "$state", '$locale', 'Coupon', 'growl', '_t' Application.Controllers.controller "NewCouponController", ["$scope", "$state", 'Coupon', 'growl', '_t'
, ($scope, $state, $locale, Coupon, growl, _t) -> , ($scope, $state, Coupon, growl, _t) ->
## Values for the coupon currently created ## Values for the coupon currently created
$scope.coupon = $scope.coupon =
active: true active: true
type: 'percent_off' 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 ## Options for the validity per user
$scope.validities = userValidities $scope.validities = userValidities
@ -62,8 +58,8 @@ Application.Controllers.controller "NewCouponController", ["$scope", "$state", '
## ##
# Controller used in the coupon edition page # Controller used in the coupon edition page
## ##
Application.Controllers.controller "EditCouponController", ["$scope", "$state", '$locale', 'Coupon', 'couponPromise', '_t' Application.Controllers.controller "EditCouponController", ["$scope", "$state", 'Coupon', 'couponPromise', '_t'
, ($scope, $state, $locale, Coupon, couponPromise, _t) -> , ($scope, $state, Coupon, couponPromise, _t) ->
### PUBLIC SCOPE ### ### PUBLIC SCOPE ###
@ -77,9 +73,6 @@ Application.Controllers.controller "EditCouponController", ["$scope", "$state",
## Options for the validity per user ## Options for the validity per user
$scope.validities = userValidities $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) ## Default parameters for AngularUI-Bootstrap datepicker (used for coupon validity limit selection)
$scope.datePicker = $scope.datePicker =
format: Fablab.uibDateFormat format: Fablab.uibDateFormat

View File

@ -382,8 +382,8 @@ Application.Controllers.controller "ShowEventReservationsController", ["$scope",
## ##
# Controller used in the event creation page # Controller used in the event creation page
## ##
Application.Controllers.controller "NewEventController", ["$scope", "$state", "$locale", 'CSRF', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise', '_t' Application.Controllers.controller "NewEventController", ["$scope", "$state", 'CSRF', 'categoriesPromise', 'themesPromise', 'ageRangesPromise', 'priceCategoriesPromise', '_t'
, ($scope, $state, $locale, CSRF, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise, _t) -> , ($scope, $state, CSRF, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise, _t) ->
CSRF.setMetaTags() CSRF.setMetaTags()
## API URL where the form will be posted ## API URL where the form will be posted
@ -425,10 +425,6 @@ Application.Controllers.controller "NewEventController", ["$scope", "$state", "$
{label: _t('every_year'), value: 'year'} {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 ## Using the EventsController
new EventsController($scope, $state) new EventsController($scope, $state)
] ]
@ -438,8 +434,8 @@ Application.Controllers.controller "NewEventController", ["$scope", "$state", "$
## ##
# Controller used in the events edition page # Controller used in the events edition page
## ##
Application.Controllers.controller "EditEventController", ["$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, $locale, CSRF, eventPromise, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise) -> , ($scope, $state, $stateParams, CSRF, eventPromise, categoriesPromise, themesPromise, ageRangesPromise, priceCategoriesPromise) ->
### PUBLIC SCOPE ### ### 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 ## Retrieve the event details, in case of error the user is redirected to the events listing
$scope.event = eventPromise $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 ## List of categories for the events
$scope.categories = categoriesPromise $scope.categories = categoriesPromise

View File

@ -421,10 +421,7 @@ Application.Controllers.controller "EditMemberController", ["$scope", "$state",
modalInstance = $uibModal.open modalInstance = $uibModal.open
animation: true, animation: true,
templateUrl: '<%= asset_path "wallet/credit_modal.html" %>' templateUrl: '<%= asset_path "wallet/credit_modal.html" %>'
controller: ['$scope', '$uibModalInstance', 'Wallet', '$locale', ($scope, $uibModalInstance, Wallet, $locale) -> controller: ['$scope', '$uibModalInstance', 'Wallet', ($scope, $uibModalInstance, Wallet) ->
## currency symbol for the current locale (cf. angular-i18n)
$scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM
## ##
# Modal dialog validation callback # Modal dialog validation callback

View File

@ -78,8 +78,8 @@ class PlanController
## ##
# Controller used in the plan creation form # Controller used in the plan creation form
## ##
Application.Controllers.controller 'NewPlanController', ['$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, $locale) -> , ($scope, $uibModal, groups, plans, machines, prices, partners, CSRF, $state, growl, _t) ->
@ -119,10 +119,6 @@ Application.Controllers.controller 'NewPlanController', ['$scope', '$uibModal',
$scope.method = 'POST' $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 # 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 # 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' 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, $locale, 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' $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 # If a parent plan was set ($scope.plan.parent), the prices will be copied from this parent plan into

View File

@ -3,8 +3,8 @@
## ##
# Controller used in the prices edition page # 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' 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, $locale, $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 ### ### PUBLIC SCOPE ###
## List of machines prices (not considering any plan) ## List of machines prices (not considering any plan)
@ -44,9 +44,6 @@ Application.Controllers.controller "EditPricingController", ["$scope", "$state",
$scope.status = $scope.status =
isopen: false isopen: false
## currency symbol for the current locale (cf. angular-i18n)
$scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM;
$scope.findTrainingsPricing = (trainingsPricings, trainingId, groupId)-> $scope.findTrainingsPricing = (trainingsPricings, trainingId, groupId)->

View File

@ -1,7 +1,7 @@
'use strict' 'use strict'
Application.Controllers.controller 'ApplicationController', ["$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, 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 = $scope.version =
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 # Set the current user to the provided value and initialize the session
# @param user {Object} Rails/Devise user # @param user {Object} Rails/Devise user

View File

@ -560,9 +560,9 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
member: $scope.ctrl.member member: $scope.ctrl.member
coupon: -> coupon: ->
$scope.coupon.applied $scope.coupon.applied
controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'cgv', 'Auth', 'Reservation', 'growl', 'wallet', 'helpers', '$locale', '$filter', 'coupon', 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, $locale, $filter, coupon) -> ($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, growl, wallet, helpers, $filter, coupon) ->
# user wallet amount # User's wallet amount
$scope.walletAmount = wallet.amount $scope.walletAmount = wallet.amount
# Price # Price
@ -574,8 +574,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
# Reservation # Reservation
$scope.reservation = reservation $scope.reservation = reservation
$scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM # Used in wallet info template to interpolate some translations
$scope.numberFilter = $filter('number') $scope.numberFilter = $filter('number')
# Callback for the stripe payment authorization # Callback for the stripe payment authorization
@ -616,9 +615,9 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
Wallet.getWalletByUser({user_id: reservation.user_id}).$promise Wallet.getWalletByUser({user_id: reservation.user_id}).$promise
coupon: -> coupon: ->
$scope.coupon.applied $scope.coupon.applied
controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'Auth', 'Reservation', 'wallet', '$locale', 'helpers', '$filter', 'coupon', controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'Auth', 'Reservation', 'wallet', 'helpers', '$filter', 'coupon',
($scope, $uibModalInstance, $state, reservation, price, Auth, Reservation, wallet, $locale, helpers, $filter, coupon) -> ($scope, $uibModalInstance, $state, reservation, price, Auth, Reservation, wallet, helpers, $filter, coupon) ->
# user wallet amount # User's wallet amount
$scope.walletAmount = wallet.amount $scope.walletAmount = wallet.amount
# Price # Price
@ -630,8 +629,7 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", "
# Reservation # Reservation
$scope.reservation = reservation $scope.reservation = reservation
$scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM # Used in wallet info template to interpolate some translations
$scope.numberFilter = $filter('number') $scope.numberFilter = $filter('number')
# Button label # Button label

View File

@ -782,8 +782,8 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat
CustomAsset.get({name: 'cgv-file'}).$promise CustomAsset.get({name: 'cgv-file'}).$promise
coupon: -> coupon: ->
$scope.coupon.applied $scope.coupon.applied
controller: ['$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, $locale, $filter, coupon) -> ($scope, $uibModalInstance, $state, reservation, price, cgv, Auth, Reservation, wallet, helpers, $filter, coupon) ->
# user wallet amount # user wallet amount
$scope.walletAmount = wallet.amount $scope.walletAmount = wallet.amount
@ -796,9 +796,6 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat
# Reservation # Reservation
$scope.reservation = 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 # Used in wallet info template to interpolate some translations
$scope.numberFilter = $filter('number') $scope.numberFilter = $filter('number')
@ -842,8 +839,8 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat
Wallet.getWalletByUser({user_id: reservation.user_id}).$promise Wallet.getWalletByUser({user_id: reservation.user_id}).$promise
coupon: -> coupon: ->
$scope.coupon.applied $scope.coupon.applied
controller: ['$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, $locale, coupon) -> ($scope, $uibModalInstance, $state, reservation, price, Auth, Reservation, wallet, helpers, $filter, coupon) ->
# user wallet amount # user wallet amount
$scope.walletAmount = wallet.amount $scope.walletAmount = wallet.amount
@ -857,9 +854,6 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat
# Reservation # Reservation
$scope.reservation = 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 # Used in wallet info template to interpolate some translations
$scope.numberFilter = $filter('number') $scope.numberFilter = $filter('number')

View File

@ -200,9 +200,9 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop
wallet: -> wallet: ->
Wallet.getWalletByUser({user_id: $scope.ctrl.member.id}).$promise Wallet.getWalletByUser({user_id: $scope.ctrl.member.id}).$promise
coupon: -> $scope.coupon.applied coupon: -> $scope.coupon.applied
controller: ['$scope', '$uibModalInstance', '$state', 'selectedPlan', 'member', 'price', 'Subscription', 'CustomAsset', 'wallet', 'helpers', '$locale', '$filter', 'coupon', controller: ['$scope', '$uibModalInstance', '$state', 'selectedPlan', 'member', 'price', 'Subscription', 'CustomAsset', 'wallet', 'helpers', '$filter', 'coupon',
($scope, $uibModalInstance, $state, selectedPlan, member, price, Subscription, CustomAsset, wallet, helpers, $locale, $filter, coupon) -> ($scope, $uibModalInstance, $state, selectedPlan, member, price, Subscription, CustomAsset, wallet, helpers, $filter, coupon) ->
# user wallet amount # User's wallet amount
$scope.walletAmount = wallet.amount $scope.walletAmount = wallet.amount
# Final price to pay by the user # 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 # The plan that the user is about to subscribe
$scope.selectedPlan = selectedPlan $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 # Used in wallet info template to interpolate some translations
$scope.numberFilter = $filter('number') $scope.numberFilter = $filter('number')
@ -266,8 +263,8 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop
wallet: -> wallet: ->
Wallet.getWalletByUser({user_id: $scope.ctrl.member.id}).$promise Wallet.getWalletByUser({user_id: $scope.ctrl.member.id}).$promise
coupon: -> $scope.coupon.applied coupon: -> $scope.coupon.applied
controller: ['$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, $locale, $filter, coupon) -> ($scope, $uibModalInstance, $state, selectedPlan, member, price, Subscription, wallet, helpers, $filter, coupon) ->
# user wallet amount # user wallet amount
$scope.walletAmount = wallet.amount $scope.walletAmount = wallet.amount
@ -277,9 +274,6 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop
# price to pay # price to pay
$scope.amount = helpers.getAmountToPay($scope.price, wallet.amount) $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 # Used in wallet info template to interpolate some translations
$scope.numberFilter = $filter('number') $scope.numberFilter = $filter('number')

View File

@ -533,9 +533,9 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta
CustomAsset.get({name: 'cgv-file'}).$promise CustomAsset.get({name: 'cgv-file'}).$promise
coupon: -> coupon: ->
$scope.coupon.applied $scope.coupon.applied
controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'wallet', 'cgv', 'Auth', 'Reservation', '$locale', 'helpers', '$filter', 'coupon' controller: ['$scope', '$uibModalInstance', '$state', 'reservation', 'price', 'wallet', 'cgv', 'Auth', 'Reservation', 'helpers', '$filter', 'coupon'
($scope, $uibModalInstance, $state, reservation, price, wallet, cgv, Auth, Reservation, $locale, helpers, $filter, coupon) -> ($scope, $uibModalInstance, $state, reservation, price, wallet, cgv, Auth, Reservation, helpers, $filter, coupon) ->
# user wallet amount # User's wallet amount
$scope.walletAmount = wallet.amount $scope.walletAmount = wallet.amount
# Price # Price
@ -547,8 +547,7 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta
# Reservation # Reservation
$scope.reservation = reservation $scope.reservation = reservation
$scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM # Used in wallet info template to interpolate some translations
$scope.numberFilter = $filter('number') $scope.numberFilter = $filter('number')
## ##
@ -594,9 +593,9 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta
Wallet.getWalletByUser({user_id: reservation.user_id}).$promise Wallet.getWalletByUser({user_id: reservation.user_id}).$promise
coupon: -> coupon: ->
$scope.coupon.applied $scope.coupon.applied
controller: ['$scope', '$uibModalInstance', '$state', '$filter', 'reservation', 'price', 'wallet', 'Auth', 'Reservation', '$locale', 'helpers', 'coupon' controller: ['$scope', '$uibModalInstance', '$state', '$filter', 'reservation', 'price', 'wallet', 'Auth', 'Reservation', 'helpers', 'coupon'
($scope, $uibModalInstance, $state, $filter, reservation, price, wallet, Auth, Reservation, $locale, helpers, coupon) -> ($scope, $uibModalInstance, $state, $filter, reservation, price, wallet, Auth, Reservation, helpers, coupon) ->
# user wallet amount # User's wallet amount
$scope.walletAmount = wallet.amount $scope.walletAmount = wallet.amount
# Price # Price
@ -608,8 +607,7 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta
# Reservation # Reservation
$scope.reservation = reservation $scope.reservation = reservation
$scope.currencySymbol = $locale.NUMBER_FORMATS.CURRENCY_SYM # Used in wallet info template to interpolate some translations
$scope.numberFilter = $filter('number') $scope.numberFilter = $filter('number')
# Button label # Button label

View File

@ -13,12 +13,12 @@
<tr><th style="width:60%"></th></tr> <tr><th style="width:60%"></th></tr>
</thead> </thead>
<tbody> <tbody>
<tr><td translate>{{'code'}}</td><td>{{coupon.code}}</td></tr> <tr><td translate>{{'code'}}</td> <td>{{coupon.code}}</td></tr>
<tr><td translate>{{'percent_off'}}</td><td>{{coupon.percent_off}} %</td></tr> <tr><td translate>{{'discount'}}</td> <td><span ng-show="coupon.type == 'percent_off'">{{coupon.percent_off}} %</span><span ng-show="coupon.type == 'amount_off'">{{coupon.amount_off}} {{currencySymbol}}</span></td></tr>
<tr><td translate>{{'validity_per_user'}}</td><td translate>{{coupon.validity_per_user}}</td></tr> <tr><td translate>{{'validity_per_user'}}</td> <td translate>{{coupon.validity_per_user}}</td></tr>
<tr><td translate>{{'valid_until'}}</td><td>{{coupon.valid_until | amDateFormat:'L'}}</td></tr> <tr><td translate>{{'valid_until'}}</td> <td>{{coupon.valid_until | amDateFormat:'L'}}</td></tr>
<tr><td translate>{{'usages'}}</td><td>{{coupon.usages}} / {{coupon.max_usages | maxCount}}</td></tr> <tr><td translate>{{'usages'}}</td> <td>{{coupon.usages}} / {{coupon.max_usages | maxCount}}</td></tr>
<tr><td translate>{{'enabled'}}</td><td>{{coupon.active | booleanFormat}}</td></tr> <tr><td translate>{{'enabled'}}</td> <td>{{coupon.active | booleanFormat}}</td></tr>
</tbody> </tbody>
</table> </table>
</div> </div>