Show vote
[cavote.git] / templates / vote.html
1 {% extends "layout.html" %}
2 {% block body %}
3 <h2>{{ vote.title }}</h2>
4 <div class="row">
5 <div class="span10 offset1">
6 <table class="table table-condensed table-striped table-bordered">
7 <thead>
8 <tr>
9 <th></th>
10 {% for choice in choices %}
11 <th>{{ choice.name }}</th>
12 {% endfor %}
13 <th></th>
14 </tr>
15 </thead>
16
17 <tbody>
18 {% if vote.is_transparent %}
19 <!-- :TODO:maethor:20120528: Afficher les votes ici -->
20 {% else %}
21 <div class="alert alert-info">Ce sondage n'est pas transparent, vous ne pouvez pas voir les votes des autres.</div>
22 <!-- :TODO:maethor:20120528: Afficher le vote de l'utilisateur -->
23 {% endif %}
24
25 {% if can_vote %}
26 <form class="form-inline" action=""> <!-- :TODO:maethor:20120528: Route -->
27 <tr>
28 <td><input type='text' name="username" value='{{ session.user.name }}' disabled /></td>
29 {% if vote.is_multiple %}
30 {% for choice in choices %}
31 <td><input type='checkbox' name="{{ choice.id }}" /></td>
32 {% endfor %}
33 {% else %}
34 {% for choice in choices %}
35 <td><input type='radio' name="choice" value="{{ choice.id }}" /></td>
36 {% endfor %}
37 {% endif %}
38 <td><input type="submit" class="btn btn-primary" value="OK" /></td>
39 </tr>
40 </form>
41 {% endif %}
42 </tbody>
43 <tfoot>
44 {% if vote.is_transparent %}
45 <tr>
46 <td style="text-align: right">Somme</td>
47 {% for choice in choices %}
48 <td>nb</td>
49 {% endfor %}
50 <td></td>
51 </tr>
52 {% endif %}
53 </tfoot>
54 </table>
55 </div>
56 </div>
57 {% endblock %}
58