From 5f968f0006779401a215ffdc091d68ac22602601 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 5 Aug 2023 13:08:19 +0300 Subject: [PATCH] never collapse when #context is in the url (so page jumping to highlighted comment actually works) (sometimes the highlighted comment would be a child of a collapsed comment which prevents jumping) --- files/classes/comment.py | 4 ++-- files/templates/comments.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index 993c8b608..39af182c8 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -381,12 +381,12 @@ class Comment(Base): return body @lazy - def collapse_for_user(self, v, path=''): + def collapse_for_user(self, v, comment_info, path=''): if v and self.author_id == v.id: return False if path == '/admin/removed/comments': return False - if path.endswith(f'/{self.id}'): return False + if comment_info: return False if self.over_18 and not (v and v.over_18) and not (any(path.startswith(x) for x in ('/post/','/comment/','/h/')) and self.post.over_18): return True diff --git a/files/templates/comments.html b/files/templates/comments.html index 75a76a7e7..163120f68 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -113,7 +113,7 @@ {% set isreply = False %} {% endif %} -
+
{% if not isreply %} {% endif %}