master
Aevann1 2021-12-31 18:40:03 +02:00
parent 8db6ae9261
commit 1865e094c5
1 changed files with 14 additions and 5 deletions

View File

@ -345,11 +345,20 @@ def reported_comments(v):
@app.get("/admin")
@admin_level_required(2)
def admin_home(v):
with open('disablesignups', 'r') as f:
x = f.read()
if not v or v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/admin_home.html", v=v, x=x)
with open('disablesignups', 'r') as f: x = f.read()
if not v or v.oldsite: render_template(f"admin/admin_home.html", v=v, x=x)
page=int(request.args.get("page",1))
if v and v.admin_level == 6: actions = g.db.query(ModAction).order_by(ModAction.id.desc()).offset(25 * (page - 1)).limit(26).all()
else: actions=g.db.query(ModAction).filter(ModAction.kind!="shadowban", ModAction.kind!="unshadowban", ModAction.kind!="club", ModAction.kind!="unclub").order_by(ModAction.id.desc()).offset(25*(page-1)).limit(26).all()
next_exists=len(actions)==26
actions=actions[:25]
return render_template(f"CHRISTMAS/admin/admin_home.html", actions=actions, v=v, x=x)
@app.post("/admin/disablesignups")
@admin_level_required(2)