diff --git a/files/classes/comment.py b/files/classes/comment.py index 026af6cbcb..0af8e52f7b 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -449,12 +449,12 @@ class Comment(Base): return body @lazy - def collapse_for_user(self, v, comment_info, path=''): + def collapse_for_user(self, v, focused_comment, path=''): if v and self.author_id == v.id: return False if path == '/admin/removed/comments': return False - if comment_info: return False + if focused_comment: return False if self.nsfw and not (any(path.startswith(x) for x in ('/post/','/comment/','/h/')) and self.post.nsfw) and not g.show_nsfw: return True diff --git a/files/routes/comments.py b/files/routes/comments.py index 13e165cac9..58b2d5ec8c 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -65,7 +65,7 @@ def post_pid_comment_cid(cid, v, pid=None, anything=None, hole=None): try: context = min(int(request.values.get("context", 8)), 8) except: context = 8 - comment_info = comment + focused_comment = comment c = comment if post.new: defaultsortingcomments = 'new' @@ -95,7 +95,7 @@ def post_pid_comment_cid(cid, v, pid=None, anything=None, hole=None): else: if post.is_banned and not (v and (v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or post.author_id == v.id)): template = "post_banned.html" else: template = "post.html" - return render_template(template, v=v, p=post, sort=sort, comment_info=comment_info, render_replies=True, hole=post.hole_obj) + return render_template(template, v=v, p=post, sort=sort, focused_comment=focused_comment, render_replies=True, hole=post.hole_obj) @app.post("/comment") @limiter.limit('1/second', scope=rpath) diff --git a/files/routes/users.py b/files/routes/users.py index 72e62a97bc..45ece6aa66 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -908,7 +908,7 @@ def u_username_wall_comment(v, username, cid): try: context = min(int(request.values.get("context", 8)), 8) except: context = 8 - comment_info = comment + focused_comment = comment c = comment while context and c.level > 1: c = c.parent_comment @@ -922,7 +922,7 @@ def u_username_wall_comment(v, username, cid): if v and v.client: return top_comment.json - return render_template("userpage/wall.html", u=u, v=v, listing=[top_comment], page=1, is_following=is_following, standalone=True, render_replies=True, wall=True, comment_info=comment_info, total=1) + return render_template("userpage/wall.html", u=u, v=v, listing=[top_comment], page=1, is_following=is_following, standalone=True, render_replies=True, wall=True, focused_comment=focused_comment, total=1) @app.get("/@/posts") @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400) diff --git a/files/templates/comments.html b/files/templates/comments.html index fdca6289f7..dd09b07d3e 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -1,7 +1,7 @@ {%- import 'util/macros.html' as macros with context -%} {% if not request.headers.get("xhr") %} - {% if comment_info %} - + {% if focused_comment %} + {% endif %} {% if v %} @@ -24,7 +24,7 @@ {% endif %} {% if (c.is_banned or c.deleted_utc) and not (v and v.admin_level >= PERMS['POST_COMMENT_MODERATION']) and not (v and v.id == c.author_id) %} -
+
@@ -127,12 +127,12 @@ {% set isreply = False %} {% endif %} -
+
{% if not isreply %} {% endif %}
-
+