-
Your information
+
{{i18n 'discourse_patrons.your_information'}}
-
Payment Amount
+
+ {{i18n 'discourse_patrons.amount'}}
+ {{siteSettings.discourse_patrons_currency}}
+
- {{input value=amount}}
- Enter {{currency}}
+ {{combo-box valueAttribute="value" content=amounts value=amount}}
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index c8f1fd0..6e6822f 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -1,6 +1,6 @@
en:
site_settings:
- discourse_patrons_enabled: "Enable the Discourse Donations plugin."
+ discourse_patrons_enabled: "Enable the Discourse Patrons plugin."
discourse_patrons_secret_key: "Stripe Secret Key"
discourse_patrons_public_key: "Stripe Public Key"
discourse_patrons_description: "Description shown in Stripe Checkout form"
@@ -9,9 +9,9 @@ en:
discourse_patrons_billing_address: "Collect billing address"
discourse_patrons_reward_badge_name: "Grant this badge to user when a payment is successful"
discourse_patrons_reward_group_name: "Add the user to this group when a payment is successful"
- discourse_patrons_page_description: "Text to be added to /donate page. Markdown is supported."
+ discourse_patrons_page_description: "Text to be added to /patrons page. Markdown is supported."
errors:
- discourse_patrons_amount_must_be_number: "Amounts must be numbers"
+ discourse_patrons_amount_must_be_currency: "Currency amounts must be currencies (eg 1.50)"
js:
discourse_patrons:
diff --git a/config/settings.yml b/config/settings.yml
index cae65b8..c917ca5 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -10,6 +10,12 @@ plugins:
discourse_patrons_description:
client: true
default: ''
+ discourse_patrons_amounts:
+ client: true
+ type: list
+ default: '1.00|2.00|5.00|10.00|20.00|50.00|100.00'
+ regex: "^([0-9]+.[0-9]{2}\\|)+[0-9]+.[0-9]{2}$"
+ regex_error: "site_settings.errors.discourse_patrons_amount_must_be_currency"
discourse_patrons_currency:
client: true
default: "USD"
@@ -18,6 +24,5 @@ plugins:
- AUD
- CAD
- EUR
- - JPY
- GBP
- USD
diff --git a/test/javascripts/components/donation-form-test.es6 b/test/javascripts/components/donation-form-test.es6
index c030f73..bbffb30 100644
--- a/test/javascripts/components/donation-form-test.es6
+++ b/test/javascripts/components/donation-form-test.es6
@@ -10,6 +10,7 @@ componentTest("Discourse Patrons donation form has content", {
"component:stripe-card",
Ember.Component.extend({ tagName: "dummy-component-tag" })
);
+ Discourse.SiteSettings.discourse_patrons_amounts = "1.00|2.01";
},
async test(assert) {
@@ -29,6 +30,7 @@ componentTest("donation form has a confirmation", {
beforeEach() {
this.registry.register("component:stripe-card", Ember.Component.extend());
+ Discourse.SiteSettings.discourse_patrons_amounts = "1.00|2.01";
},
async test(assert) {