Parent: [840d74] (diff)

Child: [cd6847] (diff)

Download this file

vote.html    18 lines (16 with data), 802 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{% set can_vote = c.user and c.user != c.user.anonymous()
and h.has_access(artifact, 'post')() %}
{% set voted = artifact.user_voted(c.user) %}
<div id="vote" class="info message">
Vote for this ticket:
<br />
<span class='vote-uparrow {% if can_vote %}vote-up{% endif %}'>&uArr;</span>
<span id='votes-up' class='votes-up {% if voted == 1 %}voted{% endif %}'>{{artifact.votes_up}}</span> up&nbsp;
<span class='vote-downarrow {% if can_vote %}vote-down{% endif %}'>&dArr;</span>
<span id='votes-down' class='votes-down {% if voted == -1 %}voted{% endif %}'>{{artifact.votes_down}}</span> down
{% if can_vote %}
<form action="{{ action }}" method="POST">
{# csrf protection will be automatically inserted here (_session_id field) #}
</form>
{% endif %}
</div>