forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-12-20 23:04:15 +02:00
parent d190ea4f53
commit 12904050a1
4 changed files with 54 additions and 1 deletions

View File

@ -23,6 +23,15 @@ if SITE_NAME == 'PCM': cc = "splash mountain"
else: cc = "country club"
month = datetime.now().strftime('%B')
@app.get("/admin/grassed")
@admin_level_required(3)
def grassed(v):
users = g.db.query(User).filter(User.ban_reason.like('grass award used by @%')).all()
if not v or v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}grassed.html", v=v, users=users)
@app.get("/distribute/<cid>")
@admin_level_required(3)
def distribute(v, cid):
@ -262,7 +271,6 @@ def shadowbanned(v):
else: template = 'CHRISTMAS/'
return render_template(f"{template}shadowbanned.html", v=v, users=users)
@app.get("/admin/agendaposters")
@auth_required
def agendaposters(v):
@ -887,6 +895,7 @@ def unban_user(user_id, v):
user.is_banned = 0
user.unban_utc = 0
user.ban_evade = 0
user.ban_reason = None
g.db.add(user)
if request.values.get("alts", ""):

View File

@ -240,6 +240,7 @@ def award_post(pid, v):
author.ban_reason = f"grass award used by @{v.username} on /post/{post.id}"
link = f"[this post]({post.permalink})"
send_repeatable_notification(author.id, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!")
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award on [{post.shortlink}]({post.shortlink})")
elif kind == "pin":
if post.stickied and post.stickied.startswith("t:"): t = int(post.stickied[2:]) + 3600
else: t = int(time.time()) + 3600
@ -411,6 +412,7 @@ def award_comment(cid, v):
author.ban_reason = f"grass award used by @{v.username} on /comment/{c.id}"
link = f"[this comment]({c.permalink})"
send_repeatable_notification(author.id, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!")
send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award on [{c.shortlink}]({c.shortlink})")
elif kind == "pin":
if c.is_pinned and c.is_pinned.startswith("t:"): t = int(c.is_pinned[2:]) + 3600
else: t = int(time.time()) + 3600

View File

@ -0,0 +1,21 @@
{% extends "CHRISTMAS/settings2.html" %}
{% block content %}
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th style="font-weight:bold;">#</th>
<th style="font-weight:bold;">Name</th>
<th style="font-weight:bold;">Grasser</th>
</tr>
</thead>
{% for user in users %}
<tr>
<td style="font-weight:bold;">{{loop.index}}</td>
<td><a style="color:#{{user.namecolor}}; font-weight:bold;" href="/@{{user.username}}"><img loading="lazy" src="/uid/{{user.id}}/pic" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.namecolor}};"{% endif %}>{{user.username}}</span></a></td>
<td style="font-weight:bold;">{{user.ban_reason.split('by ')[1]}}</td>
</tr>
{% endfor %}
</table>
{% endblock %}

View File

@ -0,0 +1,21 @@
{% extends "settings2.html" %}
{% block content %}
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th style="font-weight:bold;">#</th>
<th style="font-weight:bold;">Name</th>
<th style="font-weight:bold;">Grasser</th>
</tr>
</thead>
{% for user in users %}
<tr>
<td style="font-weight:bold;">{{loop.index}}</td>
<td><a style="color:#{{user.namecolor}}; font-weight:bold;" href="/@{{user.username}}"><img loading="lazy" src="/uid/{{user.id}}/pic" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.namecolor}};"{% endif %}>{{user.username}}</span></a></td>
<td style="font-weight:bold;">{{user.ban_reason.split('by ')[1]}}</td>
</tr>
{% endfor %}
</table>
{% endblock %}