Changeset - 8605b65783f9
[Not reviewed]
0 3 0
Brett Smith (brett) - 7 years ago 2017-01-01 18:53:41
brett@sfconservancy.org
supporter: Move more presentation rules to CSS.

This commit keeps the presentation basically the same, it just moves
presentation rules out of HTML and into CSS. It's not pixel-perfect but
pretty close.
3 files changed with 81 insertions and 64 deletions:
0 comments (0 inline, 0 general)
www/conservancy/static/css/forms.css
Show inline comments
 
.supporter-type-selection .prolog > span:first-child {
 
    font-weight: bold;
 
}
 

	
 
.supporter-form label {
...
 
@@ -4,2 +8,3 @@
 
    text-align: right;
 
    font-weight: bold;
 
}
...
 
@@ -19,3 +24,3 @@
 
    padding-top: 40px;
 
    float: center;
 
    font-size: small;
 
}
...
 
@@ -27,6 +32,2 @@
 

	
 
.supporter-form div {
 
    margin-top: 1em;
 
}
 

	
 
.dinner-form div {
www/conservancy/static/js/conservancy.js
Show inline comments
...
 
@@ -90,12 +90,12 @@ $(document).ready(function() {
 
    $('input[name=on0]:radio').change(function() {
 
        var input=$(this);
 
        var tShirtSelector = input.parent().children('.t-shirt-size-selector')
 
        var noShippingSelector = input.parent().children('input[name=no_shipping]');
 
        var value = input.val();
 
        if (value == "wantGiftYes") {
 
            tShirtSelector.show();
 
            noShippingSelector.val("2");
 
        var $input = $(this);
 
        var $form = $input.parents('form').last();
 
        var $tShirtSelector = $('.t-shirt-size-selector', $form);
 
        var $noShippingSelector = $('input[name=no_shipping]', $form);
 
        if ($input.val() == "wantGiftYes") {
 
            $tShirtSelector.show();
 
            $noShippingSelector.val("2");
 
        } else {
 
            tShirtSelector.hide();
 
            noShippingSelector.val("0");
 
            $tShirtSelector.hide();
 
            $noShippingSelector.val("0");
 
        }
www/conservancy/templates/supporter/form_partial.html
Show inline comments
...
 
@@ -32,8 +32,9 @@ This partial accepts these optional parameters:
 

	
 
  {% if form_id == "annual" %}
 
  <p><strong>Note:</strong> annual supporter is not an automatic renewal
 
  <p class="prolog"><span>Note:</span>
 
    {% if form_id == "annual" %}
 
    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.</p>
 
  {% elif form_id == "monthly" %}
 
  <p>Monthly renewal is automatic.  Also, monthly supporters might not
 
    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
...
 
@@ -44,9 +45,10 @@ This partial accepts these optional parameters:
 
    However, they will be included immediately in
 
    the <a href="/sponsors/#supporters">Supporters' list</a>.</p>
 
  {% elif form_id == "renewal" %}
 
  <p><strong>Note:</strong> This option is for existing annual supporters
 
    the <a href="/sponsors/#supporters">Supporters' list</a>.
 
    {% elif form_id == "renewal" %}
 
    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.</p>
 
  {% endif %}
 
    optionally renew.
 
    {% endif %}
 
  </p>
 

	
...
 
@@ -62,23 +64,28 @@ This partial accepts these optional parameters:
 
             >
 
      {% if form_id == "monthly" %}
 
      <input type="hidden" name="cmd" value="_xclick-subscriptions">
 
      <input type="hidden" name="lc" value="US">
 
      <input type="hidden" name="no_note" value="1">
 
      <input type="hidden" name="t3" value="M">
 
      <input type="hidden" name="p3" value="1">
 
      <input type="hidden" name="src" value="1">
 
      <input type="hidden" name="srt" value="0">
 
      <label for="a3"><strong>Monthly Amount:</strong> $</label>
 
      <input type="number" name="a3" size="5"
 
             min="{{ min_amt }}" value="{{ default_amt }}">
 
      {% else %}
 
      <input type="hidden" name="cmd" value="_xclick">
 
      <label for="amount"><strong>Amount:</strong> $</label>
 
      <input type="number" name="amount" size="5"
 
             min="{{ min_amt }}" value="{{ default_amt }}">
 
      {% endif %}
 
      <span class="form-error">${{ min_amt|add:partial_amt }} is a minimum for
 
        Conservancy Supporters.
 
        <a href="/donate">Donate smaller amounts here</a>.</span><br>
 
      <label for="wantGift"><strong>Do you want to receive
 

	
 
      <div class="supporter-form-input">
 
        {% if form_id == "monthly" %}
 
        <input type="hidden" name="cmd" value="_xclick-subscriptions">
 
        <input type="hidden" name="lc" value="US">
 
        <input type="hidden" name="no_note" value="1">
 
        <input type="hidden" name="t3" value="M">
 
        <input type="hidden" name="p3" value="1">
 
        <input type="hidden" name="src" value="1">
 
        <input type="hidden" name="srt" value="0">
 
        <label for="a3">Monthly Amount: $</label>
 
        <input type="number" name="a3" size="5"
 
               min="{{ min_amt }}" value="{{ default_amt }}">
 
        {% else %}
 
        <input type="hidden" name="cmd" value="_xclick">
 
        <label for="amount">Amount: $</label>
 
        <input type="number" name="amount" size="5"
 
               min="{{ min_amt }}" value="{{ default_amt }}">
 
        {% endif %}
 
        <span class="form-error">${{ min_amt|add:partial_amt }} is a minimum for
 
          Conservancy Supporters.
 
          <a href="/donate">Donate smaller amounts here</a>.</span>
 
      </div>
 

	
 
      <div class="supporter-form-input">
 
        <label for="wantGift">Do you want to receive
 
          {% if form_id == "renewal" %}
...
 
@@ -88,8 +95,9 @@ This partial accepts these optional parameters:
 
          {% endif %}
 
          t-shirt? </strong></label>
 
      <input type="radio" name="on0" value="wantGiftYes">Yes
 
      <input type="radio" checked="checked" name="on0" value="wantGiftNo">No
 
      <br>
 
      <span class="t-shirt-size-selector">
 
        <label for="tShirtSize"><strong>T-shirt size: </strong></label>
 
          t-shirt? </label>
 
        <input type="radio" name="on0" value="wantGiftYes">Yes
 
        <input type="radio" checked="checked" name="on0" value="wantGiftNo">No
 
      </div>
 

	
 
      <div class="supporter-form-input t-shirt-size-selector">
 
        <label for="tShirtSize">T-shirt size: </label>
 
        <select name="os0">
...
 
@@ -108,13 +116,21 @@ This partial accepts these optional parameters:
 
          <option value="FittedLadiesXL">Fitted Ladies' XL</option>
 
        </select><br></span>
 
      <label for="publicAck"><strong>
 
          Should we <a href="/sponsors#supporters">list you publicly</a> as a Conservancy Supporter? </strong></label>
 
      <input type="radio" checked="checked" name="on1" value="publicAckYes">Yes
 
      <input type="radio" name="on1" value="publicAckNo">No<br>
 
      <label for="joinList"><strong>Join Conservancy's
 
          Low-Traffic Announcement Email List? </strong></label>
 
      <input type="radio" checked="checked" name="os1" value="joinListYes">Yes
 
      <input type="radio" name="os1" value="joinListNo">No<br>
 
      <br></div>
 
    <div>
 
        </select>
 
      </div>
 

	
 
      <div class="supporter-form-input">
 
        <label for="publicAck">
 
          Should we <a href="/sponsors#supporters">list you publicly</a> as a Conservancy Supporter? </label>
 
        <input type="radio" checked="checked" name="on1" value="publicAckYes">Yes
 
        <input type="radio" name="on1" value="publicAckNo">No
 
      </div>
 

	
 
      <div class="supporter-form-input">
 
        <label for="joinList">Join Conservancy's
 
          Low-Traffic Announcement Email List? </label>
 
        <input type="radio" checked="checked" name="os1" value="joinListYes">Yes
 
        <input type="radio" name="os1" value="joinListNo">No
 
      </div>
 
    </div>
 

	
 
    <div class="supporter-form-submit">
 
      <input type="image" name="submit"
...
 
@@ -123,5 +139,5 @@ This partial accepts these optional parameters:
 
             alt="{{ verb|capfirst }} as {{ article }} {{ supptype|capfirst }} Supporter Now!">
 
      <br><br><small>Button above redirects to PayPal's site for credit
 
      <p>Button above redirects to PayPal's site for credit
 
        card, bank account or PayPal balance payment methods.  Select
 
        options first.</small>
 
        options first.</p>
 
    </div>
0 comments (0 inline, 0 general)