home » zplus/freepost.git
ID: 3288e0fa7ce15c5d867879523acbb9647136d02a
20 lines — 888B — View raw


{# Template for up/down vote arrows.
 # This template expects these inputs
 # 
 #     - target: ('post', 'comment')
 #     - hash_id: the post/comment hashId
 #     - vote: (optional) the vote already cast by current logged in user
 #     - vote_count: the sum of votes for this post/comment
 #}

<span class="vote">
    <a href="vote?up&{{ target }}={{ hash_id }}" target="vote_sink" class="{{ vote is defined and vote == 1 ? 'upvoted' }}" onclick="vote ('up', this.parentNode)">
        <img title="bump" alt="bump" src="images/upvote.png" />
    </a>

    {# Show number of votes #}
    <span class="count">{{ vote_count }}</span>

    <a href="vote?down&{{ target }}={{ hash_id }}" target="vote_sink" class="{{ vote is defined and vote == -1 ? 'downvoted' }}" onclick="vote ('down', this.parentNode)">
        <img title="sink" alt="sink" src="images/downvote.png" />
    </a>
</span>