dépôts
/
cavote.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Many improvment in votes
[cavote.git]
/
templates
/
vote.html
diff --git
a/templates/vote.html
b/templates/vote.html
index
fd93e5b
..
47b1d29
100644
(file)
--- a/
templates/vote.html
+++ b/
templates/vote.html
@@
-3,7
+3,12
@@
<div class="row">
<div class="span9">
<h2 class='page-header'>{{ vote.title }}</h2>
<div class="row">
<div class="span9">
<h2 class='page-header'>{{ vote.title }}</h2>
-<table class="table table-condensed table-striped table-bordered">
+
+{% 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>
<thead>
<tr>
<th></th>
@@
-15,24
+20,25
@@
</thead>
<tbody>
</thead>
<tbody>
- {% if vote.is_transparent %}
{% for user in users %}
{% for user in users %}
+ {% if vote.is_transparent or user.userid == session.user.id %}
<tr>
<tr>
- <t
d>{{ user.username }}</td
>
+ <t
h>{% if 'user' in session and user.userid == session.user.id %}<i class="icon-user"></i>{% endif %} {{ user.username }}</th
>
{% for choice in choices %}
{% for choice in choices %}
- <th>{% if choice in user.choices %}OUI{% else %}NON{% endif %}</th>
+ {% if choice.id in user.choices %}
+ <td class="yes">OUI</td>
+ {% else %}
+ <td class="no"></td>{% endif %}
{% endfor %}
{% endfor %}
+ <td>{% if 'user' in session and user.userid == session.user.id %}<a href="{{ url_for('vote_deletechoices', idvote=vote.id, iduser=session.user.id) }}" class="btn btn-mini btn-danger" title="Supprimer">X</a>{% endif %}</td>
</tr>
</tr>
- {% endfor %}
- {% else %}
- <div class="alert alert-info">Ce sondage n'est pas transparent, vous ne pouvez pas voir les votes des autres.</div>
- <!-- :TODO:maethor:20120528: Afficher le vote de l'utilisateur -->
{% endif %}
{% endif %}
+ {% endfor %}
{% if can_vote %}
<form class="form-inline" action="{{ url_for('vote', idvote=vote.id) }}" method="post">
<tr>
{% if can_vote %}
<form class="form-inline" action="{{ url_for('vote', idvote=vote.id) }}" method="post">
<tr>
- <t
d><input type='text' name="username" value='{{ session.user.name }}' disabled /></td
>
+ <t
h><input type='text' name="username" value='{{ session.user.name }}' disabled /></th
>
{% if vote.is_multiple %}
{% for choice in choices %}
<td><input type='checkbox' name="{{ choice.id }}" /></td>
{% if vote.is_multiple %}
{% for choice in choices %}
<td><input type='checkbox' name="{{ choice.id }}" /></td>
@@
-47,12
+53,13
@@
</form>
{% endif %}
</tbody>
</form>
{% endif %}
</tbody>
+
<tfoot>
{% if vote.is_transparent %}
<tr>
<tfoot>
{% if vote.is_transparent %}
<tr>
- <t
d style="text-align: right">Somme</td
>
+ <t
h>Somme</th
>
{% for choice in choices %}
{% for choice in choices %}
- <td>
nb
</td>
+ <td>
{{ choice.nb }}
</td>
{% endfor %}
<td></td>
</tr>
{% endfor %}
<td></td>
</tr>