forked from rDrama/rDrama
fdssdf
parent
d190ea4f53
commit
12904050a1
|
@ -23,6 +23,15 @@ if SITE_NAME == 'PCM': cc = "splash mountain"
|
||||||
else: cc = "country club"
|
else: cc = "country club"
|
||||||
month = datetime.now().strftime('%B')
|
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>")
|
@app.get("/distribute/<cid>")
|
||||||
@admin_level_required(3)
|
@admin_level_required(3)
|
||||||
def distribute(v, cid):
|
def distribute(v, cid):
|
||||||
|
@ -262,7 +271,6 @@ def shadowbanned(v):
|
||||||
else: template = 'CHRISTMAS/'
|
else: template = 'CHRISTMAS/'
|
||||||
return render_template(f"{template}shadowbanned.html", v=v, users=users)
|
return render_template(f"{template}shadowbanned.html", v=v, users=users)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/admin/agendaposters")
|
@app.get("/admin/agendaposters")
|
||||||
@auth_required
|
@auth_required
|
||||||
def agendaposters(v):
|
def agendaposters(v):
|
||||||
|
@ -887,6 +895,7 @@ def unban_user(user_id, v):
|
||||||
user.is_banned = 0
|
user.is_banned = 0
|
||||||
user.unban_utc = 0
|
user.unban_utc = 0
|
||||||
user.ban_evade = 0
|
user.ban_evade = 0
|
||||||
|
user.ban_reason = None
|
||||||
g.db.add(user)
|
g.db.add(user)
|
||||||
|
|
||||||
if request.values.get("alts", ""):
|
if request.values.get("alts", ""):
|
||||||
|
|
|
@ -240,6 +240,7 @@ def award_post(pid, v):
|
||||||
author.ban_reason = f"grass award used by @{v.username} on /post/{post.id}"
|
author.ban_reason = f"grass award used by @{v.username} on /post/{post.id}"
|
||||||
link = f"[this post]({post.permalink})"
|
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(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":
|
elif kind == "pin":
|
||||||
if post.stickied and post.stickied.startswith("t:"): t = int(post.stickied[2:]) + 3600
|
if post.stickied and post.stickied.startswith("t:"): t = int(post.stickied[2:]) + 3600
|
||||||
else: t = int(time.time()) + 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}"
|
author.ban_reason = f"grass award used by @{v.username} on /comment/{c.id}"
|
||||||
link = f"[this comment]({c.permalink})"
|
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(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":
|
elif kind == "pin":
|
||||||
if c.is_pinned and c.is_pinned.startswith("t:"): t = int(c.is_pinned[2:]) + 3600
|
if c.is_pinned and c.is_pinned.startswith("t:"): t = int(c.is_pinned[2:]) + 3600
|
||||||
else: t = int(time.time()) + 3600
|
else: t = int(time.time()) + 3600
|
||||||
|
|
|
@ -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 %}
|
|
@ -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 %}
|
Loading…
Reference in New Issue