view sg101/templates/polls/poll_detail.html @ 1092:6047465d17b8

Remove "Results for" in poll detail header.
author Brian Neal <bgneal@gmail.com>
date Wed, 11 May 2016 21:52:18 -0500
parents f7554fb88727
children babb1f44dda5
line wrap: on
line source
{% extends 'v3/base.html' %}
{% load comment_tags %}
{% load script_tags %}
{% load static from staticfiles %}
{% block title %}Poll Results: {{ poll.question }}{% endblock %}
{% block pre_custom_css %}
{% css_tags 'jquery-ui markitup' %}
{% endblock %}
{% block custom_css %}
<link rel="stylesheet" type="text/css" href="{% static "css/comments.css" %}" />
{% endblock %}

{% block content %}
<nav aria-label="You are here:" role="navigation">
  <ul class="breadcrumbs">
    <li><a href="{% url 'polls-main' %}">Polls</a></li>
    <li>{{ poll.question }}</li>
  </ul>
</nav>
<h2>{{ poll.question }}</h2>
<dl class="poll-result">
{% for choice in choices %}
   <dt>{{ choice.choice }} - {{ choice.pct|floatformat }}% ({{ choice.votes }} vote{{ choice.votes|pluralize }})</dt>
   <dd>
      <div class="progress" role="progressbar" tabindex="0"
         aria-valuenow="{{ choice.pct }}" aria-valuemin="0"
         aria-valuetext="{{ choice.pct }} percent" aria-valuemax="100">
         <div class="progress-meter" style="width: {{ choice.pct|floatformat:0 }}%"></div>
      </div>
   </dd>
{% endfor %}
</dl>
<p><strong>{{ total_votes }} total vote{{ total_votes|pluralize }}.</strong></p>

{% if user_choice %}
   <div class="primary callout">
      You voted for &quot;{{ user_choice.choice }}&quot;.
   </div>
{% endif %}

<p>
{% if poll.is_open %}
Voting for this poll started on {{ poll.start_date|date:"F d, Y" }}.
   {% if poll.end_date %}
      Voting will end on {{ poll.end_date|date:"F d, Y" }}.
   {% endif %}
{% else %}
This poll ran from {{ poll.start_date|date:"F d, Y" }} to {{ poll.end_date|date:"F d, Y" }}.
{% endif %}
</p>

<div>
{% if poll.is_open and user.is_authenticated %}
   {% if user_choice %}
      <a href="{% url 'polls-vote' poll_id=poll.id %}" class="alert button">Delete My Vote</a>
   {% else %}
      <a href="{% url 'polls-vote' poll_id=poll.id %}" class="primary button">Vote</a>
   {% endif %}
{% endif %}
</div>

{% get_comment_count for poll as comment_count %}
<p>This poll has <span id="comment-count">{{ comment_count }}</span> comment{{ comment_count|pluralize }}.</p>
<hr />
{% render_comment_list poll %}
{% if poll.is_open %}
<p>Leave a comment?</p>
{% render_comment_form user poll %}
{% else %}
<p>Comments are closed for this poll. If you'd like to share your thoughts on this poll
with the site staff, you can <a href="{% url 'contact-form' %}">contact us directly</a>.</p>
{% endif %}
{% endblock %}

{% block custom_js %}
   {% if poll.is_open %}
      {% js_tags "markitup jquery-ui" %}
      <script type="text/javascript" src="{% static "js/comments.js" %}"></script>
   {% endif %}
{% endblock %}