diff options
| author | etienne <etienne@07715635-78ed-41b0-aaf1-0afda6c37f35> | 2008-12-06 01:21:48 +0000 |
|---|---|---|
| committer | etienne <etienne@07715635-78ed-41b0-aaf1-0afda6c37f35> | 2008-12-06 01:21:48 +0000 |
| commit | 599c62e4e77aaa4898b9ba690e39b1102ac09a71 (patch) | |
| tree | b40a9757d4e3cc0152b96cc79efbf3147eebfd86 /templates | |
| parent | 23de64513f703edc914a77787a804d322fc86b05 (diff) | |
| download | Papillon-599c62e4e77aaa4898b9ba690e39b1102ac09a71.tar.bz2 Papillon-599c62e4e77aaa4898b9ba690e39b1102ac09a71.zip | |
Highlight prefered choice - Open/close a poll - Css modification
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/createOrEdit.html | 29 | ||||
| -rw-r--r-- | templates/vote.html | 31 |
2 files changed, 36 insertions, 24 deletions
diff --git a/templates/createOrEdit.html b/templates/createOrEdit.html index 417f7b7..3e88bfe 100644 --- a/templates/createOrEdit.html +++ b/templates/createOrEdit.html @@ -7,7 +7,7 @@ {% endif %} <h2>{% if new %}{% trans "New poll" %}{% else %}{% trans "Edit poll" %}{% endif %}</h2> {% if error %}<p class='error'>{{ error }}</p>{% endif %} -<table id='new_poll'> +<table class='new_poll'> <form action="{{admin_url}}" method="post"> {% if not new %}<tr> @@ -88,14 +88,6 @@ </td> </tr> - {% if choices %}<tr> - <th>{% trans "Choices" %}</th><th>{% trans "Label" %}</th><th>{% trans "Limit" %}</th><th>{% trans "Delete?"%}</th> - </tr> - {% for choice in choices %}<tr> - <td> </td><td><input type='text' name='modify_{{choice.id}}' value="{{choice.name}}"/></td><td>{%if choice.limit%}{% blocktrans with choice.limit as choice_limit%}Limited to {{choice_limit}} vote(s){% endblocktrans %}{%endif%}</td><td><input type='checkbox' name='delete_{{choice.id}}'/></td> - </tr> - {% endfor %}{% endif %} - <tr> <td></td> <td>{% if new %}<input type='hidden' name='new' value='1'/> @@ -106,9 +98,24 @@ </tr> </form> -{% if new %} </table> -{% else %} +{% if not new %} +<h2>{% trans "Choices" %}</h2> +<table class='new_poll'> + {% if choices %}<form action="{{admin_url}}" method="post"> + <tr> + <th>{% trans "Choices" %}</th><th>{% trans "Label" %}</th><th>{% trans "Limit" %}</th><th>{% trans "Delete?"%}</th> + </tr> + {% for choice in choices %}<tr> + <td> </td><td><input type='text' name='modify_{{choice.id}}' value="{{choice.name}}"/></td><td>{%if choice.limit%}{% blocktrans with choice.limit as choice_limit%}Limited to {{choice_limit}} vote(s){% endblocktrans %}{%endif%}</td><td><input type='checkbox' name='delete_{{choice.id}}'/></td> + </tr>{% endfor %} + <tr> + <td></td> + <td><input type='hidden' name='edit' value='1'/> + <input type='submit' value='{% trans "Edit" %}' /></td> + </tr> + </form>{% endif %} + <form action="{{admin_url}}" method="post"> <tr><td><label>{% trans "New choice" %}</label></td><td><input type='text' name='new_choice'/></td><td>{%trans "Limited to"%} <input type='text' name='limit' id='limit'/> {%trans "vote(s)"%}</td><td class='form_description'>{% trans "Setting a new choice. Optionally you can set a limit of vote for this choice. This limit is usefull for limited resources allocation." %}</td></tr> <tr> diff --git a/templates/vote.html b/templates/vote.html index e000bc9..803813e 100644 --- a/templates/vote.html +++ b/templates/vote.html @@ -2,9 +2,10 @@ {% load i18n %} {% block content %} - <h2>{{poll_type_name}} - {{poll_name}}</h2> -{% if error %}<p class='error'>{{ error }}</p>{% endif %} - <p>{{poll_desc}}</p> + <h2>{{poll_type_name}} - {{poll.name}}</h2> +{% if error %}<p class='alert'>{{ error }}</p>{% endif %} +{% if not poll.open %}<p class='alert'>{% trans "The current poll is closed."%}</p>{% endif %} + <p>{{ poll.description }}</p> <form method='post' action='{{base_url}}'> <div id='poll_table'> <table id='poll'> @@ -20,13 +21,13 @@ <td><input type='text' name='author_name' value='{{voter.user.name}}'/></td> {% for vote in voter.votes %}<td> {% if vote.choice.available or vote.value %} - {% ifequal poll_type 'P' %} + {% ifequal poll.type 'P' %} <input type='checkbox' name='vote_{{vote.id}}'{%ifequal vote.value 1%} checked='checked'{%endifequal%}/> {% endifequal %} - {% ifequal poll_type 'O' %} + {% ifequal poll.type 'O' %} <input type='radio' name='vote' value='{{vote.id}}' {%ifequal vote.value 1%} checked='checked'{%endifequal%}/> {% endifequal %} - {% ifequal poll_type 'B' %} + {% ifequal poll.type 'B' %} <select name='vote_{{vote.id}}'> {% for vote_choice in VOTE %} <option value='{{vote_choice.0}}'{%ifequal vote.value vote_choice.0%} selected='selected'{%endifequal%}>{{vote_choice.1.1}}</option> @@ -37,10 +38,10 @@ {% trans "Limit reached" %} {% endif %} </td>{%endfor%} - {%else%}<td class='simple'><a href='?voter={{voter.id}}'>{% trans "Edit" %}</a></td> + {%else%}<td class='simple'>{% if poll.open %}<a href='?voter={{voter.id}}'>{% trans "Edit" %}</a>{%else%} {%endif%}</td> <td>{{voter.user.name}}</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 'B'%} + {%ifequal poll.type 'B'%} {%for VOT in VOTE%} {%ifequal VOT.0 vote.value%}{{VOT.1.1}}{%endifequal%}{%endfor%} {%else%} @@ -52,16 +53,17 @@ {%endifequal%} </tr>{%endfor%} {%if not current_voter_id%} + {% if poll.open %} <tr> <td class='simple'></td> <td><input type='text' name='author_name'/></td> {%for choice in choices%}<td> {% if choice.available %} - {% ifequal poll_type 'P' %} + {% ifequal poll.type 'P' %} <input type='checkbox' name='choice_{{choice.id}}'/>{% endifequal %} - {% ifequal poll_type 'O' %} + {% ifequal poll.type 'O' %} <input type='radio' name='choice' value='{{choice.id}}'/>{% endifequal %} - {% ifequal poll_type 'B' %} + {% 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.1}}</option>{% endfor %} </select> @@ -72,17 +74,20 @@ </td>{%endfor%} </tr> {%endif%} + {%endif%} <tr id='sum'> <td class='simple'></td><th>{% trans "Sum" %}</th> - {% for choice in choices %}<td>{{choice.sum}}</td> + {% for choice in choices %}<td{%if choice.highlight %} class='highlight'{%endif%}>{{choice.sum}}</td> {% endfor %} </tr> </table> + {% if poll.open %} <input type='submit' value='{%if current_voter_id%}{% trans "Edit" %}{%else%}{% trans "Participate" %}{%endif%}'/> + {% endif %} </div> <hr class='spacer'/> </form> <div id='syndication'> - {% trans "Remain informed of poll evolution:" %} <a href="/papillon/feeds/poll/{{poll_base_url}}/">{%trans "Syndication"%}</a> + {% trans "Remain informed of poll evolution:" %} <a href="/papillon/feeds/poll/{{poll.base_url}}/">{%trans "Syndication"%}</a> </div> {% endblock %} |
