2014-12-21 17:20:22 +01:00
|
|
|
<% #listItem %>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class='uk-text-right'><% poll.votes %></td>
|
2015-01-11 13:06:50 +01:00
|
|
|
<td class='uk-width-1-2 av-overflow'>
|
2014-12-21 17:20:22 +01:00
|
|
|
<% poll.question | stripTags | poll.link %>
|
|
|
|
|
</td>
|
2015-01-11 13:18:11 +01:00
|
|
|
<td class='uk-text-truncate'><% poll.creator %></td>
|
|
|
|
|
<td class='uk-text-truncate' title='<% poll.modified short %>' data-uk-tooltip="{pos: 'top-left'}">
|
|
|
|
|
<% poll.modified text %>
|
|
|
|
|
</td>
|
2014-12-21 17:20:22 +01:00
|
|
|
<td class='uk-text-right'>
|
|
|
|
|
<% poll.link status <% if <% poll.status %> is open then "<i class='uk-icon-unlock'></i>" else "<i class='uk-icon-lock'></i>" %> %>
|
|
|
|
|
</td>
|
2015-01-11 13:06:50 +01:00
|
|
|
<td class='uk-text-right uk-text-nowrap'>
|
2015-02-22 14:36:00 +01:00
|
|
|
<a href='javascript:' class='av-clipboard-copy' data-text='<% gettext 'Press CTRL & C to copy to clipboard.' %>' data-value="<% poll.macro %>"><i class='uk-icon-clipboard'></i></a>
|
2014-12-21 17:20:22 +01:00
|
|
|
<% poll.link delete "<i class='uk-icon-trash-o'></i>" %>
|
|
|
|
|
<% poll.link edit "<i class='uk-icon-pencil'></i>" %>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
2009-12-13 21:54:58 +00:00
|
|
|
<% #header %>
|
2014-12-17 23:51:00 +01:00
|
|
|
<h1><% poll.question | stripTags %></h1>
|
|
|
|
|
<div class='uk-article-meta'>
|
2014-12-21 17:20:22 +01:00
|
|
|
<% gettext "Posted by {0} on {1}" <% poll.creator %> <% poll.created short %> %>
|
2014-12-17 23:51:00 +01:00
|
|
|
</div>
|
2009-12-13 21:54:58 +00:00
|
|
|
|
|
|
|
|
<% #footer %>
|
2014-12-17 23:51:00 +01:00
|
|
|
<div class='uk-margin-top'>
|
2014-12-21 17:20:22 +01:00
|
|
|
<% poll.link edit <% gettext Edit %> class='uk-button' %>
|
2014-12-17 23:51:00 +01:00
|
|
|
</div>
|
2009-12-13 21:54:58 +00:00
|
|
|
|
2007-10-09 15:09:06 +00:00
|
|
|
<% #main %>
|
2015-01-07 17:16:11 +01:00
|
|
|
<% poll.skin #header %>
|
|
|
|
|
<% poll.skin #open %>
|
|
|
|
|
<% poll.skin #footer %>
|
|
|
|
|
|
|
|
|
|
<% #results %>
|
|
|
|
|
<% poll.skin #header %>
|
|
|
|
|
<% poll.skin #closed %>
|
|
|
|
|
<% poll.skin #footer %>
|
|
|
|
|
|
|
|
|
|
<% #embed %>
|
|
|
|
|
<% if <% poll.status %> is open then
|
|
|
|
|
<% poll.skin $Poll#open title=<% poll.question %> %>
|
2014-12-17 23:51:00 +01:00
|
|
|
else
|
2015-01-07 17:16:11 +01:00
|
|
|
<% poll.skin $Poll#closed title=<% poll.question %> %>
|
2014-12-17 23:51:00 +01:00
|
|
|
%>
|
2015-01-07 17:16:11 +01:00
|
|
|
<div class='uk-text-right uk-text-small uk-text-muted'>
|
|
|
|
|
<% gettext Source suffix=<% poll.link . <% poll.site.title %> prefix=': ' %> %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<% #open %>
|
2014-12-17 23:51:00 +01:00
|
|
|
<form class='uk-margin-top uk-panel uk-panel-box uk-form uk-form-stacked' method="post" action="<% poll.href %>">
|
2015-01-07 17:16:11 +01:00
|
|
|
<% param.title prefix="<h1 class='uk-panel-title'>" suffix=</h1> %>
|
2014-12-17 23:51:00 +01:00
|
|
|
<% poll.loop skin="$Choice#main" %>
|
|
|
|
|
<div class='uk-margin-top'>
|
|
|
|
|
<button class='uk-button uk-button-primary' type="submit" id="submit" name="submit" value="1">
|
|
|
|
|
<% gettext Vote %>
|
|
|
|
|
</button>
|
|
|
|
|
<% poll.link result <% gettext "Results" %> class='uk-button uk-button-link' %>
|
|
|
|
|
</div>
|
2007-10-09 15:09:06 +00:00
|
|
|
</form>
|
|
|
|
|
|
2015-01-07 17:16:11 +01:00
|
|
|
<% #closed %>
|
2014-12-17 23:51:00 +01:00
|
|
|
<div class='uk-margin-top uk-panel uk-panel-box'>
|
2015-01-07 17:16:11 +01:00
|
|
|
<% param.title prefix="<h1 class='uk-panel-title'>" suffix=</h1> %>
|
2014-12-17 23:51:00 +01:00
|
|
|
<% poll.loop skin="$Choice#result" %>
|
2015-01-11 13:06:50 +01:00
|
|
|
<div class='uk-float-left'>
|
2014-12-17 23:51:00 +01:00
|
|
|
<strong><% gettext Total suffix=: %></strong>
|
|
|
|
|
<% ngettext "{0} vote" "{0} votes" <% poll.votes %> %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class='uk-text-right'>
|
|
|
|
|
<% if <% poll.status %> is open then
|
2015-01-07 17:16:11 +01:00
|
|
|
<% poll.link main <% gettext 'Add Your Vote' %> %>
|
2015-02-22 14:38:10 +01:00
|
|
|
else <% if <% poll.closed %> is null then '' else
|
2015-01-01 20:57:11 +01:00
|
|
|
<% gettext "This poll was closed {0} by {1}" <% poll.closed text %> <% poll.modifier %> prefix="<span class='uk-text-muted'>" suffix='</span>' %>
|
2015-02-22 14:38:10 +01:00
|
|
|
%> %>
|
2014-12-17 23:51:00 +01:00
|
|
|
</div>
|
2007-10-09 15:09:06 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<% #edit %>
|
2014-12-17 23:51:00 +01:00
|
|
|
<h1>
|
|
|
|
|
<% response.title %>
|
|
|
|
|
<% poll.link . ' ' class='uk-icon-button uk-icon-link uk-text-middle' %>
|
|
|
|
|
</h1>
|
2015-01-06 14:03:44 +01:00
|
|
|
<div class='uk-article-meta'><% poll.skin $HopObject#meta %></div>
|
2014-12-21 17:20:22 +01:00
|
|
|
<form class='uk-margin-top uk-form uk-form-stacked' method="post" action="<% response.action %>">
|
2014-12-17 23:51:00 +01:00
|
|
|
<div class='uk-form-row'>
|
|
|
|
|
<div class='uk-form-label'><% gettext Question %></div>
|
|
|
|
|
<div class='uk-form-controls'>
|
2015-02-22 14:36:00 +01:00
|
|
|
<% poll.input question class=uk-width-1-1 %>
|
2014-12-17 23:51:00 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2015-02-22 14:36:00 +01:00
|
|
|
<fieldset class='uk-margin-top'>
|
|
|
|
|
<legend><% gettext Choices %></legend>
|
2014-12-17 23:51:00 +01:00
|
|
|
<% poll.input choices %>
|
2015-02-21 19:21:35 +01:00
|
|
|
<div class='uk-text-small uk-form-row uk-hidden' id='av-add-choice'>
|
|
|
|
|
<a href='javascript:'>
|
2014-12-17 23:51:00 +01:00
|
|
|
<i class='uk-icon-plus'></i>
|
|
|
|
|
<% gettext "Add Choice" %>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
2015-02-22 14:37:32 +01:00
|
|
|
</fieldset>
|
2014-12-17 23:51:00 +01:00
|
|
|
<fieldset class='uk-margin-top'>
|
|
|
|
|
<legend><% gettext Information %></legend>
|
2014-12-21 17:20:22 +01:00
|
|
|
<div class='uk-form-row'>
|
2015-02-21 19:21:35 +01:00
|
|
|
<% poll.macro | link <% poll.href %> data-value=<% poll.macro %> data-text=<% gettext "Press CTRL & C to copy to clipboard." %> class='av-clipboard-copy' %>
|
2014-12-17 23:51:00 +01:00
|
|
|
</div>
|
|
|
|
|
</fieldset>
|
|
|
|
|
<div class='uk-margin-top'>
|
|
|
|
|
<button class='uk-button uk-button-primary' type="submit" name="save" value="<% poll.status default=closed %>">
|
|
|
|
|
<% gettext Save %>
|
|
|
|
|
</button>
|
2015-01-07 17:16:11 +01:00
|
|
|
<% if <% poll.status %> is open then
|
2015-01-11 13:06:50 +01:00
|
|
|
<% poll.link status <% gettext Stop %> class='uk-button uk-button-danger' %>
|
2015-01-07 17:16:11 +01:00
|
|
|
else
|
2014-12-17 23:51:00 +01:00
|
|
|
<% gettext "Save and Run" prefix="<button class='uk-button uk-button-success' type='submit' name='save' value='open'>" suffix=</button> %>
|
|
|
|
|
%>
|
|
|
|
|
<% poll.link delete <% gettext Delete %> class='uk-button' %>
|
2015-01-04 13:27:32 +01:00
|
|
|
<a href='.' class='uk-button uk-button-link'><% gettext Cancel %></a>
|
2014-12-17 23:51:00 +01:00
|
|
|
</div>
|
|
|
|
|
</form>
|
2007-10-09 15:09:06 +00:00
|
|
|
<script type="text/javascript">
|
2015-02-21 19:21:35 +01:00
|
|
|
$('.av-choice:last').remove();
|
|
|
|
|
var index = $(".av-choice").length + 1;
|
|
|
|
|
$("#av-add-choice").removeClass('uk-hidden').find('a').on('click', function (event) {
|
2012-05-12 13:52:38 +00:00
|
|
|
event.preventDefault();
|
2015-02-21 19:21:35 +01:00
|
|
|
var choice = $(".av-choice:last").clone();
|
2014-12-17 23:51:00 +01:00
|
|
|
choice.find(".uk-form-label").text('#' + index);
|
|
|
|
|
choice.find("input").attr("value", '');
|
2015-02-21 19:21:35 +01:00
|
|
|
$(".av-choice:last").after(choice);
|
|
|
|
|
$(".av-choice:last").find("input").focus();
|
2007-10-09 15:09:06 +00:00
|
|
|
index += 1;
|
|
|
|
|
});
|
|
|
|
|
</script>
|