diff gpp/templates/polls/index.html @ 440:ac9217eef610

Added total vote information to the poll templates. Cache the total votes in the model instance.
author Brian Neal <bgneal@gmail.com>
date Sat, 21 May 2011 20:35:02 +0000
parents dbd703f7d63a
children
line wrap: on
line diff
--- a/gpp/templates/polls/index.html	Sat May 21 19:55:48 2011 +0000
+++ b/gpp/templates/polls/index.html	Sat May 21 20:35:02 2011 +0000
@@ -8,6 +8,7 @@
    <ul>
    {% for poll in current_polls %}
       <li><a href="{{ poll.get_absolute_url }}">{{ poll.question }}</a> &bull; 
+      {{ poll.total_votes }} vote{{ poll.total_votes|pluralize }} &bull;
       {% get_comment_count for poll as comment_count %}
       {{ comment_count }} comment{{ comment_count|pluralize }} &bull;
       {{ poll.start_date|date:"M d, Y" }}
@@ -25,6 +26,7 @@
    <ul>
    {% for poll in old_polls %}
       <li><a href="{{ poll.get_absolute_url }}">{{ poll.question }}</a> &bull; 
+      {{ poll.total_votes }} vote{{ poll.total_votes|pluralize }} &bull;
       {% get_comment_count for poll as comment_count %}
       {{ comment_count }} comment{{ comment_count|pluralize }} &bull;
       {{ poll.start_date|date:"M d, Y" }} -