Leave text w/ percentage when no progressbar

The progressbar is generated by Javascript.  As such, the text here
won't have a progressbar formatted around it when the browser doesn't
support Javascript.

However, since the Javascript does update the text, we can format the
Django template to put in place text that we wish will appear when no
Javascript is turned on, and then allow the Javascript to make it right
when it's available.

Graceful degradation: I may be its last proponent.
This commit is contained in:
Bradley M. Kuhn 2015-03-08 22:08:14 -07:00
parent b88b6bd211
commit a8bd5a2129
2 changed files with 2 additions and 2 deletions

View file

@ -106,7 +106,7 @@ el.attachEvent('on'+ev, function() {handler.apply(el);});
<h3>Support NPO Accounting Project Now!</h3>
$<span id="fundraiser-so-far">{{ fundgoal.fundraiser_so_far_amount|floatformat:0|intcomma }}</span> raised toward<br/>
our $<span id="fundraiser-goal">{{ fundgoal.fundraiser_goal_amount|floatformat:0|intcomma }}</span> goal.<br/>
<div id="progressbar"><span id="fundraiser-percentage">{{ fundgoal.percentage_there|floatformat:1 }}%</span></div>
<div id="progressbar"><span id="fundraiser-percentage">(i.e., {{ fundgoal.percentage_there|floatformat:1 }}%)</span></div>
<p style="font-size: 75%">(Progress bar updated daily.)</p>
<a id="donate" style="text-decoration:none"></a>
<h3>Help us reach our goal:</h3>

View file

@ -22,7 +22,7 @@
$<span id="fundraiser-so-far">{{ fundgoal.fundraiser_so_far_amount|floatformat:0|intcomma }}</span>
of $<span id="fundraiser-goal">{{ fundgoal.fundraiser_goal_amount|floatformat:0|intcomma }}</span> match met.<br/>
<div id="progressbar"><span id="fundraiser-percentage">{{ fundgoal.percentage_there|floatformat:1 }}%</span></div>
<div id="progressbar"><span id="fundraiser-percentage">(i.e., {{ fundgoal.percentage_there|floatformat:1 }}%)</span></div>
<p>Donate now via PayPal:
</p>