forked from rDrama/rDrama
1
0
Fork 0

better user links in mod log

master
Aevann 2023-06-30 19:19:05 +03:00
parent 30b46195ea
commit 9974590a19
3 changed files with 8 additions and 8 deletions

View File

@ -56,7 +56,7 @@ class ModAction(Base):
@property
@lazy
def target_link(self):
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:
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>'

View File

@ -48,7 +48,7 @@ class SubAction(Base):
@property
@lazy
def target_link(self):
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:
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>'

View File

@ -37,12 +37,12 @@ MODACTION_TYPES = {
"color": 'bg-danger'
},
'ban_user': {
"str": 'banned user {self.target_link}',
"str": 'banned {self.target_link}',
"icon": 'fa-user-slash',
"color": 'bg-danger'
},
'blacklist_user': {
"str": 'blacklisted user {self.target_link} from restricted holes',
"str": 'blacklisted {self.target_link} from restricted holes',
"icon": 'fa-lock',
"color": 'bg-danger'
},
@ -192,12 +192,12 @@ MODACTION_TYPES = {
"color": 'bg-success'
},
'mod_mute_user': {
"str": 'muted reports from user {self.target_link}',
"str": 'muted reports from {self.target_link}',
"icon": 'fa-file-signature',
"color": 'bg-danger'
},
'mod_unmute_user': {
"str": 'unmuted reports from user {self.target_link}',
"str": 'unmuted reports from {self.target_link}',
"icon": 'fa-file-signature',
"color": 'bg-success'
},
@ -322,12 +322,12 @@ MODACTION_TYPES = {
"color": 'bg-success'
},
'unban_user': {
"str": 'unbanned user {self.target_link}',
"str": 'unbanned {self.target_link}',
"icon": 'fa-user',
"color": 'bg-success'
},
'unblacklist_user': {
"str": 'unblacklisted user {self.target_link} from restricted holes',
"str": 'unblacklisted {self.target_link} from restricted holes',
"icon": 'fa-lock-open',
"color": 'bg-success'
},