Revert "remove #context in links"

This reverts commit 169dc4ebef.
pull/83/head
Aevann 2022-12-24 21:19:47 +02:00
parent 2e0a0b5fc6
commit 0299a287ed
6 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -59,7 +59,7 @@ class ModAction(Base):
if self.target_user: return f'<a href="{self.target_user.url}">{self.target_user.username}</a>'
elif self.target_post:
return censor_slurs(f'<a href="{self.target_post.permalink}">{self.target_post.title_html}</a>', None)
elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}">comment</a>'
elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}#context">comment</a>'
@property
@lazy

View File

@ -51,7 +51,7 @@ class SubAction(Base):
if self.target_user: return f'<a href="{self.target_user.url}">{self.target_user.username}</a>'
elif self.target_post:
return censor_slurs(f'<a href="{self.target_post.permalink}">{self.target_post.title_html}</a>', None)
elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}">comment</a>'
elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}#context">comment</a>'
@property
@lazy

View File

@ -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 <a href="/@{v.username}">@{v.username}</a> on <a href="{link2}">{link}</a>'
if not author.is_suspended:
author.ban(reason=ban_reason, days=1)

View File

@ -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)

View File

@ -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 <a href="/comment/{c.id}">comment</a>'
_note=f'for <a href="/comment/{c.id}#context">comment</a>'
)
g.db.add(ma)