{% 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>
