forked from rDrama/rDrama
fdfd
parent
84507a4f55
commit
c39fb17f9f
|
@ -459,20 +459,6 @@ def admin_appdata(v):
|
||||||
v=v)
|
v=v)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/admin/banned_domains/")
|
|
||||||
@admin_level_required(4)
|
|
||||||
def admin_domain_domain(v):
|
|
||||||
|
|
||||||
domains = g.db.query(BannedDomain).all()
|
|
||||||
|
|
||||||
return render_template(
|
|
||||||
"admin/banned_domains.html",
|
|
||||||
v=v,
|
|
||||||
domains=domains,
|
|
||||||
reasons=REASONS
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@app.post("/admin/image_purge")
|
@app.post("/admin/image_purge")
|
||||||
@admin_level_required(5)
|
@admin_level_required(5)
|
||||||
def admin_image_purge(v):
|
def admin_image_purge(v):
|
||||||
|
@ -957,13 +943,26 @@ def admin_dump_cache(v):
|
||||||
return {"message": "Internal cache cleared."}
|
return {"message": "Internal cache cleared."}
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/admin/banned_domains/")
|
||||||
|
@admin_level_required(4)
|
||||||
|
def admin_banned_domains(v):
|
||||||
|
|
||||||
|
domains = g.db.query(BannedDomain).all()
|
||||||
|
|
||||||
|
return render_template(
|
||||||
|
"admin/banned_domains.html",
|
||||||
|
v=v,
|
||||||
|
domains=domains,
|
||||||
|
reasons=REASONS
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.post("/admin/ban_domain")
|
@app.post("/admin/ban_domain")
|
||||||
@admin_level_required(4)
|
@admin_level_required(4)
|
||||||
@validate_formkey
|
@validate_formkey
|
||||||
def admin_ban_domain(v):
|
def admin_ban_domain(v):
|
||||||
|
|
||||||
domain=request.form.get("domain",'').strip()
|
domain=request.form.get("domain",'').strip()
|
||||||
|
|
||||||
if not domain: abort(400)
|
if not domain: abort(400)
|
||||||
|
|
||||||
reason=int(request.form.get("reason",0))
|
reason=int(request.form.get("reason",0))
|
||||||
|
|
|
@ -26,8 +26,7 @@
|
||||||
<form action="/admin/ban_domain" method="post">
|
<form action="/admin/ban_domain" method="post">
|
||||||
|
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
<input type="hidden" name="domain" value="{{domain_name}}">
|
<input name="domain" placeholder="Enter domain here.." required>
|
||||||
<input name="domain" placeholder="domain" required>
|
|
||||||
|
|
||||||
<label for="reason_select">Ban reason</label>
|
<label for="reason_select">Ban reason</label>
|
||||||
<select id="reason_select" class="form-control" name="reason" onchange="$('#ban-submit').prop('disabled', false)">
|
<select id="reason_select" class="form-control" name="reason" onchange="$('#ban-submit').prop('disabled', false)">
|
||||||
|
|
Loading…
Reference in New Issue