summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authoretienne2008-12-05 00:16:29 +0000
committeretienne2008-12-05 00:16:29 +0000
commitaedea8f1939ae9f894670b461abea9bea1be092e (patch)
treed65caa6dd02ca3a0ecb9db5377f64db861f6d684 /templates
parent34298e230277a8cc7a1a67f7e23e01768668142d (diff)
Public votes - Polls categories
Diffstat (limited to 'templates')
-rw-r--r--templates/createOrEdit.html50
-rw-r--r--templates/main.html12
2 files changed, 57 insertions, 5 deletions
diff --git a/templates/createOrEdit.html b/templates/createOrEdit.html
index 4cc7420..417f7b7 100644
--- a/templates/createOrEdit.html
+++ b/templates/createOrEdit.html
@@ -9,6 +9,7 @@
{% if error %}<p class='error'>{{ error }}</p>{% endif %}
<table id='new_poll'>
<form action="{{admin_url}}" method="post">
+
{% if not new %}<tr>
<td><label>{% trans "Poll url" %}</label></td>
<td colspan='2'><a href='http://{{full_base_url}}'>http://{{full_base_url}}</a></td>
@@ -19,21 +20,59 @@
<td colspan='2'><a href='http://{{full_admin_url}}'>http://{{full_admin_url}}</a></td>
<td class='form_description'>{% trans "Address to modify the current poll" %}</td>
</tr>
- {% endif %}<tr>
+ {% endif %}
+
+ <tr>
<td><label for='author_name'>{% trans "Author name" %}</label></td>
- <td colspan='2'>{% if new %}<input type='text' name='author_name' value='{{author_name}}'/>{% else %}{{author_name}}{% endif %}</td>
+ <td colspan='2'>{% if new %}<input type='text' name='author_name' value='{{poll.author.name}}'/>{% else %}{{poll.author.name}}{% endif %}</td>
<td class='form_description'>{% trans "Name, firstname or nickname of the author" %}</td>
</tr>
+
<tr>
<td><label for='poll_name'>{% trans "Poll name" %}</label></td>
- <td colspan='2'>{% if new %}<input type='text' name='poll_name' value='{{poll_name}}'/>{% else %}<input type='text' name='poll_name' value='{{poll_name}}'/>{% endif %}</td>
+ <td colspan='2'>{% if new %}<input type='text' name='poll_name' value='{{poll.name}}'/>{% else %}<input type='text' name='poll_name' value='{{poll.name}}'/>{% endif %}</td>
<td class='form_description'>{% trans "Global name to present the poll" %}</td>
</tr>
+
<tr>
<td><label for='poll_desc'>{% trans "Poll description" %}</label></td>
- <td colspan='2'>{% if new %}<textarea name='poll_desc'>{{poll_desc}}</textarea>{% else %}<textarea name='poll_desc'>{{poll_desc}}</textarea>{% endif %}</td>
+ <td colspan='2'>{% if new %}<textarea name='poll_desc'>{{poll.description}}</textarea>{% else %}<textarea name='poll_desc'>{{poll.description}}</textarea>{% endif %}</td>
<td class='form_description'>{% trans "Precise description of the poll" %}</td>
</tr>
+
+ {% if not new %}<tr>
+ <td><label for='poll_open'>{% trans "Poll status" %}</label></td>
+ <td colspan='2'>
+ <select name='poll_open'>
+ <option value='1'{%if poll.open %} selected='selected'{%endif%}>{%trans "Open"%}</option>
+ <option value='0'{%if not poll.open %} selected='selected'{%endif%}>{%trans "Closed"%}</option>
+ </select>
+ </td>
+ <td class='form_description'>{% trans "Status of the poll. When closed no vote add or modification are allowed" %}</td>
+ </tr>{% endif %}
+
+ <tr>
+ <td><label for='poll_public'>{% trans "Public" %}</label></td>
+ <td colspan='2'>
+ <select name='poll_public'>
+ <option value='1'{%if poll.public %} selected='selected'{%endif%}>{%trans "Yes"%}</option>
+ <option value='0'{%if not poll.public %} selected='selected'{%endif%}>{%trans "No"%}</option>
+ </select>
+ </td>
+ <td class='form_description'>{% trans "If the poll is public it is available on the main page" %}</td>
+ </tr>
+
+ {% if categories %}<tr>
+ <td><label for='poll_category'>{% trans "Poll category" %}</label></td>
+ <td colspan='2'>{% if new %}
+ <select name='poll_category'>
+ <option value=''>---</option>
+ {% for category in categories %}<option value='{{category.id}}'>{{category.name}}</option>{% endfor %}
+ </select>{%else%}{{poll.category.name}}
+ {% endif %}</td>
+ <td class='form_description'>{% trans "Category of the poll" %}</td>
+ </tr>{% endif %}
+
<tr>
<td><label for='poll_type'>{% trans "Poll type" %}</label></td>
<td colspan='2'>{% if new %}<select name='poll_type'>
@@ -48,6 +87,7 @@
</ul>
</td>
</tr>
+
{% if choices %}<tr>
<th>{% trans "Choices" %}</th><th>{% trans "Label" %}</th><th>{% trans "Limit" %}</th><th>{% trans "Delete?"%}</th>
</tr>
@@ -55,6 +95,7 @@
<td>&nbsp;</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'/>
@@ -63,6 +104,7 @@
<input type='submit' value='{% trans "Edit" %}' />
{% endif %}</td>
</tr>
+
</form>
{% if new %}
</table>
diff --git a/templates/main.html b/templates/main.html
index 05c8b95..59adba7 100644
--- a/templates/main.html
+++ b/templates/main.html
@@ -3,7 +3,17 @@
{% block content %}
{% if error %}<p class='error'>{{error}}</p>{%endif%}
-<h2><a href='edit/0'>{% trans "Create a poll" %}</a></h2>
+<h2><a href='edit/0'>{%trans "Create a poll"%}</a></h2>
<p>{% trans "Create a new sondage for take a decision, find a date for a meeting, etc." %}</p>
+{% if polls %}<h2>{%trans "Polls"%}</h2>{%endif%}
+{% for poll in polls %}
+<p><a href='poll/{{poll.base_url}}'>{{poll.name}}</a> {{poll.description}}</p>
+{% endfor %}
+
+{% if categories %}<h2>{%trans "Categories"%}</h2>{% endif %}
+{% for category in categories %}
+<h3><a href='category/{{category.id}}'>{{category.name}}</a></h3>
+{% endfor %}
+
{% endblock %}