Changeset - 19e744788b7f
[Not reviewed]
0 2 0
Brett Smith (brett) - 7 years ago 2017-01-01 15:53:58
brett@sfconservancy.org
supporter: Only render the Annual form for upgraders.

This lets us do more with HTML and less with JavaScript, which is always
nice.
2 files changed with 19 insertions and 16 deletions:
0 comments (0 inline, 0 general)
www/conservancy/static/js/supporter-page.js
Show inline comments
...
 
@@ -21,3 +21,3 @@ var amountIsValid = function(amountInput) {
 
var supportTypeSelector = function(supportTypeHash) {
 
    return $(".supporter-type-selector a[href=" + supportTypeHash + "]");
 
    return $(supportTypeHash + "Selector");
 
};
...
 
@@ -86,8 +86,3 @@ $(document).ready(function() {
 
    $window.bind("hashchange", selectSupportTypeFromHash);
 
    var $selectorLink = selectSupportTypeFromHash();
 
    if (parseFloat($("#annual form").data('upgradeFromAmount')) > 0) {
 
        supportTypeSelector("#annual").click();
 
        $(".supporter-type-selector").hide();
 
    }
 
    else if ($selectorLink.length === 0) {
 
    if (selectSupportTypeFromHash().length === 0) {
 
        supportTypeSelector("#annual").click();
www/conservancy/templates/supporter/index.html
Show inline comments
...
 
@@ -56,11 +56,19 @@
 
  
 
<div class="supporter-type-selector">
 
  <strong>Become a Supporter Now:</strong>   <a id="annualSelector" href="#annual">Annual</a> | <a id="monthlySelector" href="#monthly">Monthly</a> | <a id="renewalSelector" href="#renewal">Annual Renew</a></div>
 

	
 
{% include "supporter/form_partial.html" with form_id="annual" min_amt=minimum_amount partial_amt=partial_amount article="an" only %}
 

	
 
{% include "supporter/form_partial.html" with form_id="monthly" min_amt=10 only %}
 

	
 
<a name="renew" class="hidden"></a>
 
{% include "supporter/form_partial.html" with form_id="renewal" min_amt=120 verb="renew" article="an" supptype="annual" only %}
 
{% if partial_amount > 0 %}
 
  {% include "supporter/form_partial.html" with form_id="annual" min_amt=minimum_amount partial_amt=partial_amount article="an" only %}
 
{% else %}
 
  <div class="supporter-type-selector">
 
    <strong>Become a Supporter Now:</strong>
 
    <a id="annualSelector" href="#annual">Annual</a>
 
    | <a id="monthlySelector" href="#monthly">Monthly</a>
 
    | <a id="renewalSelector" href="#renewal">Annual Renew</a>
 
  </div>
 

	
 
  {% include "supporter/form_partial.html" with form_id="annual" min_amt=120 article="an" only %}
 

	
 
  {% include "supporter/form_partial.html" with form_id="monthly" min_amt=10 only %}
 

	
 
  <a name="renew" class="hidden"></a>
 
  {% include "supporter/form_partial.html" with form_id="renewal" min_amt=120 verb="renew" article="an" supptype="annual" only %}
 
{% endif %}
 

	
0 comments (0 inline, 0 general)