summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrien Dorsaz <adrien@adorsaz.ch>2013-08-09 00:27:14 +0200
committerAdrien Dorsaz <adrien@adorsaz.ch>2013-08-09 00:27:14 +0200
commitbc605b5804dc081ae03ad2aae96141fb21621e09 (patch)
treef4c488eec3ece4dd1b3935b687bd0c5c8515ae1d
parent061ddcd33f2fce2af2b5e4e641e5c3da966c265e (diff)
downloadPapillon-bc605b5804dc081ae03ad2aae96141fb21621e09.tar.bz2
Papillon-bc605b5804dc081ae03ad2aae96141fb21621e09.zip
Update design and indent code (editChoicesAdmin)
-rw-r--r--papillon/templates/editChoicesAdmin.html68
1 files changed, 41 insertions, 27 deletions
diff --git a/papillon/templates/editChoicesAdmin.html b/papillon/templates/editChoicesAdmin.html
index 78d3be5..3ded310 100644
--- a/papillon/templates/editChoicesAdmin.html
+++ b/papillon/templates/editChoicesAdmin.html
@@ -10,36 +10,50 @@
{% endblock %}
{% block content %}
-{% if not choices %}<p class='error'>
-{% blocktrans %}As long as no options were added to the poll, it will not be available.{% endblocktrans %}
-</p>{% else %}
-<h2>{% trans "Complete/Finalise the poll" %}</h2>
-<p><a href="{% url 'edit' poll.admin_url %}"><button>{% trans "Next"%}</button></a></p>
+{% if not choices %}
+ <p class='error'>
+ {% blocktrans %}As long as no options were added to the poll, it will not be available.{% endblocktrans %}
+ </p>
+{% else %}
+ <h2>{% trans "Choice administration" %}</h2>
+ <p>{% trans "After you've finished to add or edit choices for this poll, click on:" %} <a href="{% url 'edit' poll.admin_url %}"><button>{% trans "Next"%}</button></a></p>
{% endif %}
+
{% include 'editChoices.html' %}
+
{% if choices %}
-<h2>{% trans "Available choices" %}</h2>
-<table class='new_poll'>
- <tr>
- {%if not poll.dated_choices%}<th>{% trans "Up/down" %}</th>{%endif%}
- <th>{% trans "Label" %}</th>
- <th>{% trans "Limit" %}</th>
- <th>{% trans "Delete?"%}</th>
- </tr>
- {% for choice in choices %}
- <form action="." method="post">
- {% csrf_token %}
- {{choice.form.poll}}{{choice.form.order}}<tr>
- {%if not poll.dated_choices%}<td><a href='?up_choice={{choice.id}}' class='arrow'>+</a>
- / <a href='?down_choice={{choice.id}}' class='arrow'>-</a></td>{%endif%}
- <td>{{choice.form.name}}</td>
- <td>{% trans "Limited to"%} {{choice.form.limit}} {% trans "vote(s)" %}</td>
- <td><input type='checkbox' name='delete_{{choice.id}}'/></td>
- <td><input type='hidden' name='edit' value='{{choice.id}}'/></td>
- <td><input type='submit' value='{% trans "Edit" %}' class='submit'/></td>
- </tr>
- </form>{% endfor %}
-</table>
+ <div class="new_poll" style="margin-top:20px;">
+ <div class="field_label">{% trans "Edit available choices" %}</div>
+ <div>
+ <table>
+ <tr>
+ {%if not poll.dated_choices%}<th style="word-wrap:none;">{% trans "Position" %}</th>{%endif%}
+ <th>{% trans "Name" %}</th>
+ <th>{% trans "Max votes" %}</th>
+ <th width="60px;">{% trans "Delete?"%} <span class="help_button" title='{% trans "To remove a choice, check this box on the good line and click on Edit."%}'>?</span></th>
+ </tr>
+ {% for choice in choices %}
+ <form action="." method="post">
+ {% csrf_token %}
+ {{choice.form.poll}}{{choice.form.order}}<tr>
+ {%if not poll.dated_choices%}
+ <td style="font-size:1.5em;">
+ <a href='?up_choice={{choice.id}}' class='arrow' title='{% trans "Move up" %}'>&uarr;</a>
+ <br/>
+ <a style="color:red;" href='?down_choice={{choice.id}}' title='{% trans "Move down" %}' class='arrow'>&darr;</a>
+ </td>
+ {%endif%}
+ <td>{{choice.form.name}}</td>
+ <td>{{choice.form.limit}}</td>
+ <td><input type='checkbox' name='delete_{{choice.id}}'/></td>
+ <td><input type='hidden' name='edit' value='{{choice.id}}'/></td>
+ <td><input type='submit' value='{% trans "Edit" %}' class='submit'/></td>
+ </tr>
+ </form>{% endfor %}
+ </table>
+ </div>
+ </div>
+ <div style="clear:both"></div>
{% endif %}
{% endblock %}