modify mail notification to make it optional
[cavote.git] / templates / admin_vote_edit.html
1 {% extends "layout.html" %}
2 {% block body %}
3
4 <div class="row">
5 <div class="span6 well">
6 <form action="{{ url_for('admin_vote_edit', voteid=vote.id) }}" method="post" class="form-horizontal">
7 <fieldset><legend>Édition du vote</legend>
8 <div class="control-group">
9 <label class="control-label" for="title">Titre</label>
10 <div class="controls">
11 <input type="text" size=30 name="title" id="title" value="{{ vote.title }}" />
12 <span class="help-inline"><font color="red">*</font></span>
13 </div>
14 </div>
15 <div class="control-group">
16 <label class="control-label" for="description">Description</label>
17 <div class="controls">
18 <textarea class="input-xlarge" name="description" id="description">{{ vote.description }}</textarea>
19 </div>
20 </div>
21 <div class="accordion">
22 <div class="accordion-group">
23 <div class="accordion-heading">
24 <a class="accordion-toggle" data-toggle="collapse" href="#infos">+ Informations</a>
25 </div>
26 <div id="infos" class="accordion-body collapse">
27 <div class="accordion-inner">
28 <div class="control-group">
29 <label class="control-label" for="category">Catégorie</label>
30 <div class="controls">
31 <input type="text" data-provide="typeahead" data-source='["ca","membres"]' size=30 name="category" id="category" value="{{ vote.category }}" />
32 </div>
33 </div>
34 <div class="control-group">
35 <label class="control-label" for="category">Quorum</label>
36 <div class="controls">
37 <select name="quorum" id="quorum">
38 {% for quorum in quorums %}
39 {% if quorum == vote.quorum %}
40 <option value="{{ quorum }}" selected>{{ quorum * 100 }}%</option>
41 {% else %}
42 <option value="{{ quorum }}">{{ quorum * 100 }}%</option>
43 {% endif %}
44 {% endfor %}
45 </select>
46 </div>
47 </div>
48 <div class="control-group">
49 <label class="control-label" for="role">Groupe</label>
50 <div class="controls">
51 <select name="role" id="role" disabled>
52 <option>{{ group.name }}</option>
53 </select>
54 <p class="help-block">Groupe d'utilisateur concernés par le vote et ayant le droit de voter</p>
55 </div>
56 </div>
57 <div class="control-group">
58 <label class="control-label" for="days">Durée (jours)</label>
59 <div class="controls">
60 <select class="span1" name="days" id="days">
61 {% for i in range(1, 31) %}
62 {% if i == vote.duration %}
63 <option selected>{{ i }}</option>
64 {% else %}
65 <option>{{ i }}</option>
66 {% endif %}
67 {% endfor %}
68 </select>
69 <span class="help-inline">Du {{ vote.date_begin }} au {{ vote.date_end }}</span>
70 </div>
71 </div>
72 <div class="control-group">
73 <label class="control-label" for="reminder">Rappel par mail les</label>
74 <div class="controls">
75 <select class="span1" name="reminder" id="reminder">
76 {% for i in range(1, 31) %}
77 {% if i == vote.reminder_last_days %}
78 <option selected>{{ i }}</option>
79 {% else %}
80 <option>{{ i }}</option>
81 {% endif %}
82 {% endfor %}
83 </select>
84 <span class="help-inline">derniers jours</span>
85 </div>
86 </div>
87 </div>
88 </div>
89 </div>
90 <div class="accordion-group">
91 <div class="accordion-heading">
92 <a class="accordion-toggle" data-toggle="collapse" href="#options">+ Options</a>
93 </div>
94 <div id="options" class="accordion-body collapse">
95 <div class="accordion-inner">
96 <div class="control-group">
97 <label class="control-label">Options</label>
98 <div class="controls">
99 <label class="checkbox">
100 <input type="checkbox" name="transparent" {% if vote.is_transparent == 1 %} checked {% endif %} />
101 Les votants peuvent-ils voir le choix des autres ?
102 </label>
103 <label class="checkbox">
104 <input type="checkbox" name="public" {% if vote.is_public == 1 %} checked {% endif %}/>
105 Le vote est-il visible par tous ?
106 </label>
107 {% if not vote.is_terminated == 1 %}
108 <label class="checkbox">
109 <input type="checkbox" name="anonymous" {% if vote.is_anonymous == 1 %} checked {% endif %} disabled/>
110 Les votes sont-ils anonymes ?
111 </label>
112 {% endif %}
113 </div>
114 </div>
115 <div class="control-group">
116 <label class="control-label" for="value">Valeurs</label>
117 <div class="controls">
118 <select name="value" id="value" disabled>
119 <option>{{ values_ }}</option>
120 </select>
121 </div>
122 </div>
123 </div>
124 </div>
125 </div>
126 </div>
127 <div class="control-group">
128 <label class="control-label" for="status">Statut</label>
129 <div class="controls">
130 <select class="span2" name="status" id="status">
131 {% if vote.is_terminated == 1 %}
132 <option>Fermé</option>
133 <option>Ouvert</option>
134 <option selected>Terminé</option>
135 {% else %}
136 {% if vote.is_open == 1 %}
137 <option>Fermé</option>
138 <option selected>Ouvert</option>
139 <option>Terminé</option>
140 {% else %}
141 <option selected>Fermé</option>
142 <option>Ouvert</option>
143 <option>Terminé</option>
144 {% endif %}
145 {% endif %}
146 </select>
147 {% if vote.is_open == 0 %}
148 <label class="checkbox">
149 <input type="checkbox" name="mail_notice" checked />
150 Notifier par courriel
151 </label>
152 {% endif %}
153 </div>
154 </div>
155 <div class="form-actions">
156 <input type="submit" class="btn btn-primary" value="Enregistrer" />
157 <input type="reset" class="btn" value="Annuler" />
158 </div>
159 </fieldset>
160 </form>
161 </div>
162
163 {% if not vote.is_terminated == 1%}
164 <div class="span5 well pull-right">
165 <fieldset><legend>Choix</legend>
166 <table class="table table-stripped table-condensed">
167 <thead>
168 <tr>
169 <th>Titre
170 <th>Actions
171 </tr>
172 </thead>
173 <tbody>
174 {% for choice in choices %}
175 <tr>
176 <form action="{{ url_for('admin_vote_editchoice', voteid=vote.id, choiceid=choice.id) }}" method="post">
177 <td><input type="text" name="title" value="{{ choice.name }}" /></td>
178 <td><input type="submit" class="btn btn-small" value="Sauver" />
179 <a href="#delete{{ choice.id }}" data-toggle="modal" class="btn btn-danger btn-small">Supprimer</a></td>
180 </form>
181 </tr>
182 <div class="modal hide fade" id="delete{{ choice.id }}">
183 <div class="modal-header">
184 <button type="button" class="close" data-dismiss="modal">×</button>
185 <h3>Suppression d'un choix</h3>
186 </div>
187 <div class="modal-body">
188 <p>Voulez-vous vraiment supprimer le choix « {{ choice.name }} » ?</p>
189 </div>
190 <div class="modal-footer">
191 <a href="{{ url_for('admin_vote_deletechoice', voteid=vote.id, choiceid=choice.id) }}" class="btn btn-danger">Confirmer</a>
192 <a href="#" class="btn" data-dismiss="modal">Annuler</a>
193 </div>
194 </div>
195 {% endfor %}
196 </tbody>
197 <tfoot>
198 <tr>
199 <form action="{{ url_for('admin_vote_addchoice', voteid=vote.id) }}" method="post">
200 <td><input type="text" name="title" value="Nouveau choix"
201 onfocus="if(this.value=='Nouveau choix')this.value='';"
202 onblur="if(this.value=='')this.value='Nouveau choix';" /></td>
203 <td><input type="submit" class="btn btn-small btn-primary" value="+ Ajouter" />
204 </form>
205 </tr>
206 </tfoot>
207 </table>
208 </fieldset>
209 </div>
210 {% endif %}
211
212 <div class="span5 well pull-right">
213 <fieldset><legend>Pièces jointes</legend>
214 <table class="table table-stripped table-condensed">
215 <thead>
216 <tr>
217 <th>Lien
218 <th>Actions
219 </tr>
220 </thead>
221 <tbody>
222 {% for attachment in attachments %}
223 <tr>
224 <td>{{ attachment.url }}</td>
225 <td><a href="{{ url_for('admin_vote_deleteattachment', voteid=vote.id, attachmentid=attachment.id) }}" class="btn btn-small btn-danger">Supprimer</a></td>
226 </tr>
227 {% endfor %}
228 </tbody>
229 <tfoot>
230 <tr>
231 <form action="{{ url_for('admin_vote_addattachment', voteid=vote.id) }}" method="post">
232 <td><input type="text" name="url" value="Nouveau document"
233 onfocus="if(this.value=='Nouveau document')this.value='';"
234 onblur="if(this.value=='')this.value='Nouveau document';" /></td>
235 <td><input type="submit" class="btn btn-small btn-primary" value="+ Ajouter" />
236 </form>
237 </tr>
238 </tfoot>
239 </table>
240 </fieldset>
241 </div>
242
243 </div>
244
245 {% endblock %}