Changeset - 027964192a65
[Not reviewed]
0 2 0
Bradley Kuhn (bkuhn) - 9 years ago 2015-03-09 04:21:58
bkuhn@ebb.org
Function to compute how far to the goal we are.

This is also inserted by the Javascript code as well, but no reason we
can't compute it server side, too.
2 files changed with 7 insertions and 3 deletions:
0 comments (0 inline, 0 general)
www/conservancy/apps/fundgoal/models.py
Show inline comments
...
 
@@ -10,5 +10,8 @@ class FundraisingGoal(models.Model):
 
    def __unicode__(self):
 
        return self.fundraiser_code_name
 

	
 
    def percentage_there(self):
 
        return (fundraiser_so_far_amount / fundraiser_goal_amount ) * 100.00
 
    
 
    class Meta:
 
        ordering = ('fundraiser_code_name',)
www/conservancy/static/npoacct/index.html
Show inline comments
...
 
@@ -136,9 +136,10 @@ el.attachEvent('on'+ev, function() {handler.apply(el);});
 
*/
 
</script>
 
-->
 
${{ fundgoal.fundraiser_so_far_amount|floatformat:2|intcomma }} raised toward<br/>
 
our ${{ fundgoal.fundraiser_goal_amount|floatformat:2|intcomma  }} goal.<br/>
 
<div id="progressbar"><span style="float:right; align:center; margin-right:40%">88.4%</span></div>
 
${{ fundgoal.fundraiser_so_far_amount|floatformat:0|intcomma }} raised toward<br/>
 
our ${{ fundgoal.fundraiser_goal_amount|floatformat:0|intcomma  }} goal.<br/>
 
<div id="progressbar"><span style="float:right; align:center;
 
                                   margin-right:40%">{{ fundgoal.percentage_there|floatformat:1 }}%</span></div>
 
<p style="font-size: 75%">(Progress bar updated monthly.)</p>
 
<a id="donate" style="text-decoration:none"></a>
 
<h3>Help us reach our goal:</h3>
0 comments (0 inline, 0 general)