diff --git a/www/conservancy/apps/fundgoal/models.py b/www/conservancy/apps/fundgoal/models.py
index e208a22e..704b7528 100644
--- a/www/conservancy/apps/fundgoal/models.py
+++ b/www/conservancy/apps/fundgoal/models.py
@@ -7,6 +7,8 @@ class FundraisingGoal(models.Model):
fundraiser_code_name = models.CharField(max_length=200, blank=False, unique=True)
fundraiser_goal_amount = models.DecimalField(max_digits=10, decimal_places=2)
fundraiser_so_far_amount = models.DecimalField(max_digits=10, decimal_places=2)
+ fundraiser_donation_count = models.IntegerField()
+ fundraiser_donation_count_disclose_threshold = models.IntegerField()
def __unicode__(self):
return self.fundraiser_code_name
diff --git a/www/conservancy/static/npoacct/index.html b/www/conservancy/static/npoacct/index.html
index f8a40ee6..029653ec 100644
--- a/www/conservancy/static/npoacct/index.html
+++ b/www/conservancy/static/npoacct/index.html
@@ -104,6 +104,9 @@ el.attachEvent('on'+ev, function() {handler.apply(el);});
-->
Support NPO Accounting Project Now!
+{% if fundgoal.fundraiser_donation_count > fundgoal.fundraiser_donation_count_disclose_threshold %}
+Thanks to {{ fundgoal.fundraiser_donation_count|intcomma }} donations,
+{% endif %}
${{ fundgoal.fundraiser_so_far_amount|floatformat:0|intcomma }} raised toward
our ${{ fundgoal.fundraiser_goal_amount|floatformat:0|intcomma }} goal.
(i.e., {{ fundgoal.percentage_there|floatformat:1 }}%)
diff --git a/www/conservancy/static/supporter-page.js b/www/conservancy/static/supporter-page.js
index 910c679d..fd7b3477 100644
--- a/www/conservancy/static/supporter-page.js
+++ b/www/conservancy/static/supporter-page.js
@@ -7,11 +7,14 @@
$(document).ready(function() {
var goal = $('span#fundraiser-goal').text();
var soFar = $('span#fundraiser-so-far').text();
+ var donationCount = $('span#fundraiser-donation-count').text();
var noCommaGoal = goal.replace(/,/g, "");
var noCommaSoFar = soFar.replace(/,/g, "");
+ var noCommaDonationCount = parseInt(donationCount.replace(/,/g, ""));
var percentage = (parseFloat(noCommaSoFar) / parseFloat(noCommaGoal)) * 100;
var curValue = 0.00;
var incrementSoFar = 0.00;
+ var incrementDonationCount = 0;
$('span#fundraiser-percentage').text("");
$('span#fundraiser-percentage').css({ 'color' : 'green',
@@ -22,7 +25,7 @@ $(document).ready(function() {
'text-align' : 'inherit'});
$("#progressbar").progressbar({ value: curValue });
- function slowRise() {
+ function riseDonationProgressBar() {
if (curValue >= percentage) {
$('span#fundraiser-so-far').text(soFar);
$("#progressbar").progressbar({ value : percentage });
@@ -32,10 +35,22 @@ $(document).ready(function() {
$("#progressbar").progressbar({ value: curValue });
$('span#fundraiser-so-far').text(newVal.toLocaleString());
curValue += 0.5;
- setTimeout(slowRise, 50);
+ setTimeout(riseDonationProgressBar, 50);
}
}
- slowRise();
+ function riseDonationCount() {
+ if (incrementDonationCount >= noCommaDonationCount) {
+ $('span#fundraiser-donation-count').text(donationCount);
+ } else {
+ $('span#fundraiser-donation-count').text(incrementDonationCount.toLocaleString());
+ incrementDonationCount++;
+ setTimeout(riseDonationCount, 50);
+ }
+ }
+ if (noCommaDonationCount > 0) {
+ riseDonationCount();
+ }
+ riseDonationProgressBar();
$('.toggle-content').hide();
diff --git a/www/conservancy/templates/base_compliance.html b/www/conservancy/templates/base_compliance.html
index 9c79e331..0d4deaf4 100644
--- a/www/conservancy/templates/base_compliance.html
+++ b/www/conservancy/templates/base_compliance.html
@@ -22,6 +22,9 @@
Support our GPL compliance work now & donations count double!
{% cache 3600 compliancedonation fundgoal.fundraiser_so_far_amount %}
+{% if fundgoal.fundraiser_donation_count > fundgoal.fundraiser_donation_count_disclose_threshold %}
+Thanks to {{ fundgoal.fundraiser_donation_count|intcomma }} donations,
+{% endif %}
${{ fundgoal.fundraiser_so_far_amount|floatformat:0|intcomma }}
of ${{ fundgoal.fundraiser_goal_amount|floatformat:0|intcomma }} match met.
(i.e., {{ fundgoal.percentage_there|floatformat:1 }}%)