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