Browse Source

Show Exemplary label at the top of comments

Previously, the little "Exemplary" badge was only being shown to people
that can view the reasons (generally, the comment author and admins).
The only indication to other users that the comment had been labeled as
Exemplary was the colored left border. This adds the label to the top
for all users, including a count if there are multiple.
merge-requests/55/head
Deimos 6 years ago
parent
commit
9b64d22daf
  1. 14
      tildes/tildes/templates/macros/comments.jinja2

14
tildes/tildes/templates/macros/comments.jinja2

@ -98,8 +98,8 @@
</div> </div>
{% endif %} {% endif %}
{% if (request.has_permission("view_exemplary_reasons", comment)
and comment.is_label_active("exemplary")) %}
{% if comment.is_label_active("exemplary") %}
{% if request.has_permission("view_exemplary_reasons", comment) %}
<details class="comment-exemplary-reasons"> <details class="comment-exemplary-reasons">
<summary><span class="label label-comment label-comment-exemplary">Exemplary</span> <summary><span class="label label-comment label-comment-exemplary">Exemplary</span>
<span class="comment-label-count">x{{ comment.label_counts["exemplary"] }}</span> <span class="comment-label-count">x{{ comment.label_counts["exemplary"] }}</span>
@ -110,6 +110,16 @@
{% endfor %} {% endfor %}
</ul> </ul>
</details> </details>
{% else %}
<ul class="comment-labels">
<li>
<span class="label label-comment label-comment-exemplary">Exemplary</span>
{% if comment.label_counts["exemplary"] > 1 %}
<span class="comment-label-count">x{{ comment.label_counts["exemplary"] }}</span>
{% endif %}
</li>
</ul>
{% endif %}
{% endif %} {% endif %}
{% if comment.label_counts and request.has_permission("view_labels", comment) %} {% if comment.label_counts and request.has_permission("view_labels", comment) %}

Loading…
Cancel
Save