|
@@ -0,0 +1,146 @@
|
|
|
+{% extends "layout.html" %}
|
|
|
+{% block body %}
|
|
|
+
|
|
|
+<div class="row">
|
|
|
+ <div class="span6 well">
|
|
|
+ <form action="{{ url_for('edit_vote', voteid=vote['id']) }}" method="post" class="form-horizontal">
|
|
|
+ <fieldset><legend>Édition du vote</legend>
|
|
|
+ <div class="control-group">
|
|
|
+ <label class="control-label" for="title">Titre</label>
|
|
|
+ <div class="controls">
|
|
|
+ <input type="text" size=30 name="title" id="title" value="{{ vote.title }}" />
|
|
|
+ <span class="help-inline"><font color="red">*</font></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="control-group">
|
|
|
+ <label class="control-label" for="description">Description</label>
|
|
|
+ <div class="controls">
|
|
|
+ <textarea class="input-xlarge" name="description" id="description" value="{{ vote.description }}"></textarea>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="accordion">
|
|
|
+ <div class="accordion-group">
|
|
|
+ <div class="accordion-heading">
|
|
|
+ <a class="accordion-toggle" data-toggle="collapse" href="#infos">+ Informations</a>
|
|
|
+ </div>
|
|
|
+ <div id="infos" class="accordion-body collapse">
|
|
|
+ <div class="accordion-inner">
|
|
|
+ <div class="control-group">
|
|
|
+ <label class="control-label" for="category">Catégorie</label>
|
|
|
+ <div class="controls">
|
|
|
+ <input type="text" data-provide="typeahead" data-source='["ca","membres"]' size=30 name="category" id="category" value="{{ request.form.category }}" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="control-group">
|
|
|
+ <label class="control-label" for="role">Groupe</label>
|
|
|
+ <div class="controls">
|
|
|
+ <select name="role" id="role" disabled>
|
|
|
+ <option selected>Tous</option>
|
|
|
+ <option>CA</option>
|
|
|
+ <option>Membres</option>
|
|
|
+ </select>
|
|
|
+ <p class="help-block">Groupe d'utilisateur concernés par le vote et ayant le droit de voter</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="accordion-group">
|
|
|
+ <div class="accordion-heading">
|
|
|
+ <a class="accordion-toggle" data-toggle="collapse" href="#options">+ Options</a>
|
|
|
+ </div>
|
|
|
+ <div id="options" class="accordion-body collapse">
|
|
|
+ <div class="accordion-inner">
|
|
|
+ <div class="control-group">
|
|
|
+ <label class="control-label" for="days">Durée (jours)</label>
|
|
|
+ <div class="controls">
|
|
|
+ <select class="span1" name="days" id="days">
|
|
|
+ {% for i in range(1, 31) %}
|
|
|
+ {% if i == 20 %}
|
|
|
+ <option selected>{{ i }}</option>
|
|
|
+ {% else %}
|
|
|
+ <option>{{ i }}</option>
|
|
|
+ {% endif %}
|
|
|
+ {% endfor %}
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="control-group">
|
|
|
+ <label class="control-label">Options</label>
|
|
|
+ <div class="controls">
|
|
|
+ <label class="checkbox">
|
|
|
+ <input type="checkbox" name="transparent" />
|
|
|
+ Les votants peuvent-ils voir le choix des autres ?
|
|
|
+ </label>
|
|
|
+ <label class="checkbox">
|
|
|
+ <input type="checkbox" name="public" />
|
|
|
+ Le vote est-il visible par tous ?
|
|
|
+ </label>
|
|
|
+ {% if not vote.is_open %}
|
|
|
+ <label class="checkbox">
|
|
|
+ <input type="checkbox" name="multiplechoice" disabled/>
|
|
|
+ Les votants peuvent-ils choisir plusieurs options ?
|
|
|
+ </label>
|
|
|
+ {% endif %}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="control-group">
|
|
|
+ <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>
|
|
|
+ {% else %}
|
|
|
+ <option selected>Fermé</option>
|
|
|
+ <option>Ouvert</option>
|
|
|
+ {% endif %}
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-actions">
|
|
|
+ <input type="submit" class="btn btn-primary" value="Enregistrer" />
|
|
|
+ <input type="reset" class="btn" value="Annuler" />
|
|
|
+ </div>
|
|
|
+ </fieldset>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="span5 well">
|
|
|
+ <fieldset><legend>Choix</legend>
|
|
|
+ <table class="table table-stripped table-condensed">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>Titre
|
|
|
+ <th>Actions
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ {% for choice in choices %}
|
|
|
+ <tr>
|
|
|
+ <form action="{{ url_for('edit_choice', voteid=vote.id, choiceid=choice.id) }}" method="post">
|
|
|
+ <td><input type="text" name="title" value="{{ choice.name }}" /></td>
|
|
|
+ <td><input type="submit" class="btn btn-small" value="Sauver" />
|
|
|
+ <a href="{{ url_for('delete_choice', voteid=vote.id, choiceid=choice.id) }}" class="btn btn-small btn-danger">Supprimer</a></td>
|
|
|
+ </form>
|
|
|
+ </tr>
|
|
|
+ {% endfor %}
|
|
|
+ </tbody>
|
|
|
+ <tfoot>
|
|
|
+ <tr>
|
|
|
+ <form action="{{ url_for('add_choice', voteid=vote.id) }}" method="post">
|
|
|
+ <td><input type="text" name="title" value="Nouveau choix" /></td>
|
|
|
+ <td><input type="submit" class="btn btn-small btn-primary" value="+ Ajouter" />
|
|
|
+ </form>
|
|
|
+ </tr>
|
|
|
+ </tfoot>
|
|
|
+ </table>
|
|
|
+ </fieldset>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+{% endblock %}
|