1 {% extends
"layout.html" %}
2 {% block subtitle %}{{vote.title}}{% endblock %}
6 <h2 class=
"page-header">Informations
</h2>
7 <div class=
"progress progress-striped progress-{% if vote.nb_votes > 0 and vote.nb_votes / vote.max_votes >= vote.quorum %}success{% else %}danger{% endif %}">
8 <div class=
"bar" style=
"width: {{ vote.percent }}%;">
9 <strong>{{ vote.nb_votes }} vote{{ 's' if vote.nb_votes
> 1 else '' }} / {{ vote.max_votes }} ({{ vote.percent }}%)
</strong></div>
11 <dl class=
"dl-horizontal">
12 <dt>Publié par
<dd><code>{{ vote.author }}
</code>
13 <dt>Début le
<dd><code>{{ vote.date_begin }}
</code>
14 <dt>Fin le
<dd><code>{{ vote.date_end }}
</code>
15 <dt>Groupe
<dd><code>{{ vote.groupname }}
</code>
16 <dt>Catégorie
<dd><code>{{ vote.category }}
</code>
17 <dt>Quorum
<dd><code>{{ vote.quorum *
100 }}%
</code>
20 {% if vote.description %}
21 <dt>Description :
<dd>{{ vote.description }}
26 {% for attachment in attachments %}
27 <li><a href=
"{{ attachment.url }}">{{ attachment.url }}
</a></li>
34 {% if vote.is_transparent or (session.user and user.userid == session.user.id )%}
36 <h2 class='page-header'
>Résultats
</h2>
37 <svg class=
"results cardinal-{{ vote.id_cardinal }}"
38 width=
"{{ 150 + (100 * 5) + 100 + 100 }}"
39 height=
"{{25 + results.list|length * 20 + 40}}">
40 <g class=
"choice" transform=
"translate(100,0)">
41 <text class=
"choice-legend" x=
"-10" y=
"9.5" dy=
".35em">Légende :
</text>
42 {% for value in values %}
43 <g transform=
"translate({{ (loop.index0 * 750 / loop.length) }},0)">
44 <rect width=
"{{ 750 / loop.length + 1 }}" height=
"18"></rect>
45 <rect class=
"{{ value.class }}" x=
"1" y =
"0" width=
"{{ 750 / loop.length - 1}}" height=
"18"></rect>
46 <text class=
"choice-legend-item" text-anchor=
"start" x=
"{{ 750 / loop.length - 2 }}" y=
"9.5" dy=
".35em"
47 >{{ value.name }}
</text>
51 <g transform=
"translate({{150 + (100 * 5) + 35}},20)">
52 <text class=
"choice-sum-legend" x=
"20" y=
"9.5" dy=
".35em">somme↓
</text>
54 <g transform=
"translate({{150 + (100 * 5) + 115}},20)">
55 <text class=
"choice-average-legend" x=
"20" y=
"9.5" dy=
".35em">moyenne↓
</text>
57 {% for choice in results.list %}
58 <g class=
"choice" transform=
"translate(150,{{ 35 + loop.index0 * 20 }})">
59 <text class=
"choice" x=
"-10" y=
"9.5" dy=
".35em">{{ choice.name }}
</text>
61 {% set choice_loop = loop %}
62 {% for value in choice.values_ %}
63 <g transform=
"translate({{ 150 + (value.previous_percent * 5) }},{{ 35 + choice_loop.index0 * 20 }})">
64 {% if value.percent
> 0 %}
65 <rect class=
"{{ value.class }}" width=
"{{ (value.percent * 5)|int }}" height=
"19"></rect>
66 <text text-anchor=
"middle" x=
"{{ (value.percent * 5 / 2 + 10)|int }}" y=
"9.5" dy=
".35em"
67 >{{ value.percent|int }}%
</text>
71 <g transform=
"translate({{150 + (100 * 5) + 35}},{{35 + loop.index0 * 20}})">
72 <text class=
"choice-sum" x=
"20" y=
"9.5" dy=
".35em">{{ choice.sum }}
</text>
74 <g transform=
"translate({{150 + (100 * 5) + 115}},{{35 + loop.index0 * 20}})">
75 <text class=
"choice-average" x=
"20" y=
"9.5" dy=
".35em">{{
"%.2f"|format(choice.average) }}
</text>
77 {% if loop.length
> 1 and choice.id in results.medians %}
78 <g transform=
"translate({{150 + (100 * 5) + 125}},{{35 + loop.index0 * 20}})">
79 <text class=
"choice-median" x=
"75" y=
"9.5" dy=
".35em">← médiane
</text>
83 <g class=
"axis" transform=
"translate(150,{{35 + results.list|length * 20}})">
84 <g transform=
"translate(0,0)" style=
"opacity: 1;" class=
"tick">
85 <line x1=
"0" y1=
"6" x2=
"0" y2=
"0"></line>
86 <text style=
"text-anchor: middle;" dy=
".71em" x=
"0" y=
"9">0%
</text>
88 <g transform=
"translate(125,0)" style=
"opacity: 1;" class=
"tick">
89 <line x1=
"0" y1=
"6" x2=
"0" y2=
"0"></line>
90 <text style=
"text-anchor: middle;" dy=
".71em" x=
"0" y=
"9">25%
</text>
92 <g transform=
"translate(250,0)" style=
"opacity: 1;" class=
"tick">
93 <line x1=
"0" y1=
"6" x2=
"0" y2=
"0"></line>
94 <text style=
"text-anchor: middle;" dy=
".71em" x=
"0" y=
"9">50%
</text>
96 <g transform=
"translate(375,0)" style=
"opacity: 1;" class=
"tick">
97 <line x1=
"0" y1=
"6" x2=
"0" y2=
"0"></line>
98 <text style=
"text-anchor: middle;" dy=
".71em" x=
"0" y=
"9">75%
</text>
100 <g transform=
"translate(500,0)" style=
"opacity: 1;" class=
"tick">
101 <line x1=
"0" y1=
"6" x2=
"0" y2=
"0"></line>
102 <text style=
"text-anchor: middle;" dy=
".71em" x=
"0" y=
"9">100%
</text>
104 <path d=
"M0,6V0H500V6" class=
"domain"></path>
111 <h2 class='page-header'
>Suffrages
</h2>
112 {% if vote.is_anonymous %}
113 <div class=
"alert alert-info">Ce vote est anonymisé, les suffrages ne sont ni visibles ni modifiables.
</div>
115 {% if not vote.is_transparent %}
116 <div class=
"alert alert-info">Ce vote n’est pas transparent, vous ne pouvez pas voir les votes des autres.
</div>
119 {% if (vote['is_anonymous'] and can_vote) or not vote['is_anonymous'] %}
120 <table class=
"table table-condensed table-bordered table-votes cardinal-{{ vote.id_cardinal }}">
123 <th class=
"users">Votant-e-s
</th>
124 {% for choice in choices %}
125 <th class=
"choice-name">{{ choice.name }}
</th>
127 {% if 'user' in session and (can_vote or (not vote['is_terminated'] and not vote['is_anonymous'])) %}
130 <th class=
"comments">Commentaires
</th>
133 {% if vote.is_transparent %}
137 {% for choice in choices %}
138 <td>{{ choice.sum }}</td>
140 {% if 'user' in session and (can_vote or (not vote['is_terminated'] and not vote['is_anonymous'])) %}
148 <form class=
"form-inline" action=
"{{ url_for('vote', idvote=vote.id) }}" method=
"post">
150 <th><input type='text'
name=
"username" value='{{ session.user.name }}' disabled
/></th>
151 {% for choice in choices %}
153 <select name=
"value-{{ choice.id }}" id=
"value-{{ choice.id }}">
154 {% for value in values %}
155 <option value=
"{% if value.weight is not none %}{{ value.weight }}{% endif %}" class=
"{{ value.class }}">{{ value.name }}
</option>
160 <td><input type=
"submit" class=
"btn btn-primary" value=
"OK" />
161 <textarea name=
"comment" class=
"input-xlarge" placeholder=
"Commentaire"></textarea></td>
167 {% if not vote['is_anonymous'] %}
169 {% for user in users %}
170 {% if vote.is_transparent or (session.user and user.userid == session.user.id )%}
172 <th>{% if 'user' in session and user.userid == session.user.id %}
<i class=
"icon-user"></i>{% endif %} {{ user.username }}
</th>
173 {% for choice in choices %}
174 {% if choice.id in user.choices %}
175 <td class=
"{{user.choices[choice.id].class}}"><span>{{ user.choices[choice.id].name }}
</span></td>
177 <td class=
"choice-after-vote"><span>Choix postérieur au suffrage
</span></td>
180 {% if 'user' in session and (can_vote or (not vote['is_terminated'] and not vote['is_anonymous'])) %}
181 <td class=
"ok">{% if user.userid == session.user.id %}
182 <a href=
"#delete" data-toggle=
"modal" class=
"btn btn-danger btn-mini" title=
"Supprimer"><i class=
"icon-remove icon-white"></i></a>
183 <div class=
"modal hide fade" id=
"delete">
184 <div class=
"modal-header">
185 <button type=
"button" class=
"close" data-dismiss=
"modal">×
</button>
186 <h3>Suppression de votre vote
</h3>
188 <div class=
"modal-body">
189 <p>Voulez-vous vraiment supprimer votre vote ?
</p>
191 <div class=
"modal-footer">
192 <a href=
"{{ url_for('vote_deletechoices', idvote=vote.id, iduser=session.user.id) }}" class=
"btn btn-danger">Confirmer
</a>
193 <a href=
"#" class=
"btn" data-dismiss=
"modal">Annuler
</a>
197 <span class=
"comment">{% if user.comment %}{{user.comment}}{%endif%}
</span>
201 <span class=
"comment">{% if user.comment %}{{user.comment}}{%endif%}
</span>
211 {% if not can_vote %}
212 <div class=
"alert alert-info">Vous avez déjà voté.
</div>
217 {% if vote.is_anonymous %}
219 <h2 class='page-header'
>Commentaires
</h2>
220 <table class=
"table table-condensed table-bordered table-comments">
222 {% for user in users %}
223 <tr><td><span class=
"comment">{% if user.comment %}{{user.comment}}{%endif%}
</span></td></tr>