Interface details
[cavote.git] / templates / admin_vote_edit.html
index d2f4ac1..215814c 100644 (file)
                     <input type="checkbox" name="public" {% if vote.is_public == 1 %} checked {% endif %}/>
                     Le vote est-il visible par tous ?
                   </label>
+                {% if not vote.is_terminated == 1 %}
                   <label class="checkbox">
                     <input type="checkbox" name="multiplechoice" {% if vote.is_multiplechoice == 1 %} checked {% endif %} disabled/>
                     Les votants peuvent-ils choisir plusieurs options ?
                   </label>
+                {% endif %}
                 </div>
               </div>
             </div>
         <label class="control-label" for="status">Statut</label>
         <div class="controls">
           <select class="span2" name="status" id="status">
-            {% if vote.is_open %}
-              <option>Fermé</option>
-              <option selected>Ouvert</option>
+            {% if vote.is_terminated == 1 %}
+                  <option>Fermé</option>
+                  <option>Ouvert</option>
+                  <option selected>Terminé</option>
             {% else %}
-              <option selected>Fermé</option>
-              <option>Ouvert</option>
+                {% if vote.is_open == 1 %}
+                  <option>Fermé</option>
+                  <option selected>Ouvert</option>
+                  <option>Terminé</option>
+                {% else %}
+                  <option selected>Fermé</option>
+                  <option>Ouvert</option>
+                {% endif %}
             {% endif %}
           </select>
         </div>
     </form>
   </div>
 
+  {% if not vote.is_terminated == 1%}
   <div class="span5 well pull-right">
     <fieldset><legend>Choix</legend>
       <table class="table table-stripped table-condensed">
         <tfoot>
           <tr>
             <form action="{{ url_for('admin_vote_addchoice', voteid=vote.id) }}" method="post">
-              <td><input type="text" name="title" value="Nouveau choix" /></td>
+              <td><input type="text" name="title" value="Nouveau choix"
+                onfocus="if(this.value=='Nouveau choix')this.value='';"
+                onblur="if(this.value=='')this.value='Nouveau choix';" /></td>
               <td><input type="submit" class="btn btn-small btn-primary" value="+ Ajouter" />
             </form>
           </tr>
       </table>
     </fieldset>
   </div>
+  {% endif %}
 
   <div class="span5 well pull-right">
     <fieldset><legend>Pièces jointes</legend>
         <tfoot>
           <tr>
             <form action="{{ url_for('admin_vote_addattachment', voteid=vote.id) }}" method="post">
-              <td><input type="text" name="url" value="Nouveau document" /></td>
+              <td><input type="text" name="url" value="Nouveau document" 
+                onfocus="if(this.value=='Nouveau document')this.value='';"
+                onblur="if(this.value=='')this.value='Nouveau document';" /></td>
               <td><input type="submit" class="btn btn-small btn-primary" value="+ Ajouter" />
             </form>
           </tr>