supporter: Fix redundant annual/monthly/renewal ids.

This commit is contained in:
Brett Smith 2016-12-31 18:19:49 -05:00
parent dad41f4817
commit 78c474caac
2 changed files with 12 additions and 18 deletions

View file

@ -70,14 +70,11 @@ $(document).ready(function() {
var $selectedLink = $(event.target); var $selectedLink = $(event.target);
$(".supporter-type-selector a").removeClass("supporter-type-selector-selected"); $(".supporter-type-selector a").removeClass("supporter-type-selector-selected");
$selectedLink.addClass("supporter-type-selector-selected"); $selectedLink.addClass("supporter-type-selector-selected");
$(".supporter-type-selection").each(function(index, element) { $(".supporter-type-selection").hide();
var $element = $(element); var hashIndex = event.target.href.lastIndexOf('#');
if (event.target.href.endsWith("#" + element.id)) { if (hashIndex > -1) {
$element.show(); $(event.target.href.slice(hashIndex)).show();
} else {
$element.hide();
} }
});
$formCorrectionNeeded.addClass('hidden'); $formCorrectionNeeded.addClass('hidden');
return false; return false;
}; };
@ -88,7 +85,7 @@ $(document).ready(function() {
}; };
$window.bind("hashchange", selectSupportTypeFromHash); $window.bind("hashchange", selectSupportTypeFromHash);
var $selectorLink = selectSupportTypeFromHash(); var $selectorLink = selectSupportTypeFromHash();
if (parseFloat($("form#annual").get(0).dataset.upgradeFromAmount) > 0) { if (parseFloat($("#annual form").data('upgradeFromAmount')) > 0) {
supportTypeSelector("#annual").click(); supportTypeSelector("#annual").click();
$(".supporter-type-selector").hide(); $(".supporter-type-selector").hide();
} }

View file

@ -58,11 +58,10 @@
<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> <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>
<div id="annual" class="supporter-type-selection"> <div id="annual" class="supporter-type-selection">
<h3>Join as an Annual Supporter</h3> <h3>Join as an Annual Supporter</h3>
<a id="annual"></a>
<p><strong>Note:</strong> annual supporter is not an automatic renewal <p><strong>Note:</strong> 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 relationship. If you join today, you'll receive an email in about one year to remind you to
optionally renew.</p> optionally renew.</p>
<form id="annual" class="supporter-form" action="https://www.paypal.com/cgi-bin/webscr" method="post" name="supporter" <form class="supporter-form" action="https://www.paypal.com/cgi-bin/webscr" method="post" name="supporter"
data-upgrade-from-amount="{{ partial_amount }}"> data-upgrade-from-amount="{{ partial_amount }}">
<div class="supporter-form-inputs"> <div class="supporter-form-inputs">
<input type="hidden" name="return" value="https://sfconservancy.org/supporter/thank-you.html" /> <input type="hidden" name="return" value="https://sfconservancy.org/supporter/thank-you.html" />
@ -107,7 +106,7 @@
<input type="radio" name="os1" value="joinListNo" />No<br/> <input type="radio" name="os1" value="joinListNo" />No<br/>
<br /> <br />
<br /></div> <br /></div>
<div id="annual" class="supporter-form-submit"> <div>
<input type="image" <input type="image"
src="/img/supporter-payment-button-annual.png" src="/img/supporter-payment-button-annual.png"
height="81" width="188" height="81" width="188"
@ -120,12 +119,11 @@
</div> </div>
<div id="monthly" class="supporter-type-selection"> <div id="monthly" class="supporter-type-selection">
<h3>Join as an Monthly Supporter</h3> <h3>Join as an Monthly Supporter</h3>
<a id="monthly"></a>
<p>Monthly renewal is automatic. Also, monthly supporters might not receive tangible Supporter benefits (such as <p>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 the t-shirt) until they've reached at least $60 in monthly supporter
donations. However, they will be included immediately donations. However, they will be included immediately
in the <a href="/sponsors/#supporters">Supporters' list</a>.</p> in the <a href="/sponsors/#supporters">Supporters' list</a>.</p>
<form id="monthly" class="supporter-form" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> <form class="supporter-form" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<div class="supporter-form-inputs"> <div class="supporter-form-inputs">
<input type="hidden" name="business" value="supporter@sfconservancy.org" /> <input type="hidden" name="business" value="supporter@sfconservancy.org" />
<input type="hidden" name="item_name" value="Conservancy Supporter, Monthly" /> <input type="hidden" name="item_name" value="Conservancy Supporter, Monthly" />
@ -173,7 +171,7 @@
<input type="radio" checked="checked" name="os1" value="joinListYes" />Yes <input type="radio" checked="checked" name="os1" value="joinListYes" />Yes
<input type="radio" name="os1" value="joinListNo" />No<br/> <input type="radio" name="os1" value="joinListNo" />No<br/>
<br /></div> <br /></div>
<div id="monthly" class="supporter-form-submit"> <div>
<input type="image" <input type="image"
src="/img/supporter-payment-button-monthly.png" src="/img/supporter-payment-button-monthly.png"
height="81" width="188" height="81" width="188"
@ -187,11 +185,10 @@
<div id="renewal" class="supporter-type-selection"> <div id="renewal" class="supporter-type-selection">
<h3 id="renew">Renew as an Annual Supporter</h3> <h3 id="renew">Renew as an Annual Supporter</h3>
<a id="renewal"></a>
<p><strong>Note:</strong> This option is for existing annual supporters who <p><strong>Note:</strong> This option is for existing annual supporters who
seek to renew for another year. The annual renewal is not automatic; seek to renew for another year. The annual renewal is not automatic;
annual supporters are emailed each year to invite them to optionally renew. </p> annual supporters are emailed each year to invite them to optionally renew. </p>
<form id="renewal" class="supporter-form" action="https://www.paypal.com/cgi-bin/webscr" method="post" name="supporter"> <form class="supporter-form" action="https://www.paypal.com/cgi-bin/webscr" method="post" name="supporter">
<div class="supporter-form-inputs"> <div class="supporter-form-inputs">
<input type="hidden" name="return" value="https://sfconservancy.org/supporter/thank-you.html" /> <input type="hidden" name="return" value="https://sfconservancy.org/supporter/thank-you.html" />
<input type="hidden" name="cmd" value="_xclick" /> <input type="hidden" name="cmd" value="_xclick" />
@ -235,7 +232,7 @@
<input type="radio" name="os1" value="joinListNo" />No<br/> <input type="radio" name="os1" value="joinListNo" />No<br/>
<br /> <br />
<br /></div> <br /></div>
<div id="renewal" class="supporter-form-submit"> <div>
<input type="image" <input type="image"
src="/img/supporter-payment-button-renewal.png" src="/img/supporter-payment-button-renewal.png"
height="81" width="188" height="81" width="188"