* Refactored and unified remove() methods and calls for greater flexibility as well as reliability * Added option to remove all comments by a user to Comment.remove() method and $Comment#delete skin * Added global #listItemFlag skin as well as listItemFlag_macro() for rendering vertically written text of items in a list view (e.g. closed) * Fixed bug in gettext_macro() and ngettext_macro() causing incorrect whitespace * Refactored timezone and locale handling * Modified automatic translation of untitled links in HopObject.link_macro() * Added honeypot to login and registration forms * Fixed client-side JavaScript to be evaluated when login or registration form is submitted, not only when the submit button is clicked * Removed redundant filter expression from DB mapping of Membership.images collection * Added Membership.content collection * Changed terminology from open to running polls, thus renaming Polls.open_action() method and Polls.open collection * Moved a lot of CSS used in root or administration sections from Site#stylesheet to $Root#stylesheet skin * Added Root.updateDomains() method (most likely already obsolete) * Removed Root.processHref() method (only necessary for very advanced setup) and obsolete comments * Fixed Root.xgettext() method to correctly read UTF-8 encoded data * Fixed Site.deleted_macro() to return the date object for late formatting * Refactored Site.processHref() for more convenient custom domain name mapping * Renamed Skins.advanced_action() method to Skins.all_action() * Removed redundant filter from Stories.comments collection * Removed unnecessary filter from Story.comments collection
120 lines
4 KiB
Text
120 lines
4 KiB
Text
<% #header %>
|
|
<div class="storyTitle"><% poll.question %></div>
|
|
<div class="small"><% poll.creator %>, <% poll.created %></div>
|
|
|
|
<% #footer %>
|
|
<p class="small">
|
|
<% poll.link edit prefix="... " %>
|
|
<% poll.link rotate prefix="... " %>
|
|
<% poll.link delete prefix="... " %>
|
|
</p>
|
|
|
|
<% #main %>
|
|
<% if <% param.header %> is true then <% poll.skin #header suffix=<br /> %> else
|
|
<% poll.question prefix='<div class="pollTitle">' suffix="</div> %> %>
|
|
<form method="post" action="<% poll.href %>">
|
|
<table border="0" cellspacing="2" cellpadding="2">
|
|
<% poll.loop skin="$Choice#main" %>
|
|
<tr>
|
|
<td colspan="2">
|
|
<br />
|
|
<button type="submit" name="vote" value="1"><% gettext Vote %></button>
|
|
<% poll.link result <% gettext "Results" %> %>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
<% poll.skin #footer %>
|
|
|
|
<% #results %>
|
|
<% if <% param.header %> is true then <% poll.skin #header %> else
|
|
<% poll.question prefix=<strong> suffix="</strong> %> %>
|
|
<% poll.loop skin="$Choice#result" %>
|
|
<div class="small"><br />
|
|
<% gettext Total suffix=: %>
|
|
<% ngettext "{0} vote" "{0} votes" <% poll.votes %> %>
|
|
<% if <% poll.status %> is open then "" else
|
|
<% if <% poll.closed %> is null then "" else
|
|
<% gettext "This poll was closed by {0} on {1}"
|
|
<% poll.modifier %> <% poll.closed short %> prefix="<br />" %>
|
|
%>
|
|
%>
|
|
</div>
|
|
<% poll.link . <% gettext "Add Your Vote %> prefix=<p> suffix=</p> %>
|
|
<% poll.skin #footer %>
|
|
|
|
<% #listItem %>
|
|
<a name="<% poll.id %>" id="<% poll.id %>"></a>
|
|
<div class="listSeparator"> </div>
|
|
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
|
<tr>
|
|
<% if <% poll.status %> is closed then
|
|
<% listItemFlag <% gettext closed %> %>
|
|
%>
|
|
<td colspan="3" class="small">
|
|
<strong><% gettext Macro suffix=: %></strong> <% poll.macro %>
|
|
<div class="ample"><strong><% gettext Status suffix=: %></strong>
|
|
<% ngettext "{0} vote" "{0} votes" <% poll.votes %> %>
|
|
</td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td>
|
|
<div class="storytitle"><% poll.question %></div>
|
|
<div class="storyDate"><% poll.creator link %>,
|
|
<% poll.created short %></div>
|
|
</td>
|
|
<td width="10" nowrap="nowrap"> </td>
|
|
<td align="right" class="small">
|
|
<% poll.link . <% gettext Vote %> prefix='<div class="nowrap">... ' suffix="</div>" %>
|
|
<% poll.link results prefix='<div class="nowrap">... ' suffix="</div>" %>
|
|
<% poll.link edit prefix='<div class="nowrap">... ' suffix="</div>" %>
|
|
<% poll.link rotate prefix='<div class="nowrap">... ' suffix="</div>" %>
|
|
<% poll.link delete prefix='<div class="nowrap">... ' suffix="</div>" %>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<% #edit %>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
var index = $(".choice").length + 1;
|
|
$("#add").click(function() {
|
|
var choice = $(".choice:last").clone();
|
|
choice.find(".small").text('<% gettext Choice %> #' + index + ':');
|
|
choice.find("input").attr("value", "");
|
|
$(".choice:last").after(choice);
|
|
$(".choice:last").find("input").focus();
|
|
index += 1;
|
|
return false;
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<p class="storyTitle"><% response.title %></p>
|
|
<form method="post" action="<% response.action %>">
|
|
<div class="small"><% gettext Question suffix=: %></div>
|
|
<div><% poll.input question cols="30" rows="3" class="formTitle" %></div>
|
|
<% poll.input choices %>
|
|
<div class="small">
|
|
<a href="" id="add"><% gettext "Add Choice" %></a>
|
|
</div>
|
|
<p class="small">
|
|
<% if <% poll.created %> then <% gettext "Created by {0} on {1}"
|
|
<% poll.creator %> <% poll.created short %> %> %>
|
|
<% if <% poll.created %> is <% poll.modified %> then "" else
|
|
<% gettext "Last modified by {0} on {1}" <% poll.modifier link %>
|
|
<% poll.modified short %> prefix="<br />" %>
|
|
%>
|
|
</p>
|
|
<br />
|
|
<div>
|
|
<button type="submit" name="save" value="<% poll.status default=closed %>">
|
|
<% gettext Save %>
|
|
</button>
|
|
<% if <% poll.status %> is open then "" else
|
|
<% gettext "Save and Run" prefix='<button type="submit"
|
|
name="save" value="open"><strong>' suffix=</strong></button> %>
|
|
%>
|
|
<a href="" class="cancel"><% gettext Cancel %></a>
|
|
</div>
|
|
</form>
|