summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authoretienne <etienne@07715635-78ed-41b0-aaf1-0afda6c37f35>2008-08-05 21:48:10 +0000
committeretienne <etienne@07715635-78ed-41b0-aaf1-0afda6c37f35>2008-08-05 21:48:10 +0000
commitb10461003a785b6579e82fae380161396d94b68e (patch)
treeeb47f649ce160eddf79315036031e72aa67fbd17 /templates
downloadPapillon-b10461003a785b6579e82fae380161396d94b68e.tar.bz2
Papillon-b10461003a785b6579e82fae380161396d94b68e.zip
Initial import
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html18
-rw-r--r--templates/createOrEdit.html61
-rw-r--r--templates/main.html8
-rw-r--r--templates/vote.html40
4 files changed, 127 insertions, 0 deletions
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..be42e2c
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <link rel="stylesheet" href="/static/styles.css" />
+ <title>{% block title %}Polls{% endblock %}</title>
+</head>
+
+<body>
+<div id="top">
+ <h1><a href='http://{{root_url}}'>Papillon</a></h1>
+</div>
+<div id="content">
+{% block content %}{% endblock %}
+</div>
+</body>
+</html>
+
diff --git a/templates/createOrEdit.html b/templates/createOrEdit.html
new file mode 100644
index 0000000..abc949e
--- /dev/null
+++ b/templates/createOrEdit.html
@@ -0,0 +1,61 @@
+{% extends "base.html" %}
+
+{% block content %}
+ <h2>{% if new %}New{% else %}Edit{% endif %} poll</h2>
+{% if error %}<p class='error'>{{ error }}</p>{% endif %}
+ <form action="{{admin_url}}" method="post">
+ <table class='new_poll'>
+ {% if not new %}<tr>
+ <td><label>Poll url</label></td>
+ <td><a href='http://{{full_base_url}}'>http://{{full_base_url}}</a></td>
+ <td class='form_description'>Copy this address and send it to voters who want to participate to this poll</td>
+ </tr>
+ <tr>
+ <td><label>Administration url</label></td>
+ <td><a href='http://{{full_admin_url}}'>http://{{full_admin_url}}</a></td>
+ <td class='form_description'>Address to modify the current poll</td>
+ </tr>
+ {% endif %}<tr>
+ <td><label for='author_name'>Author name</label></td>
+ <td>{% if new %}<input type='text' name='author_name' value='{{author_name}}'/>{% else %}{{author_name}}{% endif %}</td>
+ <td class='form_description'>Name, firstname or nickname of the author</td>
+ </tr>
+ <tr>
+ <td><label for='poll_name'>Poll name</label></td>
+ <td>{% if new %}<input type='text' name='poll_name' value='{{poll_name}}'/>{% else %}{{poll_name}}{% endif %}</td>
+ <td class='form_description'>Global name to present the poll</td>
+ </tr>
+ <tr>
+ <td><label for='poll_desc'>Poll description</label></td>
+ <td>{% if new %}<textarea name='poll_desc'>{{poll_desc}}</textarea>{% else %}{{poll_desc}}{% endif %}</td>
+ <td class='form_description'>Precise description of the poll</td>
+ </tr>
+ <!--<tr>
+ <td><label for='poll_type'>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'>Type of the poll :
+ <ul>
+ <li>Meeting is the appropriate type to set a date for a meeting.</li>
+ <li>Poll is the appropriate type for a simple multi-choice poll</li>
+ <li>Balanced poll lets voters setting negative vote for some choices</li>
+ <li>One choice poll</li>
+ </ul>
+ </td>
+ </tr>!-->
+ <input type='hidden' name='poll_type' value='M'/>
+ {% if not new %}{% if choices %}<tr>
+ <th>Choices</th><th>&nbsp;</th><th>Delete?</th>
+ </tr>
+ {% for choice in choices %}<tr>
+ <td>&nbsp;</td><td>{{choice.name}}</td><td><input type='checkbox' name='delete_{{choice.id}}'/></td>
+ </tr>
+ {% endfor %}{% endif %}<tr><td><label>New choice</label></td><td>{{choiceform}}</td></tr>
+ {% endif %}</table>
+ {% if new %}<input type='hidden' name='new' value='1'/>
+ <input type='submit' value='Create' />
+ {% else %}<input type='hidden' name='edit' value='1'/>
+ <input type='submit' value='Edit' />
+ {% endif %}</form>
+{% endblock %}
diff --git a/templates/main.html b/templates/main.html
new file mode 100644
index 0000000..b51e7fe
--- /dev/null
+++ b/templates/main.html
@@ -0,0 +1,8 @@
+{% extends "base.html" %}
+
+{% block content %}
+<h2><a href='edit/0'>Create a poll</a></h2>
+<p>Create a new sondage for take a decision, find a date for a meeting, etc.</p>
+
+{% endblock %}
+
diff --git a/templates/vote.html b/templates/vote.html
new file mode 100644
index 0000000..7890db4
--- /dev/null
+++ b/templates/vote.html
@@ -0,0 +1,40 @@
+{% extends "base.html" %}
+
+{% block content %}
+ <h2>{{poll_type_name}} - {{poll_name}}</h2>
+{% if error %}<p class='error'>{{ error }}</p>{% endif %}
+ <p>{{poll_desc}}</p>
+ <form method="post" action="{{base_url}}">
+ <table class='poll'>
+ <tr>
+ <td class='simple'></td>
+ <td class='simple'></td>
+ {% for choice in choices %}<th>{{choice.name}}</th>
+ {% endfor %}</tr>
+ {% for voter in voters %}<tr>{% ifequal current_voter_id voter.id %}
+ <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='vote_{{vote.id}}'{%ifequal vote.vote 1%} checked='checked'{%endifequal%}/></td>{%endfor%}
+ {%else%}<td class='simple'><a href='?voter={{voter.id}}'>Edit</a></td>
+ <td>{{voter.name}}</td>
+ {% for vote in voter.votes %}<td class='{%ifequal vote.vote 1%}OK{%else%}KO{%endifequal%}'>{% ifequal vote.vote 1%}Yes{%else%}No{%endifequal%}</td>
+ {%endfor%}
+ {%endifequal%}
+ </tr>{%endfor%}
+ {%if not current_voter_id%}
+ <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%}
+ </tr>
+ {%endif%}
+ <tr class='sum'>
+ <td class='simple'></td><th>Sum</th>
+ {% for sum in choices_sum %}<td>{{sum}}</td>
+ {% endfor %}
+ </tr>
+ </table>
+ <input type='submit' value='{%if current_voter_id%}Edit{%else%}Participate{%endif%}'/>
+ </form>
+{% endblock %}