<%def name="widget(tile, poll, cls='', deactivated=False, delegate_url=None, need_auth=False)"> ## cls='' -> normal (small) vote widget. ## cls='big' -> big vote widget ## styles: /static/stylesheets/screen/content.css ## deactivated: Should the widget be deactivated? (e.g. out of the voting phase) ## need_auth: Redirect user to login page. ## FIXME: Render vote_up/vote_down as span's if the user already has that ## position. ## FIXME: Render the vote_count as a link to the votes listing <% pro = tile.widget_action_attrs(model.Vote.YES) con = tile.widget_action_attrs(model.Vote.NO) %>
%if tile.can_show: ${tile.display_score}${tile.display_score}  
%if delegate_url: ${_('or:')} ${_('delegate')} %endif
<%def name="booth(tile, poll)">

${_("Poll")}

%if can.poll.vote(poll):
${h.field_token()|n} %endif <% agents = tile.delegates_result(1) %> %if len(agents): %endif <% agents = tile.delegates_result(-1) %> %if len(agents): %endif <% agents = tile.delegates_result(0) %> %if len(agents): %endif
${_("Option")} ${_("Votes")} ${_("Percent")}
%if can.poll.vote(poll): %endif   ${_("Affirm")} ${poll.tally.num_for} ${tile.result_affirm}%
    %for agent in agents:
  • ${h.user.link(agent)|n}
  • %endfor
%if can.poll.vote(poll): %endif   ${_("Dissent")} ${poll.tally.num_against} ${tile.result_dissent}%
    %for agent in agents:
  • ${h.user.link(agent)|n}
  • %endfor
%if can.poll.vote(poll): %endif   ${_("Abstain")} ${poll.tally.num_abstain}  
    %for agent in agents:
  • ${h.user.link(agent)|n}
  • %endfor
%if can.poll.vote(poll): %endif ${_("%d votes") % len(poll.tally)}
%if can.poll.vote(poll):
%endif
%if poll.has_ended(): ${_("ended %s") % h.datetime_tag(tile.poll.end_time)|n} %else: ${_("began %s") % h.datetime_tag(tile.poll.begin_time)|n} %endif %if poll.can_end() and h.has_permission('poll.abort'): ยท ${_("cancel")} %endif
<%def name="row(tile, poll)">
  • %if not poll.end_time: ${_("no enddate")} %else: ${h.countdown_time(tile.poll.end_time, 0)} %endif
    ${poll.scope.title}