From 4f42253d3d8c4a3d329ae1c46a4fd4597f46a0dc Mon Sep 17 00:00:00 2001 From: Peng DU Date: Mon, 11 Jul 2016 16:58:17 +0200 Subject: [PATCH] wallet transaction list operation locale --- app/assets/templates/wallet/transactions.html.erb | 4 ++++ app/views/api/wallet/transactions.json.jbuilder | 7 ++++++- config/locales/app.shared.en.yml | 4 ++++ config/locales/app.shared.fr.yml | 4 ++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/assets/templates/wallet/transactions.html.erb b/app/assets/templates/wallet/transactions.html.erb index 17130b013..d70aa110a 100644 --- a/app/assets/templates/wallet/transactions.html.erb +++ b/app/assets/templates/wallet/transactions.html.erb @@ -13,6 +13,10 @@ {{ t.created_at | amDateFormat:'L' }} {{ 'credit' }} + {{ 'debit_subscription' }} + {{ 'debit_reservation_training' }} + {{ 'debit_reservation_machine' }} + {{ 'debit_reservation_event' }} {{ t.user.full_name }} diff --git a/app/views/api/wallet/transactions.json.jbuilder b/app/views/api/wallet/transactions.json.jbuilder index d588705c4..050cb137f 100644 --- a/app/views/api/wallet/transactions.json.jbuilder +++ b/app/views/api/wallet/transactions.json.jbuilder @@ -1,7 +1,12 @@ json.array!(@wallet_transactions) do |t| - json.extract! t, :id, :transaction_type, :created_at, :amount + json.extract! t, :id, :transaction_type, :created_at, :amount, :transactable_type json.user do json.id t.user.id json.full_name t.user.profile.full_name end + json.transactable do + if t.transactable_type == 'Reservation' + json.reservable_type t.transactable.reservable_type + end + end if t.transactable end diff --git a/config/locales/app.shared.en.yml b/config/locales/app.shared.en.yml index 190386259..2461264bf 100644 --- a/config/locales/app.shared.en.yml +++ b/config/locales/app.shared.en.yml @@ -308,3 +308,7 @@ en: to_credit: 'Credit' wallet_credit_successfully: "Wallet of user is credited successfully." a_problem_occurred_for_wallet_credit: "A problem is occurred while taking the credit of wallet" + debit_subscription: "Debit by subscription" + debit_reservation_training: "Debit by reservation of training" + debit_reservation_machine: "Debit by reservation of machine" + debit_reservation_event: "Debit by reservation of event" diff --git a/config/locales/app.shared.fr.yml b/config/locales/app.shared.fr.yml index 049662dc8..3544febdc 100644 --- a/config/locales/app.shared.fr.yml +++ b/config/locales/app.shared.fr.yml @@ -313,3 +313,7 @@ fr: amount_minimum_1: "Le montant minimum est d'1" you_have_amount_in_wallet: "Vous avez {{amount}} {{currency}} sur votre porte-monnaie" wallet_pay_reservation: "Vous pouvez effectuer directement votre paiement de réservation" + debit_subscription: "Payer un abonnement" + debit_reservation_training: "Payer un reservation de formation" + debit_reservation_machine: "Payer un reservation de machine" + debit_reservation_event: "Payer un reservation d'évenement"