added submission of content
added more detailed poll view changed default settings to be more verbose
This commit is contained in:
parent
366b11d733
commit
81d84b3498
5 changed files with 91 additions and 15 deletions
|
@ -9,13 +9,47 @@
|
|||
</head>
|
||||
<body>
|
||||
<h1>Poll: ${poll.title}</h1>
|
||||
<ul>
|
||||
<li>Author: ${poll.author}</li>
|
||||
<li>Created: ${poll.get_creation_time_string()}</li>
|
||||
<li>Description: ${poll.description}</li>
|
||||
<li>URL: <a href="${poll.get_url()}" title="link of this poll">${poll.get_url()}</a></li>
|
||||
</ul>
|
||||
<div class="poll_summary">
|
||||
<ul>
|
||||
<li>Author: ${poll.author}</li>
|
||||
<li>Description: ${poll.description}</li>
|
||||
<li>Created: ${poll.get_creation_time_string()}</li>
|
||||
<li>Public URL: <a href="${poll.get_url()}" title="link of this poll">${poll.get_url()}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="poll_submit_form">
|
||||
<h2>Submit something</h2>
|
||||
<form action="${poll.get_submit_url()}" method="post">
|
||||
<ul>
|
||||
<li><label for="submitter">Submitter:</label><input type="text" id="submitter" name="submitter" />
|
||||
<span py:if="'submitter' in errors" class="error">${errors.submitter}</span></li>
|
||||
<li><label for="content">New content:</label><input type="text" id="content" name="content" />
|
||||
<span py:if="'content' in errors" class="error">${errors.content}</span></li>
|
||||
</ul>
|
||||
<input type="submit" name="submit" value="Submit" />
|
||||
</form>
|
||||
</div>
|
||||
<!-- previous submissions -->
|
||||
<div class="poll_submissions" py:if="poll.get_settings()['show_all_submissions']">
|
||||
<h2>Previous submissions</h2>
|
||||
<table py:if="poll.get_num_of_submissions() > 0">
|
||||
<tr><th>Submitter</th><th>Content</th><th>Timestamp</th></tr>
|
||||
<tr py:for="one_submission in poll.get_submissions()">
|
||||
<td>${one_submission.submitter}</td>
|
||||
<td>${one_submission.content}</td>
|
||||
<td>${one_submission.get_creation_time_string()}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<span py:if="poll.get_submissions().count() == 0">No submissions posted</span>
|
||||
</div>
|
||||
<!-- statistics -->
|
||||
<div class="poll_statistics" py:if="poll.get_settings()['show_all_submissions']">
|
||||
<h2>Statistics</h2>
|
||||
<ul>
|
||||
<li>Number of submitters: ${poll.get_num_of_submitters()}</li>
|
||||
<li>Number of submissions: ${poll.get_num_of_submissions()}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue