show the username of the janny who banned

remotes/1693045480750635534/spooky-22
Aevann1 2022-06-28 02:59:08 +02:00
parent cd811d7b9d
commit aac17a6daa
4 changed files with 5 additions and 5 deletions

View File

@ -1090,12 +1090,12 @@ def ban_user(user_id, v):
if request.values["reason"].startswith("/post/"):
post = int(request.values["reason"].split("/post/")[1].split(None, 1)[0])
post = get_post(post)
post.bannedfor = duration
post.bannedfor = f'{duration} by @{v.username}'
g.db.add(post)
elif request.values["reason"].startswith("/comment/"):
comment = int(request.values["reason"].split("/comment/")[1].split(None, 1)[0])
comment = get_comment(comment)
comment.bannedfor = duration
comment.bannedfor = f'{duration} by @{v.username}'
g.db.add(comment)
notify_mod_action(v.id, f"@{v.username} has banned @{user.username} ({note})")

View File

@ -184,7 +184,7 @@
{% endif %}
{% if c.bannedfor %}
<i class="fas fa-hammer-crash text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this comment{% if c.author.banned_by %} by @{{c.author.banned_by.username}}{% endif %} for {{c.bannedfor}}"></i>
<i class="fas fa-hammer-crash text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this comment for {{c.bannedfor}}"></i>
{% endif %}
{% if c.active_flags(v) %}<a class="btn btn-primary" style="padding:1px 5px; font-size:10px"role="button" onclick="document.getElementById('flaggers-{{c.id}}').classList.toggle('d-none')">{{c.active_flags(v)}} Report{{ help.plural(c.active_flags(v)) }}</a>{% endif %}
{% if c.over_18 %}<span class="badge badge-danger text-small-extra mr-1">+18</span>{% endif %}

View File

@ -717,7 +717,7 @@
{% endif %}
{% if p.bannedfor %}
<i class="fas fa-hammer-crash text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this post{% if p.author.banned_by %} by @{{p.author.banned_by.username}}{% endif %} for {{p.bannedfor}}"></i>
<i class="fas fa-hammer-crash text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this post for {{p.bannedfor}}"></i>
{% endif %}
{% for a in p.awards %}

View File

@ -162,7 +162,7 @@
{% endif %}
{% if p.bannedfor %}
<i class="fas fa-hammer-crash text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this post{% if p.author.banned_by %} by @{{p.author.banned_by.username}}{% endif %} for {{p.bannedfor}}"></i>
<i class="fas fa-hammer-crash text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User was banned for this post for {{p.bannedfor}}"></i>
{% endif %}
{% for a in p.awards %}