From a0a14eac798deef5fe7dfd76874d6009524e75da Mon Sep 17 00:00:00 2001 From: fireworks88 Date: Mon, 23 Aug 2021 13:05:56 +0200 Subject: [PATCH] duwiuishsuehgdz --- files/classes/comment.py | 2 ++ files/templates/comments.html | 25 ++++++++++++++++++++++++- files/templates/submission.html | 3 ++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index 1016991bd..61b5002b1 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -172,6 +172,8 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing): return data + def award_count(self, kind) -> int: + return len([x for x in self.awards if x.kind == kind]) @property def json_core(self): diff --git a/files/templates/comments.html b/files/templates/comments.html index f99cc64a2..6ff2b3c26 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -15,7 +15,30 @@ {% if (c.is_banned or c.deleted_utc > 0 or c.is_blocking or c.is_blocked) and not (v and v.admin_level>0) and not (v and v.id==c.author_id) %} - +{% if c.award_count("gold") and not c.is_banned and not c.is_deleted %} + +{% endif %}
diff --git a/files/templates/submission.html b/files/templates/submission.html index 291dc73c5..ff8fbf59c 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -190,8 +190,9 @@ {% endif %} -{% if p.award_count("gold") %} + +{% if p.award_count("gold") %}