Add ability to create bans from reports
This is done in the admin view and opens a new iframed window. The ban form is pretty barebones and doesn't have full functionality yet, but that is coming. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{% extends "admin/change_list.html" %}
|
||||
{% load static %}
|
||||
{% block extrastyle %}
|
||||
{{ block.super }}
|
||||
<style>
|
||||
@@ -9,5 +10,53 @@
|
||||
background-color: var(--message-error-bg);
|
||||
color: var(--error-fg);
|
||||
}
|
||||
|
||||
.wb-min {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wb-max {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wb-full {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{% endblock extrastyle %}
|
||||
{% endblock extrastyle %}
|
||||
{% block extrahead %}
|
||||
{{block.super}}
|
||||
<script src="{% static 'board/jquery.js' %}"></script>
|
||||
<script src="{% static 'board/winbox.bundle.js' %}"></script>
|
||||
{% endblock extrahead %}
|
||||
|
||||
{% block footer %}
|
||||
{{block.super}}
|
||||
<script>
|
||||
|
||||
function openBanWindow(e) {
|
||||
e.preventDefault();
|
||||
let banUrl = e.target.getAttribute("data-ban-url");
|
||||
if (window.banWindow) {
|
||||
window.banWindow.close();
|
||||
}
|
||||
window.banWindow = new WinBox("New ban", {
|
||||
url: banUrl,
|
||||
x: "center",
|
||||
y: "center",
|
||||
root: document.body,
|
||||
onclose: function(force) {
|
||||
window.top.banWindow = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function onLoad(e) {
|
||||
window.banWindow = null;
|
||||
}
|
||||
|
||||
$(".ban_link").on("click", openBanWindow);
|
||||
$(window).on("load", onLoad);
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user