gremmie@1: {% extends 'base.html' %}
gremmie@1: {% load comment_tags %}
bgneal@6: {% load script_tags %}
gremmie@1: {% block title %}Poll Results: {{ poll.question }}{% endblock %}
gremmie@1: {% block custom_css %}
gremmie@1: <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/polls.css" />
gremmie@1: <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/comments.css" />
gremmie@1: {% endblock %}
gremmie@1: {% block custom_js %}
bgneal@6: {% if poll.is_open %}
bgneal@6: {% script_tags "markitup" %}
gremmie@1: <script type="text/javascript" src="{{ MEDIA_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>&nbsp;</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 %}
gremmie@1: | <a href="{% url polls.views.poll_vote poll_id=poll.id %}">Vote</a> 
gremmie@1: {% endif %}
gremmie@1: | <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 
gremmie@1: with the site staff, you can <a href="{% url contact-form %}">contact us directly</a>.</p>
gremmie@1: {% endif %}
gremmie@1: {% endblock %}