From b90413809f26b0496f20dbc4de1964c679242677 2014-12-02 18:35:53 From: Bradley M. Kuhn Date: 2014-12-02 18:35:53 Subject: [PATCH] Subscriptions for monthly supporters. There are now two options at the bottom of the page, annual and monthly supporters. In addition, there is Javascript code to cause the annual and monthly items disappear and reappear upon selection either in the donate box or the selector above the items. I tested this in links and it seems to degrade reasonably well. --- diff --git a/www/conservancy/static/forms.css b/www/conservancy/static/forms.css index 145c2e75ebaaf56b5a2cc180414a0ef7abd41c99..9981a74f16ac91c575cd1ebc470fef5222ac0e90 100644 --- a/www/conservancy/static/forms.css +++ b/www/conservancy/static/forms.css @@ -34,3 +34,13 @@ input.invalid, textarea.invalid { input.valid, textarea.valid { border: 2px solid green; } + +div.supporter-type-selector { + font-size: 125%; + text-align: center; +} + +.supporter-type-selection { + clear: both; + padding-bottom: 60px; +} diff --git a/www/conservancy/static/supporter-page.js b/www/conservancy/static/supporter-page.js index f18a8306ff957b623827aa9681f60298c0fb22cf..0c0fcb4552a191cf5ac3b024684f838194de2b7c 100644 --- a/www/conservancy/static/supporter-page.js +++ b/www/conservancy/static/supporter-page.js @@ -47,6 +47,44 @@ $(document).ready(function() { input.removeClass("valid").addClass("invalid"); errorElement.removeClass("form-error").addClass("form-error-show"); } - }); + }); + /* Handle toggling of annual/monthly form selections */ + $('.supporter-type-selection#monthly').hide(); + $('#annualSelector').css("font-weight", "bold").css("font-size", "127%"); + + $("a[href$='monthly']").bind('click', function() { + $('.supporter-type-selection#annual').hide(); + $('.supporter-type-selection#monthly').show(); + $('#monthlySelector').css("font-weight", "bold").css("font-size", "127%"); + $('#annualSelector').css("font-weight", "normal").css("font-size", "125%"); + }); + $("a[href$='annual']").bind('click', function() { + $('.supporter-type-selection#annual').show(); + $('.supporter-type-selection#monthly').hide(); + $('#annualSelector').css("font-weight", "bold").css("font-size", "127%"); + $('#monthlySelector').css("font-weight", "normal").css("font-size", "125%"); + }); }); + +$(window).load(function () { + verifySelctionCorrectOnPageLoad = function() { + var ourURL = document.URL; + if (ourURL.search("#monthly") > 0) { + $('.supporter-type-selection#annual').hide(); + $('.supporter-type-selection#monthly').show(); + $('#monthlySelector').css("font-weight", "bold").css("font-size", "127%"); + $('#annualSelector').css("font-weight", "normal").css("font-size", "125%"); + } + if (ourURL.search("#annual") > 0) { + $('.supporter-type-selection#monthly').hide(); + $('.supporter-type-selection#annual').show(); + $('#annualSelector').css("font-weight", "bold").css("font-size", "127%"); + $('#monthlySelector').css("font-weight", "normal").css("font-size", "125%"); + } + } + if (location.hash) { + setTimeout(verifySelctionCorrectOnPageLoad, 1); + } + window.addEventListener("hashchange", verifySelctionCorrectOnPageLoad); +}); diff --git a/www/conservancy/static/supporter/index.html b/www/conservancy/static/supporter/index.html index 26f35188d0d0b863ae6a6857cbc89b945f185e0a..e73375e3361d7d3c12450b6844bcf4316c9e1bb2 100644 --- a/www/conservancy/static/supporter/index.html +++ b/www/conservancy/static/supporter/index.html @@ -20,9 +20,10 @@ Now!

Become a Supporter now!

-

Support us via PayPal or credit card.

+

Annual supporter via PayPal, ACH, or credit card.

+

Monthly supporter via PayPal, ACH, or credit card.

-Other payment methods to become a supporter: +Other payment methods to become an annual supporter:

Wire Transfer

@@ -118,8 +119,12 @@ internal policies are published and available for scrutiny.

[1] the shirts will ship First Quarter 2015. -

Become a Supporter Now!

- +
+
+ Become a Supporter Now: Annual | Monthly
+
+

Join as an Annual Supporter

+
@@ -170,5 +175,55 @@ internal policies are published and available for scrutiny.

- +
+

Join as an Monthly Supporter

+ +

Monthly supporters will not receive their t-shirts until they've been a + monthly supporter for at least 12 months.

+
+
+ + + + + + Yes + No +
+ + +
+ + + Yes + No
+ + + Yes + No
+
+
+ + +
You will be redirected to PayPal's site when you click “Subscribe”. +
+
+
+
{% endblock %}