|
|
@ -183,16 +183,27 @@ |
|
|
|
<div class="topic-voting"> |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
{# Hide voting from the topic's author if it has zero votes #} |
|
|
|
{% if request.user != topic.user or topic.num_votes > 0 %} |
|
|
|
<span class="topic-voting-votes">{{ topic.num_votes }}</span> |
|
|
|
<span class="topic-voting-label"> |
|
|
|
{% trans num_votes=topic.num_votes %} |
|
|
|
vote |
|
|
|
{% pluralize %} |
|
|
|
votes |
|
|
|
{% endtrans %} |
|
|
|
</span> |
|
|
|
{# Hide voting from the topic's author if it has zero votes, or the author has vote counts turned off #} |
|
|
|
{# For other users, also hide vote count if turned off, but still show the vote button #} |
|
|
|
{% if request.user != topic.user or (request.user == topic.user and topic.num_votes > 0 and request.user.show_vote_counts) %} |
|
|
|
{% if request.user.show_vote_counts %} |
|
|
|
<span class="topic-voting-votes">{{ topic.num_votes }}</span> |
|
|
|
<span class="topic-voting-label"> |
|
|
|
{% trans num_votes=topic.num_votes %} |
|
|
|
vote |
|
|
|
{% pluralize %} |
|
|
|
votes |
|
|
|
{% endtrans %} |
|
|
|
</span> |
|
|
|
{% else %} |
|
|
|
<span class="topic-voting-label count-hidden"> |
|
|
|
{% if topic.user_voted %} |
|
|
|
Voted |
|
|
|
{% else %} |
|
|
|
Vote |
|
|
|
{% endif %} |
|
|
|
</span> |
|
|
|
{% endif %} |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
{% if request.has_permission('vote', topic) %} |
|
|
|