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) + 50 + 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>
43 {% for value in values %}
44 <g transform=
"translate({{ 150 + (loop.index0 * 640 / loop.length) }},0)">
45 <rect width=
"{{ 640 / loop.length }}" height=
"20"></rect>
46 <rect class=
"{{ value.class }}" x=
"1" y =
"1" width=
"{{ 640 / loop.length - 1}}" height=
"19"></rect>
47 <text class=
"choice-legend-item" text-anchor=
"start" x=
"{{ 640 / loop.length - 2 }}" y=
"9.5" dy=
".35em"
48 >{{ 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 }}">
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'])) %}
131 {% if vote.is_transparent %}
135 {% for choice in choices %}
136 <td>{{ choice.sum }}</td>
138 {% if 'user' in session and (can_vote or (not vote['is_terminated'] and not vote['is_anonymous'])) %}
146 <form class=
"form-inline" action=
"{{ url_for('vote', idvote=vote.id) }}" method=
"post">
148 <th><input type='text'
name=
"username" value='{{ session.user.name }}' disabled
/></th>
149 {% for choice in choices %}
151 <select name=
"value-{{ choice.id }}" id=
"value-{{ choice.id }}">
152 {% for value in values %}
153 <option value=
"{% if value.weight is not none %}{{ value.weight }}{% endif %}" class=
"{{ value.class }}">{{ value.name }}
</option>
158 <td><input type=
"submit" class=
"btn btn-primary" value=
"OK" /></td>
164 {% if not vote['is_anonymous'] %}
166 {% for user in users %}
167 {% if vote.is_transparent or (session.user and user.userid == session.user.id )%}
169 <th>{% if 'user' in session and user.userid == session.user.id %}
<i class=
"icon-user"></i>{% endif %} {{ user.username }}
</th>
170 {% for choice in choices %}
171 <td class=
"{{user.choices[choice.id].class}}"><span>{{ user.choices[choice.id].name }}
</span></td>
173 {% if 'user' in session and (can_vote or (not vote['is_terminated'] and not vote['is_anonymous'])) %}
174 <td>{% if user.userid == session.user.id %}
175 <a href=
"#delete" data-toggle=
"modal" class=
"btn btn-danger btn-mini" title=
"Supprimer"><i class=
"icon-remove icon-white"></i></a>
176 <div class=
"modal hide fade" id=
"delete">
177 <div class=
"modal-header">
178 <button type=
"button" class=
"close" data-dismiss=
"modal">×
</button>
179 <h3>Suppression de votre vote
</h3>
181 <div class=
"modal-body">
182 <p>Voulez-vous vraiment supprimer votre vote ?
</p>
184 <div class=
"modal-footer">
185 <a href=
"{{ url_for('vote_deletechoices', idvote=vote.id, iduser=session.user.id) }}" class=
"btn btn-danger">Confirmer
</a>
186 <a href=
"#" class=
"btn" data-dismiss=
"modal">Annuler
</a>
198 {% if not can_vote %}
199 <div class=
"alert alert-info">Vous avez déjà voté.
</div>