forked from MarseyWorld/MarseyWorld
fds
parent
8db6ae9261
commit
1865e094c5
|
@ -345,11 +345,20 @@ def reported_comments(v):
|
||||||
@app.get("/admin")
|
@app.get("/admin")
|
||||||
@admin_level_required(2)
|
@admin_level_required(2)
|
||||||
def admin_home(v):
|
def admin_home(v):
|
||||||
with open('disablesignups', 'r') as f:
|
|
||||||
x = f.read()
|
with open('disablesignups', 'r') as f: x = f.read()
|
||||||
if not v or v.oldsite: template = ''
|
|
||||||
else: template = 'CHRISTMAS/'
|
if not v or v.oldsite: render_template(f"admin/admin_home.html", v=v, x=x)
|
||||||
return render_template(f"{template}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")
|
@app.post("/admin/disablesignups")
|
||||||
@admin_level_required(2)
|
@admin_level_required(2)
|
||||||
|
|
Loading…
Reference in New Issue