123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- {% extends "layout.html" %}
- {% block body %}
- <div class="row">
- <div class="span9">
- <h2 class='page-header'>{{ vote.title }}</h2>
- {% if not vote.is_transparent %}
- <div class="alert alert-info">Ce sondage n'est pas transparent, vous ne pouvez pas voir les votes des autres.</div>
- {% endif %}
- <table class="table table-condensed table-bordered table-votes">
- <thead>
- <tr>
- <th></th>
- {% for choice in choices %}
- <th>{{ choice.name }}</th>
- {% endfor %}
- {% if 'user' in session %}
- <th></th>
- {% endif %}
- </tr>
- </thead>
- <tbody>
- {% for user in users %}
- {% if vote.is_transparent or (session.user and user.userid == session.user.id )%}
- <tr>
- <th>{% if 'user' in session and user.userid == session.user.id %}<i class="icon-user"></i>{% endif %} {{ user.username }}</th>
- {% for choice in choices %}
- {% if choice.id in user.choices %}
- <td class="yes"><i class="icon-ok icon-white"></i></td>
- {% else %}
- <td class="no"></td>{% endif %}
- {% endfor %}
- {% if 'user' in session %}
- <td>{% if user.userid == session.user.id %}
- <a href="#delete" data-toggle="modal" class="btn btn-danger btn-mini" title="Supprimer"><i class="icon-remove icon-white"></i></a>
- <div class="modal hide fade" id="delete">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal">×</button>
- <h3>Suppression de votre vote</h3>
- </div>
- <div class="modal-body">
- <p>Voulez-vous vraiment supprimer votre vote ?</p>
- </div>
- <div class="modal-footer">
- <a href="{{ url_for('vote_deletechoices', idvote=vote.id, iduser=session.user.id) }}" class="btn btn-danger">Confirmer</a>
- <a href="#" class="btn" data-dismiss="modal">Annuler</a>
- </div>
- </div>
- {% endif %}</td>
- {% endif %}
- </tr>
- {% endif %}
- {% endfor %}
- {% if can_vote %}
- <form class="form-inline" action="{{ url_for('vote', idvote=vote.id) }}" method="post">
- <tr>
- <th><input type='text' name="username" value='{{ session.user.name }}' disabled /></th>
- {% if vote.is_multiplechoice %}
- {% for choice in choices %}
- <td><input type='checkbox' name="{{ choice.id }}" value="{{ choice.id }}" /></td>
- {% endfor %}
- {% else %}
- {% for choice in choices %}
- <td><input type='radio' name="choice" value="{{ choice.id }}" /></td>
- {% endfor %}
- {% endif %}
- <td><input type="submit" class="btn btn-primary" value="OK" /></td>
- </tr>
- </form>
- {% endif %}
- </tbody>
- <tfoot>
- {% if vote.is_transparent %}
- <tr>
- <th>Somme</th>
- {% for choice in choices %}
- <td>{{ choice.nb }}</td>
- {% endfor %}
- {% if 'user' in session %}
- <td></td>
- {% endif %}
- </tr>
- {% endif %}
- </tfoot>
- </table>
- </div>
- <div class="span3">
- <h3>Informations</h3>
- {% if vote.nb_votes == 0 %}
- <div class="progress progress-striped progress-danger">
- <div class="bar" style="width: 100%;"><strong>{{ vote.nb_votes }} / {{ vote.max_votes }}</strong></div>
- </div>
- {% else %}
- <div class="progress progress-striped {% if vote.nb_votes == vote.max_votes %}progress-success{% endif %}">
- <div class="bar" style="width: {{ vote.percent }}%;"><strong>{{ vote.nb_votes }} / {{ vote.max_votes }}</strong></div>
- </div>
- {% endif %}
- <dl class="dl-horizontal">
- <dt>Publié par <dd><code>{{ vote.author }}</code>
- <dt>Début le <dd><code>{{ vote.date_begin }}</code>
- <dt>Deadline le <dd><code>{{ vote.date_end }}</code>
- <dt>Groupe <dd><code>{{ vote.groupname }}</code>
- <dt>Catégorie <dd><code>{{ vote.category }}</code>
- </dl>
- <dl>
- {% if vote.description %}
- <dt>Description : <dd>{{ vote.description }}
- {% endif %}
- {% if attachments %}
- <dt>Documents :<dd>
- <ul>
- {% for attachment in attachments %}
- <li><a href="{{ attachment.url }}">{{ attachment.url }}</a></li>
- {% endfor %}
- </ul>
- {% endif %}
- </dl>
- </div>
- </div>
- {% endblock %}
|