format some currency

This commit is contained in:
Rimian Perkins 2019-10-31 14:35:19 +11:00
parent bec2d57920
commit 5fe08c110f
4 changed files with 25 additions and 4 deletions

View File

@ -1,3 +1,5 @@
// TODO: typo in this helper name: currency not curency.
export default Ember.Helper.helper(function(params) {
let currencySign;

View File

@ -0,0 +1,19 @@
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.map(p => p.toUpperCase()).join(' ');
});

View File

@ -45,7 +45,7 @@
<td>{{format-date plan.createdFormatted}}</td>
<td>{{plan.metadata.group_name}}</td>
<td>{{plan.active}}</td>
<td class="td-right">{{plan.amountDollars}}</td>
<td class="td-right">{{format-currency plan.currency plan.amountDollars}}</td>
<td class="td-right">
{{#link-to "adminPlugins.discourse-patrons.products.show.plans.show" model.product.id plan.id class="btn no-text btn-icon"}}
{{d-icon "far-edit"}}

View File

@ -1,10 +1,10 @@
en:
site_settings:
discourse_patrons_enabled: "Enable the Discourse Patrons plugin."
discourse_patrons_secret_key: "Stripe Secret Key"
discourse_patrons_public_key: "Stripe Public Key"
discourse_patrons_secret_key: Stripe Secret Key
discourse_patrons_public_key: Stripe Public Key
discourse_patrons_subscription_group: The name of the group the user is added to when successfully subscribed
discourse_patrons_currency: "Currency Code"
discourse_patrons_currency: Default Currency Code. This can be overridden when creating a subscription plan
discourse_patrons_zip_code: "Show Zip Code"
discourse_patrons_billing_address: "Collect billing address"
discourse_patrons_payment_page: "Text to be added to enter payments page. Markdown is supported."