From c220678ea5de1c4a57b43ff4032f458ebef0cb53 Mon Sep 17 00:00:00 2001 From: Peng DU Date: Thu, 21 Jul 2016 15:32:49 +0200 Subject: [PATCH] change some texts in reservation on site --- app/assets/javascripts/controllers/events.coffee.erb | 8 ++++++-- app/assets/javascripts/controllers/machines.coffee.erb | 7 ++++--- app/assets/javascripts/controllers/plans.coffee.erb | 7 ++++--- .../javascripts/controllers/trainings.coffee.erb | 7 ++++--- app/assets/templates/plans/payment_modal.html.erb | 4 +--- .../templates/shared/_wallet_amount_info.html.erb | 10 ++++++++++ .../templates/shared/valid_reservation_modal.html.erb | 4 +--- config/locales/app.shared.en.yml | 8 ++++++++ config/locales/app.shared.fr.yml | 4 ++++ 9 files changed, 42 insertions(+), 17 deletions(-) create mode 100644 app/assets/templates/shared/_wallet_amount_info.html.erb diff --git a/app/assets/javascripts/controllers/events.coffee.erb b/app/assets/javascripts/controllers/events.coffee.erb index 2813ee2c7..528d94344 100644 --- a/app/assets/javascripts/controllers/events.coffee.erb +++ b/app/assets/javascripts/controllers/events.coffee.erb @@ -542,10 +542,14 @@ Application.Controllers.controller "ShowEventController", ["$scope", "$state", " $scope.numberFilter = $filter('number') # Button label + confirmPaymentText = if $scope.currentUser.role == 'admin' then _t('confirm_client_payment_of_') else _t('confirm_my_payment_of_') if $scope.amount > 0 - $scope.validButtonName = _t('confirm_(payment_on_site)') + $scope.validButtonName = "#{confirmPaymentText} #{$filter('currency')($scope.amount)}" else - $scope.validButtonName = _t('confirm') + if price.price > 0 and $scope.walletAmount == 0 + $scope.validButtonName = "#{confirmPaymentText} #{$filter('currency')(price.price)}" + else + $scope.validButtonName = _t('confirm') # Callback to validate the payment $scope.ok = -> diff --git a/app/assets/javascripts/controllers/machines.coffee.erb b/app/assets/javascripts/controllers/machines.coffee.erb index b3e665921..d3092b06e 100644 --- a/app/assets/javascripts/controllers/machines.coffee.erb +++ b/app/assets/javascripts/controllers/machines.coffee.erb @@ -831,11 +831,12 @@ Application.Controllers.controller "ReserveMachineController", ["$scope", "$stat $scope.numberFilter = $filter('number') # Button label + confirmPaymentText = if $scope.currentUser.role == 'admin' then _t('confirm_client_payment_of_') else _t('confirm_my_payment_of_') if $scope.amount > 0 - $scope.validButtonName = "#{_t('confirm_my_payment_of_')} #{$filter('currency')($scope.amount)}" + $scope.validButtonName = "#{confirmPaymentText} #{$filter('currency')($scope.amount)}" else - if price.price > 0 - $scope.validButtonName = "#{_t('confirm_my_payment_of_')} #{$filter('currency')(price.price)}" + if price.price > 0 and $scope.walletAmount == 0 + $scope.validButtonName = "#{confirmPaymentText} #{$filter('currency')(price.price)}" else $scope.validButtonName = _t('confirm') diff --git a/app/assets/javascripts/controllers/plans.coffee.erb b/app/assets/javascripts/controllers/plans.coffee.erb index e5c5379e0..815a8fe8a 100644 --- a/app/assets/javascripts/controllers/plans.coffee.erb +++ b/app/assets/javascripts/controllers/plans.coffee.erb @@ -236,11 +236,12 @@ Application.Controllers.controller "PlansIndexController", ["$scope", "$rootScop $scope.member = member # Button label + confirmPaymentText = if $scope.currentUser.role == 'admin' then _t('confirm_client_payment_of_') else _t('confirm_my_payment_of_') if $scope.amount > 0 - $scope.validButtonName = "#{_t('confirm_my_payment_of_')} #{$filter('currency')($scope.amount)}" + $scope.validButtonName = "#{confirmPaymentText} #{$filter('currency')($scope.amount)}" else - if $scope.price > 0 - $scope.validButtonName = "#{_t('confirm_my_payment_of_')} #{$filter('currency')($scope.price)}" + if price.price > 0 and $scope.walletAmount == 0 + $scope.validButtonName = "#{confirmPaymentText} #{$filter('currency')(price.price)}" else $scope.validButtonName = _t('confirm') diff --git a/app/assets/javascripts/controllers/trainings.coffee.erb b/app/assets/javascripts/controllers/trainings.coffee.erb index 7fd8825be..8fb8de80d 100644 --- a/app/assets/javascripts/controllers/trainings.coffee.erb +++ b/app/assets/javascripts/controllers/trainings.coffee.erb @@ -556,11 +556,12 @@ Application.Controllers.controller "ReserveTrainingController", ["$scope", "$sta $scope.numberFilter = $filter('number') # Button label + confirmPaymentText = if $scope.currentUser.role == 'admin' then _t('confirm_client_payment_of_') else _t('confirm_my_payment_of_') if $scope.amount > 0 - $scope.validButtonName = "#{_t('confirm_my_payment_of_')} #{$filter('currency')($scope.amount)}" + $scope.validButtonName = "#{confirmPaymentText} #{$filter('currency')($scope.amount)}" else - if price.price > 0 - $scope.validButtonName = "#{_t('confirm_my_payment_of_')} #{$filter('currency')(price.price)}" + if price.price > 0 and $scope.walletAmount == 0 + $scope.validButtonName = "#{confirmPaymentText} #{$filter('currency')(price.price)}" else $scope.validButtonName = _t('confirm') diff --git a/app/assets/templates/plans/payment_modal.html.erb b/app/assets/templates/plans/payment_modal.html.erb index a0103a77c..60d198d2c 100644 --- a/app/assets/templates/plans/payment_modal.html.erb +++ b/app/assets/templates/plans/payment_modal.html.erb @@ -3,9 +3,7 @@

{{ 'subscription_confirmation' }}