Skip to content

Commit

Permalink
Added votes in queue count
Browse files Browse the repository at this point in the history
  • Loading branch information
benadida committed Nov 8, 2010
1 parent 281c4e4 commit 9b4ca5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helios/stats_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def require_admin(request):

def home(request):
user = require_admin(request)
return render_template(request, 'stats', {})
num_votes_in_queue = CastVote.objects.filter(invalidated_at=None, cast_at=None).count()
return render_template(request, 'stats', {'num_votes_in_queue': num_votes_in_queue})

def elections(request):
user = require_admin(request)
Expand Down
2 changes: 2 additions & 0 deletions helios/templates/stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ <h1>Statistics</h1>
<li> <a href="{% url helios.stats_views.recent_votes %}">recent votes</a></li>
</ul>

<p><b>{{num_votes_in_queue}}</b> votes in queue.</p>

{% endblock %}

0 comments on commit 9b4ca5d

Please sign in to comment.