gremmie@1: {% extends 'base.html' %} bgneal@310: {% load url from future %} gremmie@1: {% load comment_tags %} bgneal@6: {% load script_tags %} gremmie@1: {% block title %}Poll Results: {{ poll.question }}{% endblock %} gremmie@1: {% block custom_css %} bgneal@312: <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/polls.css" /> bgneal@312: <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/comments.css" /> gremmie@1: {% endblock %} gremmie@1: {% block custom_js %} bgneal@6: {% if poll.is_open %} bgneal@127: {% script_tags "markitup jquery-ui" %} bgneal@312: <script type="text/javascript" src="{{ STATIC_URL }}js/comments.js"></script> bgneal@6: {% endif %} gremmie@1: {% endblock %} gremmie@1: {% block content %} gremmie@1: <h2>Polls</h2> gremmie@1: <h3>{{ poll.question }}</h3> gremmie@1: <dl class="poll-result"> gremmie@1: {% for choice in choices %} gremmie@1: <dt>{{ choice.choice }} - {{ choice.pct|floatformat }}% ({{ choice.votes }} vote{{ choice.votes|pluralize }})</dt> gremmie@1: <dd> gremmie@1: <div class="poll-percent" style="width: {{ choice.pct|floatformat:0 }}%; background-color: teal; color: white;"> gremmie@1: <span> </span></div> gremmie@1: </dd> gremmie@1: {% endfor %} gremmie@1: </dl> gremmie@1: <p><strong>{{ total_votes }} total vote{{ total_votes|pluralize }}.</strong></p> gremmie@1: <p class="poll-nav"> gremmie@1: <a href="{{ poll.get_absolute_url }}">Poll Details</a> gremmie@1: {% if poll.is_open and user.is_authenticated %} bgneal@310: | <a href="{% url 'polls.views.poll_vote' poll_id=poll.id %}">Vote</a> gremmie@1: {% endif %} bgneal@310: | <a href="{% url 'polls.views.poll_index' %}">Poll Index</a> gremmie@1: </p> gremmie@1: gremmie@1: {% get_comment_count for poll as comment_count %} gremmie@1: <p>This poll has <span id="comment-count">{{ comment_count }}</span> comment{{ comment_count|pluralize }}.</p> gremmie@1: <hr /> gremmie@1: {% render_comment_list poll %} gremmie@1: {% if poll.is_open %} gremmie@1: <p>Leave a comment?</p> gremmie@1: {% render_comment_form for poll %} gremmie@1: {% else %} gremmie@1: <p>Comments are closed for this poll. If you'd like to share your thoughts on this poll bgneal@310: with the site staff, you can <a href="{% url 'contact-form' %}">contact us directly</a>.</p> gremmie@1: {% endif %} gremmie@1: {% endblock %}