diff --git a/files/routes/admin.py b/files/routes/admin.py index 101e0599a..bc99a9e78 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -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)