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