<%def name="votes(poll)">
<%
tally = poll.tally
num_votes = len(tally)
url = h.entity_url(poll, member='votes')
if check.poll.show(poll):
    tpl = _('A total of <a href="%(url)s">%(votes)s votes</a>, thereof %(for)s ayes and %(against)s nays')
else:
    tpl = _('A total of %(votes)s votes, thereof %(for)s ayes and %(against)s nays')
para = tpl % {'url': url, 'for': tally.num_for, 'against': tally.num_against, 'votes': num_votes}
%>

<h6>${_('Votes')}</h6>
<p>
    ${para|n}
</p>

</%def>

<%def name="votedetail(vd)">
%if vd:
<h6>${_('Votes by User Group')}</h6>
<dl class="votedetail">
%for v in vd:
	<dt>${v['badge']['title']}</dt>
	<dd><span class="num_for">${v['tally']['num_for']}</span> : <span class="num_against">${v['tally']['num_against']}</span></dd>
%endfor
</dl>
%endif
</%def>

<%def name="shortlink(delegateable)">
<%
shortlink = h.site.shortlink_url(delegateable)
%>

<h6>${_('Shortlink')}</h6>
<p><a href="${shortlink}">${shortlink}</a></p>

</%def>
