From b4883ca6bd25aa203f63e51afe19e378be7024e1 Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Sun, 1 Jan 2017 10:24:19 -0500 Subject: [PATCH] supporter: Make a partial for the supporter form. This commit shouldn't make any substantial changes to the form or its presentation. This is just cleaning things up as a development aid. --- .../templates/supporter/form_partial.html | 130 ++++++++++++ .../templates/supporter/index.html | 188 +----------------- 2 files changed, 135 insertions(+), 183 deletions(-) create mode 100644 www/conservancy/templates/supporter/form_partial.html diff --git a/www/conservancy/templates/supporter/form_partial.html b/www/conservancy/templates/supporter/form_partial.html new file mode 100644 index 00000000..f4e0a11f --- /dev/null +++ b/www/conservancy/templates/supporter/form_partial.html @@ -0,0 +1,130 @@ +{% comment %} + +This partial requires these parameters: + +* `form_id`: The type of Supportership this form enrolls. One of "annual", + "monthly", or "renewal". + Note that the form substantially changes the form based on this value. + If you're changing this later to add a type, you'll want to consider how + to handle all those. +* `min_amt`: The lowest amount of support the form will accept. + +This partial accepts these optional parameters: + +* `supptype`: Used in text to describe what type of Supporter this is. + By default, it's generated from form_id. + Override it for renewals. +* `article`: Used in front of `form_id` when it's written in the form. + Default "a". Set it to "an" when `supptype` begins with a vowel. +* `verb`: Used in form text to describe the sign-up process. + Default "join". Use "renew" when `form_id` is "renewal". +* `default_amt`: The amount of support the form loads with. + Default `min_amt`. +* `partial_amt`: This form is for a donor who previously gave `partial_amt`, + and is letting them contribute `min_amt` more to get up the usual + Supporter amount. This is attached to the form as a data attribute. + +{% endcomment %} + +{% with supptype=supptype|default:form_id article=article|default:"a" verb=verb|default:"join" default_amt=default_amt|default:min_amt partial_amt=partial_amt|default:0 %} +
+

{{ verb|capfirst }} as {{ article }} {{ supptype|capfirst }} Supporter

+ + {% if form_id == "annual" %} +

Note: annual supporter is not an automatic renewal + relationship. If you join today, you'll receive an email in about one + year to remind you to optionally renew.

+ {% elif form_id == "monthly" %} +

Monthly renewal is automatic. Also, monthly supporters might not + receive tangible Supporter benefits (such as the t-shirt) until they've + reached at least + {# Six months of payments #} + ${{ min_amt|add:min_amt|add:min_amt|add:min_amt|add:min_amt|add:min_amt }} + in monthly supporter donations. + However, they will be included immediately in + the Supporters' list.

+ {% elif form_id == "renewal" %} +

Note: This option is for existing annual supporters + who seek to renew for another year. The annual renewal is not + automatic; annual supporters are emailed each year to invite them to + optionally renew.

+ {% endif %} + +
+
+ + + + + {% if form_id == "monthly" %} + + + + + + + + + + {% else %} + + + + {% endif %} + ${{ min_amt|add:partial_amt }} is a minimum for + Conservancy Supporters. + Donate smaller amounts here.
+ + Yes + No +
+ + +
+ + Yes + No
+ + Yes + No
+
+
+ +

Button above redirects to PayPal's site for credit + card, bank account or PayPal balance payment methods. Select + options first. +
+
+
+{% endwith %} diff --git a/www/conservancy/templates/supporter/index.html b/www/conservancy/templates/supporter/index.html index 15e8cebb..52d71a98 100644 --- a/www/conservancy/templates/supporter/index.html +++ b/www/conservancy/templates/supporter/index.html @@ -56,192 +56,14 @@
Become a Supporter Now: Annual | Monthly | Annual Renew
-
-

Join as an Annual Supporter

-

Note: annual supporter is not an automatic renewal - relationship. If you join today, you'll receive an email in about one year to remind you to - optionally renew.

-
-
- - - - - - - - $120 is a minimum for Conservancy - Supporters. Donate smaller amounts here.
- - Yes - No -
- - -
- - Yes - No
- - - Yes - No
-
-
-
- - -

Button above redirects to PayPal's site for credit - card, bank account or PayPal balance payment methods. Select options first. -
-
-
-
-

Join as an Monthly Supporter

-

Monthly renewal is automatic. Also, monthly supporters might not receive tangible Supporter benefits (such as - the t-shirt) until they've reached at least $60 in monthly supporter - donations. However, they will be included immediately - in the Supporters' list.

-
-
- - - - - - - - - - - - - - - $10/month is a minimum for Conservancy - Supporters. Donate smaller amounts here.
- - Yes - No -
- - -
- - Yes - No
- - Yes - No
-
-
- -

Button above redirects to PayPal's site for credit - card, bank account or PayPal balance payment methods. Select - options first. -
-
-
+{% include "supporter/form_partial.html" with form_id="annual" min_amt=minimum_amount partial_amt=partial_amount article="an" only %} -
-

Renew as an Annual Supporter

-

Note: This option is for existing annual supporters who - seek to renew for another year. The annual renewal is not automatic; - annual supporters are emailed each year to invite them to optionally renew.

-
-
- - - - - - - - $120 is a minimum for Conservancy - Supporters. Donate smaller amounts here.
+{% include "supporter/form_partial.html" with form_id="monthly" min_amt=10 only %} + + +{% include "supporter/form_partial.html" with form_id="renewal" min_amt=120 verb="renew" article="an" supptype="annual" only %} - - Yes - No -
- - -
- - Yes - No
- - - Yes - No
-
-
-
- - -

Button above redirects to PayPal's site for credit - card, bank account or PayPal balance payment methods. Select options - first. Choosing options here will change any previous settings. -
Please ensure all form data above is correct.