Browse Source

Show Exemplary badge on labeled comments

This starts showing the Exemplary badge to all users again (but only the
author can see the count still).

It also changes the "priority" of the .is-comment-exemplary and
.is-comment-new classes so that the stripe will show the new color when
a comment is both new and exemplary.
merge-requests/126/merge
Deimos 4 years ago
parent
commit
f8f7a96431
  1. 12
      tildes/scss/themes/_theme_base.scss
  2. 26
      tildes/tildes/templates/macros/comments.jinja2

12
tildes/scss/themes/_theme_base.scss

@ -645,6 +645,12 @@ body {
border-left-color: var(--stripe-mine);
}
.is-comment-exemplary {
> .comment-itself {
border-left-color: var(--comment-label-exemplary);
}
}
.is-comment-new {
> .comment-itself {
border-left-color: var(--alert);
@ -655,12 +661,6 @@ body {
}
}
.is-comment-exemplary {
> .comment-itself {
border-left-color: var(--comment-label-exemplary);
}
}
.is-message-mine,
.is-topic-mine {
border-left-color: var(--stripe-mine);

26
tildes/tildes/templates/macros/comments.jinja2

@ -103,17 +103,21 @@
<div class="comment-votes">{{ pluralize(comment.num_votes, "vote") }}</div>
{% endif %}
{% if comment.is_label_active("exemplary") and request.has_permission("view_exemplary_reasons", comment) %}
<details class="comment-exemplary-reasons">
<summary><span class="label label-comment label-comment-exemplary">Exemplary</span>
<span class="comment-label-count">x{{ comment.label_counts["exemplary"] }}</span>
</summary>
<ul>
{% for label in comment.labels if label.name == "exemplary" %}
<li>"{{ label.reason }}"</li>
{% endfor %}
</ul>
</details>
{% if comment.is_label_active("exemplary") %}
{% if request.has_permission("view_exemplary_reasons", comment) %}
<details class="comment-exemplary-reasons">
<summary><span class="label label-comment label-comment-exemplary">Exemplary</span>
<span class="comment-label-count">x{{ comment.label_counts["exemplary"] }}</span>
</summary>
<ul>
{% for label in comment.labels if label.name == "exemplary" %}
<li>"{{ label.reason }}"</li>
{% endfor %}
</ul>
</details>
{% else %}
<ul class="comment-labels"><li class="label label-comment label-comment-exemplary">Exemplary</li></ul>
{% endif %}
{% endif %}
{% if comment.label_counts and request.has_permission("view_labels", comment) %}

Loading…
Cancel
Save