remove #context in links

master
Aevann1 2022-12-20 05:05:13 +02:00
parent ea322e4c20
commit 169dc4ebef
6 changed files with 9 additions and 9 deletions

View File

@ -160,8 +160,8 @@ class Comment(Base):
@lazy @lazy
def shortlink(self): def shortlink(self):
if self.wall_user_id: if self.wall_user_id:
return f"/@{self.wall_user.username}/wall/comment/{self.id}#context" return f"/@{self.wall_user.username}/wall/comment/{self.id}"
return f"{self.post.shortlink}/{self.id}#context" return f"{self.post.shortlink}/{self.id}"
@property @property
@lazy @lazy
@ -176,7 +176,7 @@ class Comment(Base):
@property @property
@lazy @lazy
def morecomments(self): def morecomments(self):
return f"{self.post.permalink}/{self.id}?context=0#context" return f"{self.post.permalink}/{self.id}?context=0"
@property @property
@lazy @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>' if self.target_user: return f'<a href="{self.target_user.url}">{self.target_user.username}</a>'
elif self.target_post: elif self.target_post:
return censor_slurs(f'<a href="{self.target_post.permalink}">{self.target_post.title_html}</a>', None) 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}#context">comment</a>' elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}">comment</a>'
@property @property
@lazy @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>' if self.target_user: return f'<a href="{self.target_user.url}">{self.target_user.username}</a>'
elif self.target_post: elif self.target_post:
return censor_slurs(f'<a href="{self.target_post.permalink}">{self.target_post.title_html}</a>', None) 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}#context">comment</a>' elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}">comment</a>'
@property @property
@lazy @lazy

View File

@ -218,7 +218,7 @@ def award_thing(v, thing_type, id):
link = f"/{thing_type}/{thing.id}" link = f"/{thing_type}/{thing.id}"
link2 = link link2 = link
if thing_type == 'comment': if thing_type == 'comment':
link2 += '#context' link2 += ''
ban_reason = f'1-Day ban award used by <a href="/@{v.username}">@{v.username}</a> on <a href="{link2}">{link}</a>' 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: if not author.is_suspended:
author.ban(reason=ban_reason, days=1) author.ban(reason=ban_reason, days=1)

View File

@ -310,9 +310,9 @@ def comment(v:User):
if len(c.body) > PUSH_NOTIF_LIMIT: notifbody = c.body[:PUSH_NOTIF_LIMIT] + '...' if len(c.body) > PUSH_NOTIF_LIMIT: notifbody = c.body[:PUSH_NOTIF_LIMIT] + '...'
else: notifbody = c.body else: notifbody = c.body
url = f'{SITE_FULL}/comment/{c.id}?read=true#context' url = f'{SITE_FULL}/comment/{c.id}?read=true'
if not posting_to_submission: if not posting_to_submission:
url = f'{SITE_FULL}/@{c.wall_user.username}/wall/comment/{c.id}?read=true#context' url = f'{SITE_FULL}/@{c.wall_user.username}/wall/comment/{c.id}?read=true'
push_notif(parent_user.id, title, notifbody, url) push_notif(parent_user.id, title, notifbody, url)

View File

@ -65,7 +65,7 @@ def exile_comment(v:User, cid):
kind='exile_user', kind='exile_user',
user_id=v.id, user_id=v.id,
target_user_id=u.id, target_user_id=u.id,
_note=f'for <a href="/comment/{c.id}#context">comment</a>' _note=f'for <a href="/comment/{c.id}">comment</a>'
) )
g.db.add(ma) g.db.add(ma)