Users can vote
[cavote.git] / templates / vote.html
1 {% extends "layout.html" %}
2 {% block body %}
3 <div class="row">
4 <div class="span9">
5 <h2 class='page-header'>{{ vote.title }}</h2>
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 {% for user in users %}
20 <tr>
21 <td>{{ user.username }}</td>
22 {% for choice in choices %}
23 <th>{% if choice in user.choices %}OUI{% else %}NON{% endif %}</th>
24 {% endfor %}
25 </tr>
26 {% endfor %}
27 {% else %}
28 <div class="alert alert-info">Ce sondage n'est pas transparent, vous ne pouvez pas voir les votes des autres.</div>
29 <!-- :TODO:maethor:20120528: Afficher le vote de l'utilisateur -->
30 {% endif %}
31
32 {% if can_vote %}
33 <form class="form-inline" action="{{ url_for('vote', idvote=vote.id) }}" method="post">
34 <tr>
35 <td><input type='text' name="username" value='{{ session.user.name }}' disabled /></td>
36 {% if vote.is_multiple %}
37 {% for choice in choices %}
38 <td><input type='checkbox' name="{{ choice.id }}" /></td>
39 {% endfor %}
40 {% else %}
41 {% for choice in choices %}
42 <td><input type='radio' name="{{ choice.id }}" /></td>
43 {% endfor %}
44 {% endif %}
45 <td><input type="submit" class="btn btn-primary" value="OK" /></td>
46 </tr>
47 </form>
48 {% endif %}
49 </tbody>
50 <tfoot>
51 {% if vote.is_transparent %}
52 <tr>
53 <td style="text-align: right">Somme</td>
54 {% for choice in choices %}
55 <td>nb</td>
56 {% endfor %}
57 <td></td>
58 </tr>
59 {% endif %}
60 </tfoot>
61 </table>
62 </div>
63
64 <div class="span3">
65 <h3>Informations</h3>
66 <dl class="dl-horizontal">
67 <dt>Publié par <dd><code>maethor</code>
68 <dt>Début le <dd><code>{{ vote.date_begin }}</code>
69 <dt>Deadline le <dd><code>{{ vote.date_end }}</code>
70 <dt>Groupe <dd><code>{{ vote.rolename }}</code>
71 <dt>Catégorie <dd><code>{{ vote.category }}</code>
72 </dl>
73 <dl>
74 <dt>Description : <dd>{{ vote.description }}
75 <dt>Documents :<dd>
76 <ul>
77 {% for attachment in attachments %}
78 <li><a href="{{ attachment.url }}">{{ attachment.url }}</a></li>
79 {% endfor %}
80 </ul>
81 </li>
82 </dl>
83 </div>
84
85 </div>
86 {% endblock %}
87