Introducing polls
[wolnelektury.git] / apps / 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"
13                         {% if vote_count %}
14                                 style="width:{{item.vote_ratio|stringformat:"f"}}%;"
15                         {% endif %}
16                         ></div></div>
17                     </li>
18                 {% endfor %}
19                 </ul>
20             </div>
21         {% endif %}
22     {% else %}
23         <div class="poll">
24             <p>{{poll.question}}</p>
25             <form action="{{poll.get_absolute_url}}" method="post">{% csrf_token %}
26             {{ form.vote }}
27             <input type="submit" value="{% trans "Submit" %}" />
28             </form>
29         </div>
30     {% endif %}
31 {% endif %}