Mercurial > public > sg101
annotate gpp/templates/polls/index.html @ 505:a5d11471d031
Refactor the logic in the rate limiter decorator. Check to see if the request was ajax, as the ajax view always returns 200. Have to decode the JSON response to see if an error occurred or not.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 03 Dec 2011 19:13:38 +0000 |
parents | ac9217eef610 |
children |
rev | line source |
---|---|
gremmie@1 | 1 {% extends 'base.html' %} |
gremmie@1 | 2 {% load comment_tags %} |
gremmie@1 | 3 {% block title %}Polls{% endblock %} |
gremmie@1 | 4 {% block content %} |
gremmie@1 | 5 <h2>Polls</h2> |
gremmie@1 | 6 <h3>Current Polls</h3> |
gremmie@1 | 7 {% if current_polls %} |
gremmie@1 | 8 <ul> |
gremmie@1 | 9 {% for poll in current_polls %} |
gremmie@1 | 10 <li><a href="{{ poll.get_absolute_url }}">{{ poll.question }}</a> • |
bgneal@440 | 11 {{ poll.total_votes }} vote{{ poll.total_votes|pluralize }} • |
gremmie@1 | 12 {% get_comment_count for poll as comment_count %} |
gremmie@1 | 13 {{ comment_count }} comment{{ comment_count|pluralize }} • |
gremmie@1 | 14 {{ poll.start_date|date:"M d, Y" }} |
gremmie@1 | 15 {% if poll.end_date %} |
gremmie@1 | 16 - {{ poll.end_date|date:"M d, Y" }} |
gremmie@1 | 17 {% endif %} |
gremmie@1 | 18 </li> |
gremmie@1 | 19 {% endfor %} |
gremmie@1 | 20 </ul> |
gremmie@1 | 21 {% else %} |
gremmie@1 | 22 <p>No open polls at this time.</p> |
gremmie@1 | 23 {% endif %} |
gremmie@1 | 24 <h3>Closed Polls</h3> |
gremmie@1 | 25 {% if old_polls %} |
gremmie@1 | 26 <ul> |
gremmie@1 | 27 {% for poll in old_polls %} |
gremmie@1 | 28 <li><a href="{{ poll.get_absolute_url }}">{{ poll.question }}</a> • |
bgneal@440 | 29 {{ poll.total_votes }} vote{{ poll.total_votes|pluralize }} • |
gremmie@1 | 30 {% get_comment_count for poll as comment_count %} |
gremmie@1 | 31 {{ comment_count }} comment{{ comment_count|pluralize }} • |
gremmie@1 | 32 {{ poll.start_date|date:"M d, Y" }} - |
gremmie@1 | 33 {{ poll.end_date|date:"M d, Y" }}</li> |
gremmie@1 | 34 {% endfor %} |
gremmie@1 | 35 </ul> |
gremmie@1 | 36 {% else %} |
gremmie@1 | 37 <p>No closed polls at this time.</p> |
gremmie@1 | 38 {% endif %} |
gremmie@1 | 39 {% endblock %} |