antville/code/Poll/$Poll.skin

123 lines
4.9 KiB
Text
Raw Normal View History

<% #listItem %>
<tr>
<td class='uk-text-right'><% poll.votes %></td>
<td class='uk-width-1-2 av-overflow'>
<% poll.question | stripTags | poll.link %>
</td>
<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>
<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>
<td class='uk-text-right uk-text-nowrap'>
<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>
<% poll.link delete "<i class='uk-icon-trash-o'></i>" %>
<% poll.link edit "<i class='uk-icon-pencil'></i>" %>
</td>
</tr>
<% #header %>
2014-12-17 23:51:00 +01:00
<h1><% poll.question | stripTags %></h1>
<div class='uk-article-meta uk-margin-bottom'>
<% gettext "Posted by {0} on {1}" <% poll.creator %> <% poll.created short %> %>
2014-12-17 23:51:00 +01:00
</div>
<% #footer %>
2014-12-17 23:51:00 +01:00
<div class='uk-margin-top'>
<% poll.link edit <% gettext Edit %> class='uk-button' %>
2014-12-17 23:51:00 +01:00
</div>
<% #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 %>
<div class='uk-margin-bottom'>
<% if <% poll.status %> is open then
<% poll.skin $Poll#open title=<% poll.question %> %>
else
<% poll.skin $Poll#closed title=<% poll.question %> %>
%>
<% poll.source %>
2015-01-07 17:16:11 +01:00
</div>
<% #open %>
<form class='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>
</form>
2015-01-07 17:16:11 +01:00
<% #closed %>
<div class='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" %>
<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' %> %>
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>' %>
%> %>
2014-12-17 23:51:00 +01:00
</div>
</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>
<div class='uk-article-meta'><% poll.skin $HopObject#meta %></div>
<form class='uk-margin-top uk-form uk-form-stacked' method="post" action="<% response.action %>" x-data='{ counter: 2 }'>
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'>
<% poll.input question class=uk-width-1-1 %>
2014-12-17 23:51:00 +01:00
</div>
</div>
<fieldset class='uk-margin-top'>
<legend><% gettext Choices %></legend>
<% poll.input choices %>
<div class='uk-text-small uk-form-row' id='av-add-choice' hidden :hidden='false'>
<a href='javascript:' @click='const choice = document.querySelectorAll(".av-choice")[counter - 1]; const clone = choice.cloneNode(true); counter += 1; clone.querySelector(".uk-form-label").innerText = "#" + counter; const input = clone.querySelector("input"); input.value = ""; choice.insertAdjacentElement("afterEnd", clone); input.focus();'>
<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>
<div class='uk-form-row'>
<% 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
<% 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' %>
<a href='.' class='uk-button uk-button-link'><% gettext Cancel %></a>
2014-12-17 23:51:00 +01:00
</div>
</form>