From 0299a287ed68d1bc9af0a40edec41da5ef323028 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 24 Dec 2022 21:19:47 +0200 Subject: [PATCH] Revert "remove #context in links" This reverts commit 169dc4ebef3ba661df23b1557be7973ed106a023. --- files/classes/comment.py | 6 +++--- files/classes/mod_logs.py | 2 +- files/classes/sub_logs.py | 2 +- files/routes/awards.py | 2 +- files/routes/comments.py | 4 ++-- files/routes/subs.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index f176955cb..f0cbbcacc 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -160,8 +160,8 @@ class Comment(Base): @lazy def shortlink(self): if self.wall_user_id: - return f"/@{self.wall_user.username}/wall/comment/{self.id}" - return f"{self.post.shortlink}/{self.id}" + return f"/@{self.wall_user.username}/wall/comment/{self.id}#context" + return f"{self.post.shortlink}/{self.id}#context" @property @lazy @@ -176,7 +176,7 @@ class Comment(Base): @property @lazy def morecomments(self): - return f"{self.post.permalink}/{self.id}?context=0" + return f"{self.post.permalink}/{self.id}?context=0#context" @property @lazy diff --git a/files/classes/mod_logs.py b/files/classes/mod_logs.py index 450ea6e94..8419a5528 100644 --- a/files/classes/mod_logs.py +++ b/files/classes/mod_logs.py @@ -59,7 +59,7 @@ class ModAction(Base): if self.target_user: return f'{self.target_user.username}' elif self.target_post: return censor_slurs(f'{self.target_post.title_html}', None) - elif self.target_comment_id: return f'comment' + elif self.target_comment_id: return f'comment' @property @lazy diff --git a/files/classes/sub_logs.py b/files/classes/sub_logs.py index 4861178e7..ef6840aee 100644 --- a/files/classes/sub_logs.py +++ b/files/classes/sub_logs.py @@ -51,7 +51,7 @@ class SubAction(Base): if self.target_user: return f'{self.target_user.username}' elif self.target_post: return censor_slurs(f'{self.target_post.title_html}', None) - elif self.target_comment_id: return f'comment' + elif self.target_comment_id: return f'comment' @property @lazy diff --git a/files/routes/awards.py b/files/routes/awards.py index 415442e68..745f253e9 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -218,7 +218,7 @@ def award_thing(v, thing_type, id): link = f"/{thing_type}/{thing.id}" link2 = link if thing_type == 'comment': - link2 += '' + link2 += '#context' ban_reason = f'1-Day ban award used by @{v.username} on {link}' if not author.is_suspended: author.ban(reason=ban_reason, days=1) diff --git a/files/routes/comments.py b/files/routes/comments.py index 1f18f8aaa..35024485a 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -309,9 +309,9 @@ def comment(v:User): else: notifbody = c.body if posting_to_submission: - url = f'{SITE_FULL}/comment/{c.id}?read=true' + url = f'{SITE_FULL}/comment/{c.id}?read=true#context' else: - url = f'{SITE_FULL}/@{c.wall_user.username}/wall/comment/{c.id}?read=true' + url = f'{SITE_FULL}/@{c.wall_user.username}/wall/comment/{c.id}?read=true#context' push_notif(parent_user.id, title, notifbody, url) diff --git a/files/routes/subs.py b/files/routes/subs.py index ce336a1b4..e45663066 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -65,7 +65,7 @@ def exile_comment(v:User, cid): kind='exile_user', user_id=v.id, target_user_id=u.id, - _note=f'for comment' + _note=f'for comment' ) g.db.add(ma)