803726618083d270156734fd1a3ee4ff1d46af70
[wolnelektury.git] / src / polls / templates / polls / tags / poll.html
1 {% load i18n %}
2
3 {% if poll %}
4     {% if voted_already %}
5         {% if show_results %}
6             <div class="poll">
7                 <p>{{poll.question}}</p>
8                 <ul>
9                 {% for item in poll.items.all %}
10                     <li>
11                         {{item.content}}
12                         <div class="poll-bar"><div class="poll-bar-inner" style="width:{{item.vote_ratio|stringformat:"f"}}%;"></div>
13                     </li>
14                 {% endfor %}
15                 </ul>
16             </div>
17         {% endif %}
18     {% else %}
19         <div class="poll">
20           <p>{{poll.question}}</p>
21           <br>
22             <form action="{{poll.get_absolute_url}}" method="post">{% csrf_token %}
23             {{ form.vote }}
24             <input type="submit" value="{% trans "Submit" %}" />
25             </form>
26         </div>
27     {% endif %}
28 {% endif %}