Commit 8b4bfe18 authored by Stephanie Kirtiadi's avatar Stephanie Kirtiadi Committed by peterh-gr
Browse files

Added 10 prices on donation page for single and montly donation page.

Now Lektor users can change the values on the buttons from the GUI

Issue #48272
parent 3f3d7e87
......@@ -2,10 +2,32 @@ _model: donate-form
---
frequency: both
---
section:
section:
---
title: Donate
---
_template: layout.html
---
html: donate-form.html
---
intro:
---
monthly_five: 10000
---
monthly_four: 5000
---
monthly_one: 500
---
monthly_three: 2500
---
monthly_two: 1000
---
single_five: 50000
---
single_four: 25000
---
single_one: 2500
---
single_three: 12500
---
single_two: 7500
......@@ -30,6 +30,46 @@ translate = False
label = Body
type = markdown
[fields.single_one]
label = Single Price 1 (in US cents)
type = string
[fields.single_two]
label = Single Price 2 (in US cents)
type = string
[fields.single_three]
label = Single Price 3 (in US cents)
type = string
[fields.single_four]
label = Single Price 4 (in US cents)
type = string
[fields.single_five]
label = Single Price 5 (in US cents)
type = string
[fields.monthly_one]
label = Monthly Price 1 (in US cents)
type = string
[fields.monthly_two]
label = Monthly Price 2 (in US cents)
type = string
[fields.monthly_three]
label = Monthly Price 3 (in US cents)
type = string
[fields.monthly_four]
label = Monthly Price 4 (in US cents)
type = string
[fields.monthly_five]
label = Monthly Price 5 (in US cents)
type = string
[fields.color]
label = Color
type = string
......
......@@ -10,13 +10,13 @@ import {PaymentOptionButton} from './payment_option_button';
import {PerkSelectionSection} from './perk_selection_section';
import {GivingInfoForm} from './giving_info_form';
import {GivingErrorContainer} from './giving_error_container';
import {perks, pricesOnButtons, paymentMethods, shirtFits, sweatshirtSizes, requiredFields, textFields, initialSelectedPrices, displayPerkSelections, initialFrequency, stripeTokenFieldMap} from './settings';
import {perks, paymentMethods, shirtFits, sweatshirtSizes, requiredFields, textFields, initialSelectedPrices, displayPerkSelections, initialFrequency, stripeTokenFieldMap} from './settings';
import {AppContext} from './app_context';
import {LoadingDialogReactPages} from './loading_dialog_react_pages';
import {FrequencySelector} from './frequency_selector';
export function _GivingForm(props) {
const {stripe, frequencyOptions, donateProccessorBaseUrl} = props;
const {stripe, frequencyOptions, pricesOnButtons, donateProccessorBaseUrl} = props;
const [frequency, setFrequency] = useState(initialFrequency[frequencyOptions]);
const displayPerkSelection = displayPerkSelections[frequency];
const [noPerk, setNoPerk] = useState(true);
......
......@@ -65,11 +65,6 @@ export const perks = [
}
];
export const pricesOnButtons = {
'single': [2500, 7500, 12500, 25000, 50000],
'monthly': [500, 1000, 2500, 5000, 10000],
};
export const paymentMethods = [
{
'name': 'credit-card',
......
......@@ -18,6 +18,10 @@
props: {
'stripePublishableKey': `{{ bag('donate', envvars('ENV'), 'stripePublishableKey') }}`,
'frequencyOptions': `{{ this.frequency }}`,
'pricesOnButtons': {
'single': [`{{ this.single_one }}`, `{{ this.single_two }}`, `{{ this.single_three }}`, `{{ this.single_four }}`, `{{ this.single_five }}`],
'monthly': [`{{ this.monthly_one }}`, `{{ this.monthly_two }}`, `{{ this.monthly_three }}`, `{{ this.monthly_four }}`, `{{ this.monthly_five }}`]
},
'donateProccessorBaseUrl': `{{ bag('donate', envvars('ENV'), 'donateProccessorBaseUrl') }}`
},
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment