diff options
| author | etienne <etienne@07715635-78ed-41b0-aaf1-0afda6c37f35> | 2008-08-21 00:40:10 +0000 |
|---|---|---|
| committer | etienne <etienne@07715635-78ed-41b0-aaf1-0afda6c37f35> | 2008-08-21 00:40:10 +0000 |
| commit | 95c2f32086b98edcdc1121bb936cfdefa1ee33bf (patch) | |
| tree | 7d6c78b791ba193f10dc972131d9a97fbd65635a /templates/vote.html | |
| parent | fad8645171c29359ba9ecfc128dceba545298849 (diff) | |
| download | Papillon-95c2f32086b98edcdc1121bb936cfdefa1ee33bf.tar.bz2 Papillon-95c2f32086b98edcdc1121bb936cfdefa1ee33bf.zip | |
Implementation of the 3 choices poll
Diffstat (limited to 'templates/vote.html')
| -rw-r--r-- | templates/vote.html | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/templates/vote.html b/templates/vote.html index 0174a18..27e54a3 100644 --- a/templates/vote.html +++ b/templates/vote.html @@ -17,10 +17,28 @@ <input type='hidden' name='voter' value='{{voter.id}}'/> <td class='simple'></td> <td><input type='text' name='author_name' value='{{voter.name}}'/></td> - {% for vote in voter.votes %}<td><input type='checkbox' name='{%if vote.id%}vote_{{vote.id}}{%else%}choice_{{vote}}{%endif%}'{%ifequal vote.value 1%} checked='checked'{%endifequal%}/></td>{%endfor%} + {% for vote in voter.votes %}<td> + {% ifequal poll_type 'P' %} + <input type='checkbox' name='{%if vote.id%}vote_{{vote.id}}{%else%}choice_{{vote}}{%endif%}'{%ifequal vote.value 1%} checked='checked'{%endifequal%}/> + {% endifequal %} + {% ifequal poll_type 'B' %} + <select name='{%if vote.id%}vote_{{vote.id}}{%else%}choice_{{vote}}{%endif%}'> + {% for vote_choice in VOTE %} + <option value='{{vote_choice.0}}'{%ifequal vote.value vote_choice.0%} selected='selected'{%endifequal%}>{{vote_choice.1}}</option> + {% endfor %} + </select> + {% endifequal %} + </td>{%endfor%} {%else%}<td class='simple'><a href='?voter={{voter.id}}'>{% trans "Edit" %}</a></td> <td>{{voter.name}}</td> - {% for vote in voter.votes %}<td class='{%ifequal vote.value 1%}OK{%else%}KO{%endifequal%}'>{% ifequal vote.value 1%}Yes{%else%}No{%endifequal%}</td> + {% for vote in voter.votes %}<td class='{%ifequal vote.value 1%}OK{%else%}{%ifequal vote.value 0%}OKO{%else%}KO{%endifequal%}{%endifequal%}'> + {%ifequal poll_type 'P'%} + {%ifequal vote.value 0%}{% trans "No" %}{%else%}{% trans "Yes" %}{%endifequal%} + {%else%} + {%for VOT in VOTE%} + {%ifequal VOT.0 vote.value%}{{VOT.1}}{%endifequal%}{%endfor%} + {%endifequal%} + </td> {%endfor%} {%endifequal%} </tr>{%endfor%} @@ -28,7 +46,15 @@ <tr> <td class='simple'></td> <td><input type='text' name='author_name'/></td> - {%for choice in choices%}<td><input type='checkbox' name='choice_{{choice.id}}'/></td>{%endfor%} + {%for choice in choices%}<td> + {% ifequal poll_type 'P' %} + <input type='checkbox' name='choice_{{choice.id}}'/>{% endifequal %} + {% ifequal poll_type 'B' %} + <select name='choice_{{choice.id}}'>{% for vote_choice in VOTE %} + <option value='{{vote_choice.0}}'{%ifequal vote_choice.0 0%} selected='selected'{%endifequal%}>{{vote_choice.1}}</option>{% endfor %} + </select> + {% endifequal %} + </td>{%endfor%} </tr> {%endif%} <tr id='sum'> |
