mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-23 06:38:40 +02:00
176 lines
4.1 KiB
HTML
176 lines
4.1 KiB
HTML
{% extends "layout.html" %}
|
|
{% load i18n %}
|
|
{% load amextras %}
|
|
{% block html_head %}
|
|
<script src="/static/js/mootools-more.js" type="text/javascript"></script>
|
|
<link rel="stylesheet" type="text/css" href="/static/stylesheets/box.css" />
|
|
<style type="text/css">
|
|
form {
|
|
margin: 0 auto;
|
|
width: 98%;
|
|
}
|
|
|
|
#quarmenu {
|
|
float: left;
|
|
width: 100%;
|
|
margin: 5px 0;
|
|
}
|
|
|
|
#listing {
|
|
float: left;
|
|
width: 100%;
|
|
padding-bottom: 10px;
|
|
}
|
|
|
|
#listheader {
|
|
float: left;
|
|
width: 100%;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
#navbar {
|
|
float: right;
|
|
}
|
|
|
|
#counter {
|
|
float: left;
|
|
font-weight: bold;
|
|
}
|
|
|
|
td {
|
|
font-size: smaller;
|
|
height: 40px;
|
|
}
|
|
|
|
#searchbox {
|
|
float: right;
|
|
margin-right: 10px;
|
|
}
|
|
|
|
#searchbox img {
|
|
float: left;
|
|
margin-top: 4px;
|
|
margin-right: 5px;
|
|
}
|
|
|
|
#searchparams {
|
|
background: white;
|
|
padding: 5px;
|
|
}
|
|
</style>
|
|
|
|
<script type="text/javascript">
|
|
window.addEvent("domready", function() {
|
|
mysubmit = function(event, name) {
|
|
event.stop();
|
|
new Element('input', {
|
|
'type' : 'hidden', 'name' : "action", style: "display:none", 'value' : name
|
|
}).inject($("quarlistingform"), "top");
|
|
$("quarlistingform").set("send", {
|
|
onSuccess : function(res) {
|
|
response = JSON.decode(res);
|
|
location.href = response.url;
|
|
}
|
|
});
|
|
$("quarlistingform").send();
|
|
}
|
|
|
|
checkSelection = function(text) {
|
|
var getout = $$("input[name=selection]").every(function(item, index) {
|
|
return item.checked == false;
|
|
});
|
|
if (getout) {
|
|
return false;
|
|
}
|
|
return confirm(text);
|
|
}
|
|
|
|
toggleSelection = function(value) {
|
|
$$("input[name=selection]").each(function(obj) {
|
|
obj.checked = value;
|
|
});
|
|
}
|
|
|
|
$$("a[name=delete]").addEvent("click", function(event) {
|
|
if (!checkSelection("{% trans "Delete this selection?" %}")) {
|
|
event.stop();
|
|
return;
|
|
}
|
|
mysubmit(event, "delete");
|
|
});
|
|
$$("a[name=release]").addEvent("click", function(event) {
|
|
if (!checkSelection("{% trans "Release this selection?" %}")) {
|
|
event.stop();
|
|
return;
|
|
}
|
|
mysubmit(event, "release");
|
|
});
|
|
|
|
$("selectall").addEvent("click", function(event) {
|
|
if ($("selectall").checked) {
|
|
toggleSelection(true);
|
|
} else {
|
|
toggleSelection(false);
|
|
}
|
|
});
|
|
|
|
{% url extensions.amavis_quarantine.main.search as s_url %}
|
|
$("searchfield").addEvent("change", function(event) {
|
|
var criteria = "";
|
|
$$("input[name=scriteria]:checked").each(function(obj) {
|
|
criteria = obj.value;
|
|
});
|
|
new Request.JSON({url: "{{ s_url }}", onSuccess: function(resp) {
|
|
$("listing").set("html", resp.content);
|
|
}}).get({"pattern" : $("searchfield").value, "criteria" : criteria});
|
|
});
|
|
|
|
$("searchfield").addEvent("click", function(event) {
|
|
$("searchfield").select();
|
|
});
|
|
|
|
$("searchfield").addEvent("blur", function(event) {
|
|
if ($("searchfield").value == "") {
|
|
$("searchfield").set("value", "{% trans "Search..." %}");
|
|
}
|
|
});
|
|
|
|
var myFx = new Fx.Slide($("searchparams"));
|
|
myFx.hide();
|
|
$("searchopts").addEvent("click", function(event) {
|
|
myFx.cancel();
|
|
myFx.toggle();
|
|
});
|
|
$$("input[name=scriteria]").addEvent("click", function(event) {
|
|
myFx.cancel();
|
|
myFx.toggle();
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
{% block middletitle %}{% trans "Quarantine" %}{% endblock %}
|
|
{% block menu %}
|
|
{% quar_menu "" perms %}
|
|
<div id="searchbox">
|
|
<img src="/static/pics/search.png" id="searchopts" />
|
|
<input type="text" name="searchfield" id="searchfield" value="{% trans "Search..." %}" />
|
|
<div id="searchparams">
|
|
<input type="radio" name="scriteria" value="from_addr" checked>{% trans "From address" %}<br/>
|
|
<input type="radio" name="scriteria" value="subject">{% trans "Subject" %}<br/>
|
|
<input type="radio" name="scriteria" value="from_addr,subject">{% trans "Both" %}<br/>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
{% block content %}
|
|
<div id="form-container">
|
|
{% url extensions.amavis_quarantine.main.process as actionurl %}
|
|
<form method="POST" action="{{ actionurl }}" id="quarlistingform">
|
|
<input type="hidden" name="pagenum" id="pagenum" value="{{ current_page }}" />
|
|
|
|
<div id="listing">
|
|
{{ content }}
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|