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

success message when applying cash coupon

This commit is contained in:
Sylvain 2016-11-24 18:05:16 +01:00
parent 63b0f0c061
commit ce6877b484
3 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,4 @@
Application.Directives.directive 'coupon', [ 'Coupon', 'growl', '_t', (Coupon, growl, _t) ->
Application.Directives.directive 'coupon', [ '$rootScope', 'Coupon', 'growl', '_t', ($rootScope, Coupon, growl, _t) ->
{
restrict: 'E'
scope:
@ -35,7 +35,10 @@ Application.Directives.directive 'coupon', [ 'Coupon', 'growl', '_t', (Coupon, g
Coupon.validate {code: $scope.couponCode, user_id: $scope.userId, amount: $scope.total}, (res) ->
$scope.status = 'valid'
$scope.coupon = res
growl.success(_t('the_coupon_has_been_applied_you_get_PERCENT_discount', {PERCENT: res.percent_off}))
if res.type == 'percent_off'
growl.success(_t('the_coupon_has_been_applied_you_get_PERCENT_discount', {PERCENT: res.percent_off}))
else
growl.success(_t('the_coupon_has_been_applied_you_get_DISCOUNT_CURRENCY', {DISCOUNT: res.amount_off, CURRENCY: $rootScope.currencySymbol}))
, (err) ->
$scope.status = 'invalid'
$scope.coupon = null

View File

@ -367,7 +367,8 @@ en:
# coupon (input zone for users)
i_have_a_coupon: "I have a coupon!"
code_: "Code:"
the_coupon_has_been_applied_you_get_PERCENT_discount: "The coupon has been applied. You get {{PERCENT}}% discount." # angular interpolation
the_coupon_has_been_applied_you_get_PERCENT_discount: "The coupon has been applied. You get a {{PERCENT}}% discount." # angular interpolation
the_coupon_has_been_applied_you_get_DISCOUNT_CURRENCY: "The coupon has been applied. You get a discount of {{DISCOUNT}} {{CURRENCY}}." # angular interpolation
unable_to_apply_the_coupon_because_disabled: "Unable to apply the coupon: this code was disabled."
unable_to_apply_the_coupon_because_expired: "Unable to apply the coupon: this code has expired."
unable_to_apply_the_coupon_because_sold_out: "Unable to apply the coupon: this code reached its quota."

View File

@ -368,6 +368,7 @@ fr:
i_have_a_coupon: "J'ai un code promo !"
code_: "Code :"
the_coupon_has_been_applied_you_get_PERCENT_discount: "Le code promo a bien été appliqué. Vous bénéficiez d'une remise de {{PERCENT}} %." # angular interpolation
the_coupon_has_been_applied_you_get_DISCOUNT_CURRENCY: "Le code promo a bien été appliqué. Vous bénéficiez d'une remise de {{DISCOUNT}} {{CURRENCY}}." # angular interpolation
unable_to_apply_the_coupon_because_disabled: "Impossible d'appliquer la réduction : ce code promo a été désactivé."
unable_to_apply_the_coupon_because_expired: "Impossible d'appliquer la réduction : ce code promo a expiré."
unable_to_apply_the_coupon_because_sold_out: "Impossible d'appliquer la réduction : ce code promo a atteint son quota."