From f723a74f51100d092fcdb107dd5cdac0ed1ef95f 2015-01-03 14:53:44
From: Bradley M. Kuhn
Date: 2015-01-03 14:53:44
Subject: [PATCH] Support anonymous supporter listings by count.
Remove anonymous listing from the alphabetical supporters list and
instead list them by count found.
---
diff --git a/www/conservancy/sponsors.py b/www/conservancy/sponsors.py
index c4be3e4c7ad07098c80061ddadc0115cebb8a5c0..1d4e88dc8d76d82b88313aa2fae889b3e873b24e 100644
--- a/www/conservancy/sponsors.py
+++ b/www/conservancy/sponsors.py
@@ -9,8 +9,11 @@ def view(request):
"""
supporters = Supporter.objects.all().filter(display_until_date__gte=datetime.now())
+ anonymous_count = len(supporters.filter(display_name = 'Anonymous'))
+ supporters = supporters.exclude(display_name = 'Anonymous')
c = {
- 'supporters' : supporters
+ 'supporters' : supporters,
+ 'anonymous_count' : anonymous_count
}
return render_to_response("sponsors.html", c)
diff --git a/www/conservancy/templates/sponsors.html b/www/conservancy/templates/sponsors.html
index 19e4497914487753f7d237bfce0504f4ea37e523..bdcdecd15b23052533cf11e6a4afd1c95c82bc66 100644
--- a/www/conservancy/templates/sponsors.html
+++ b/www/conservancy/templates/sponsors.html
@@ -58,6 +58,7 @@ any of its sponsors.
+- Anonymous ({{anonymous_count|safe}} people)
{% for ss in supporters %}
- {{ ss.display_name|safe }}
{% endfor %}