GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit 05c7fa51 authored by peterh-gr's avatar peterh-gr
Browse files

Added fields for t-shirt option labels

They want to be able to change the t-shirts. A lot of the t-shirt stuff
is sort of hard-coded, but we can change the lables pretty easily as
long as it's undrstood that the names don't get changed on the back end.
parent 78cfd0ed
......@@ -89,3 +89,7 @@ header_image: /static/images/donate/donate-header.png
success_redirect_url:
---
counter: yes
---
tshirt_pack_second_shirt_options_label: Take back the Internet with Tor
---
tshirt_perk_options_label: Tor: Strength in Numbers
......@@ -188,6 +188,14 @@ type = string
label = Sweatshirt Perk Description (Monthly)
type = string
[fields.tshirt_perk_options_label]
label = T-Shirt Perk Options Label
type = string
[fields.tshirt_pack_second_shirt_options_label]
label = T-Shirt Pack Second Shirt Options Label
type = string
[fields.html]
label = Html
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 {paymentMethods, shirtFits, sweatshirtSizes, requiredFields, textFields, displayPerkSelections, stripeTokenFieldMap} from './settings';
import {paymentMethods, sweatshirtSizes, requiredFields, textFields, displayPerkSelections, 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, pricesOnButtons, donateProccessorBaseUrl, perks, initialSelectedPrices, defaultFrequencyForBoth, successRedirectUrl} = props;
const {stripe, frequencyOptions, pricesOnButtons, donateProccessorBaseUrl, perks, initialSelectedPrices, defaultFrequencyForBoth, successRedirectUrl, shirtFits} = props;
const [frequency, setFrequency] = useState((frequencyOptions == 'both')? defaultFrequencyForBoth : frequencyOptions);
const displayPerkSelection = displayPerkSelections[frequency];
const [noPerk, setNoPerk] = useState(true);
......
......@@ -11,35 +11,6 @@ export const paymentMethods = [
}
];
export const shirtFits = {
'strength-in-numbers': {
'friendly-name': 'Tor: Strength in Numbers',
'fits': {
'slim': {
'friendly-name': 'Slim',
'sizes': ['s', 'm', 'l', 'xl', 'xxl']
},
'classic': {
'friendly-name': 'Classic',
'sizes': ['s', 'm', 'l', 'xl', 'xxl']
},
}
},
'take-back-internet': {
'friendly-name': 'Take back the Internet with Tor',
'fits': {
'slim': {
'friendly-name': 'Slim',
'sizes': ['s', 'm', 'l', 'xl', 'xxl']
},
'classic': {
'friendly-name': 'Classic',
'sizes': ['s', 'm', 'l', 'xl', 'xxl']
},
}
},
};
export const sweatshirtSizes = ['s', 'm', 'l', 'xl', 'xxl'];
export function requiredFields(paymentMethod, perk) {
......
......@@ -126,6 +126,35 @@
'requiredFields': ['sweatshirtSize'],
},
],
'shirtFits': {
'strength-in-numbers': {
'friendly-name': `{{ this.tshirt_perk_options_label }}`,
'fits': {
'slim': {
'friendly-name': 'Slim',
'sizes': ['s', 'm', 'l', 'xl', 'xxl']
},
'classic': {
'friendly-name': 'Classic',
'sizes': ['s', 'm', 'l', 'xl', 'xxl']
},
}
},
'take-back-internet': {
'friendly-name': `{{ this.tshirt_pack_second_shirt_options_label }}`,
'fits': {
'slim': {
'friendly-name': 'Slim',
'sizes': ['s', 'm', 'l', 'xl', 'xxl']
},
'classic': {
'friendly-name': 'Classic',
'sizes': ['s', 'm', 'l', 'xl', 'xxl']
},
}
},
},
'defaultFrequencyForBoth': `{{ this.default_frequency_for_both }}`,
'initialSelectedPrices': {
'single': parseInt(`{{ this.single_three }}`),
......
Markdown is supported
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