rDrama/files/templates/admin/banned_domains.html

49 lines
1.3 KiB
HTML
Raw Normal View History

2022-05-04 23:09:46 +00:00
{% extends "default.html" %}
{% block title %}
<title>Banned Domains</title>
{% endblock %}
{% block content %}
2022-10-20 22:14:25 +00:00
<script>
function unbanDomain(t, domain) {
postToast(t,'/admin/unban_domain/' + domain);
2022-10-20 22:14:25 +00:00
t.parentElement.parentElement.remove();
}
</script>
<div class="overflow-x-auto mt-2">
2022-10-20 22:14:25 +00:00
<table class="table table-striped mb-5" id="domains-table">
<thead class="bg-primary text-white">
<tr>
<th>Domain</th>
<th>Ban reason</th>
<th></th>
</tr>
</thead>
<tbody>
{% for domain in banned_domains %}
<tr>
<td>{{domain.domain}}</td>
<td>{{domain.reason}}</td>
<td>
2022-10-28 23:35:14 +00:00
<button type="button" class="btn btn-danger" onclick="unbanDomain(this, '{{domain.domain}}')">Unban</button>
2022-10-20 22:14:25 +00:00
</td>
</tr>
{% endfor %}
</tbody>
</table>
<form action="/admin/ban_domain" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<input autocomplete="off" name="domain" placeholder="Enter domain here.." class="form-control" required>
<input autocomplete="off" name="reason" placeholder="Enter ban reason here.." oninput="document.getElementById('ban-submit').disabled=false" class="form-control mt-2">
<input autocomplete="off" id="ban-submit" type="submit" onclick="disable(this)" class="btn btn-primary mt-2" value="Ban domain" disabled>
</form>
</div>
{% endblock %}