diff --git a/README.md b/README.md index 443caa9..6791940 100644 --- a/README.md +++ b/README.md @@ -44,5 +44,7 @@ Many thanks to Chris Beach and Angus McLeod who helped on the previous version o * Format the currency * Check against other themes * Add billing info to confirm dialog +* Confirm dialog heading * Validate the model properly. Not in the stripe component * Show the transaction on the thank you page. +* Work out where to put the helper tests. Name collision! diff --git a/assets/javascripts/discourse/helpers/format-curency.js.es6 b/assets/javascripts/discourse/helpers/format-curency.js.es6 new file mode 100644 index 0000000..ba077b5 --- /dev/null +++ b/assets/javascripts/discourse/helpers/format-curency.js.es6 @@ -0,0 +1,16 @@ +export default Ember.Helper.helper(function(params) { + let currencySign; + + switch (Discourse.SiteSettings.discourse_patrons_currency) { + case 'EUR': + currencySign = "€"; + break; + case 'GBP': + currencySign = "£"; + break; + default: + currencySign = "$"; + } + + return [currencySign, params[0]].join(''); +}); diff --git a/assets/javascripts/discourse/templates/components/donation-form.hbs b/assets/javascripts/discourse/templates/components/donation-form.hbs index a34e185..594270b 100644 --- a/assets/javascripts/discourse/templates/components/donation-form.hbs +++ b/assets/javascripts/discourse/templates/components/donation-form.hbs @@ -5,7 +5,7 @@
{{i18n 'discourse_patrons.confirmation.amount'}} | -{{amount}} | +{{format-curency amount}} |
{{i18n 'discourse_patrons.confirmation.last4'}} | @@ -17,7 +17,7 @@ diff --git a/assets/javascripts/discourse/templates/components/stripe-card.hbs b/assets/javascripts/discourse/templates/components/stripe-card.hbs index 724a245..48ff7c4 100644 --- a/assets/javascripts/discourse/templates/components/stripe-card.hbs +++ b/assets/javascripts/discourse/templates/components/stripe-card.hbs @@ -3,7 +3,7 @@