summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/createOrEdit.html9
-rw-r--r--templates/vote.html32
2 files changed, 33 insertions, 8 deletions
diff --git a/templates/createOrEdit.html b/templates/createOrEdit.html
index 12d9d9d..4eecaa2 100644
--- a/templates/createOrEdit.html
+++ b/templates/createOrEdit.html
@@ -34,21 +34,20 @@
<td>{% if new %}<textarea name='poll_desc'>{{poll_desc}}</textarea>{% else %}{{poll_desc}}{% endif %}</td>
<td class='form_description'>{% trans "Precise description of the poll" %}</td>
</tr>
- <!--<tr>
+ <tr>
<td><label for='poll_type'>{% trans "Poll type" %}</label></td>
<td>{% if new %}<select name='poll_type'>
{% for typ in TYPES %}<option value='{{typ.0}}'{% ifequal poll_type typ.0%} selected='selected'{% endifequal %}>{{typ.1}}</option>{% endfor %}
</select>{% else %}{{type_name}}{% endif %}</td>
<td class='form_description'>{% trans "Type of the poll:" %}
<ul>
- <li>{% trans "Meeting is the appropriate type to set a date for a meeting."%}</li>
+ <!--<li>{% trans "Meeting is the appropriate type to set a date for a meeting."%}</li>!-->
<li>{% trans "Poll is the appropriate type for a simple multi-choice poll" %}</li>
<li>{% trans "Balanced poll lets voters setting negative vote for some choices" %}</li>
- <li>{% trans "One choice poll" %}</li>
+ <!--<li>{% trans "One choice poll" %}</li>!-->
</ul>
</td>
- </tr>!-->
- <input type='hidden' name='poll_type' value='M'/>
+ </tr>
{% if not new %}{% if choices %}<tr>
<th>{% trans "Choices" %}</th><th>&nbsp;</th><th>{% trans "Delete?"%}</th>
</tr>
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'>