Parent: [79f62a] (diff)

Child: [3e449f] (diff)

Download this file

vote.html    23 lines (21 with data), 919 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
{% 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">
<ul>
<li class="{% if voted == 1 %}active{% endif %} {% if can_vote %}js-vote-up{% endif %}">
<b data-icon="+" class="ico ico-vote-up"></b>
</li>
<li class="{% if voted == -1 %}active{% endif %} {% if can_vote %}js-vote-down{% endif %}">
<b data-icon="+" class="ico ico-vote-down"></b>
</li>
</ul>
<span class="votes-up">{{ artifact.votes_up }}</span> up votes |
<span class="votes-down">{{ artifact.votes_down }}</span> down votes | <span class="votes-percent">100</span>%
<span class="comments fright">12 comments</span>
{% if can_vote %}
<form action="{{ action }}" method="POST">
{# csrf protection will be automatically inserted here (_session_id field) #}
</form>
{% endif %}
</div>