b6ea499c9451c3a9de94ed03f23af98a16d590b5
[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
7 {% if not vote.is_transparent %}
8 <div class="alert alert-info">Ce sondage n'est pas transparent, vous ne pouvez pas voir les votes des autres.</div>
9 {% endif %}
10
11 <table class="table table-condensed table-bordered table-votes">
12 <thead>
13 <tr>
14 <th></th>
15 {% for choice in choices %}
16 <th>{{ choice.name }}</th>
17 {% endfor %}
18 <th></th>
19 </tr>
20 </thead>
21
22 <tbody>
23 {% for user in users %}
24 {% if vote.is_transparent or user.userid == session.user.id %}
25 <tr>
26 <th>{% if 'user' in session and user.userid == session.user.id %}<i class="icon-user"></i>{% endif %} {{ user.username }}</th>
27 {% for choice in choices %}
28 {% if choice.id in user.choices %}
29 <td class="yes"><i class="icon-ok icon-white"></i></td>
30 {% else %}
31 <td class="no"></td>{% endif %}
32 {% endfor %}
33 <td>{% if 'user' in session and user.userid == session.user.id %}<a href="{{ url_for('vote_deletechoices', idvote=vote.id, iduser=session.user.id) }}" class="btn btn-mini btn-danger" title="Supprimer"><i class="icon-remove icon-white"></a>{% endif %}</td>
34 </tr>
35 {% endif %}
36 {% endfor %}
37
38 {% if can_vote %}
39 <form class="form-inline" action="{{ url_for('vote', idvote=vote.id) }}" method="post">
40 <tr>
41 <th><input type='text' name="username" value='{{ session.user.name }}' disabled /></th>
42 {% if vote.is_multiplechoice %}
43 {% for choice in choices %}
44 <td><input type='checkbox' name="{{ choice.id }}" /></td>
45 {% endfor %}
46 {% else %}
47 {% for choice in choices %}
48 <td><input type='radio' name="{{ choice.id }}" /></td>
49 {% endfor %}
50 {% endif %}
51 <td><input type="submit" class="btn btn-primary" value="OK" /></td>
52 </tr>
53 </form>
54 {% endif %}
55 </tbody>
56
57 <tfoot>
58 {% if vote.is_transparent %}
59 <tr>
60 <th>Somme</th>
61 {% for choice in choices %}
62 <td>{{ choice.nb }}</td>
63 {% endfor %}
64 <td></td>
65 </tr>
66 {% endif %}
67 </tfoot>
68 </table>
69 </div>
70
71 <div class="span3">
72 <h3>Informations</h3>
73 <dl class="dl-horizontal">
74 <dt>Publié par <dd><code>maethor</code>
75 <dt>Début le <dd><code>{{ vote.date_begin }}</code>
76 <dt>Deadline le <dd><code>{{ vote.date_end }}</code>
77 <dt>Groupe <dd><code>{{ vote.groupname }}</code>
78 <dt>Catégorie <dd><code>{{ vote.category }}</code>
79 </dl>
80 <dl>
81 <dt>Description : <dd>{{ vote.description }}
82 <dt>Documents :<dd>
83 <ul>
84 {% for attachment in attachments %}
85 <li><a href="{{ attachment.url }}">{{ attachment.url }}</a></li>
86 {% endfor %}
87 </ul>
88 </li>
89 </dl>
90 </div>
91
92 </div>
93 {% endblock %}
94