diff --git a/conservancy/supporters/forms.py b/conservancy/supporters/forms.py index 8f82ef6c..2394b721 100644 --- a/conservancy/supporters/forms.py +++ b/conservancy/supporters/forms.py @@ -33,6 +33,9 @@ class SustainerForm(forms.ModelForm): template_name = 'supporters/sustainer_form.html' + MONTH_OPTIONS = [12, 25, 50, 100] + YEAR_OPTIONS = [128, 250, 500, 1000] + class Meta: model = SustainerOrder fields = [ @@ -63,14 +66,14 @@ class SustainerForm(forms.ModelForm): self.renderer = SustainerFormRenderer() self.fields['recurring'].label = '' + self.fields['amount'].initial = self.YEAR_OPTIONS[0] # So we can write to this field easily from Alpine JS. self.fields['amount'].widget.attrs['x-ref'] = 'amount' self.fields['amount'].widget.attrs['style'] = 'width: 5rem' self.fields['email'].help_text = 'For your payment receipt' - self.fields['tshirt_size'].help_text = mark_safe("""Sizing chart: Women's, Men's""") + self.fields['tshirt_size'].help_text = mark_safe("""Sizing chart: Women's, Men's""") self.fields['tshirt_size'].widget.attrs['x-model'] = 'tshirt_size' - def clean(self): super().clean() recurring = self.cleaned_data.get('recurring', '') diff --git a/conservancy/supporters/templates/supporters/field.html b/conservancy/supporters/templates/supporters/field.html index 9a8b305d..8d44434a 100644 --- a/conservancy/supporters/templates/supporters/field.html +++ b/conservancy/supporters/templates/supporters/field.html @@ -6,6 +6,6 @@ {% if field.label %}{{ field.label_tag }}{% endif %} {% endif %} {{ field.errors }} -{{ field }} +