mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-12-03 12:14:12 +01:00
Quarantine plugin refactoring. It is now working like the webmail plugin, ie with an anchor based ajax navigation. What is broken for the moment:
* search functionality, * headers do not appear while displaying a mail. New message system. (see infobox.js)
This commit is contained in:
@@ -2,20 +2,6 @@
|
||||
{% load i18n %}
|
||||
{% block html_head %}
|
||||
<style type="text/css">
|
||||
#listing {
|
||||
position: absolute;
|
||||
left: 155px;
|
||||
right: 0px;
|
||||
top: 130px;
|
||||
height: expression(document.body.clientHeight - 35 + "px");
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
html > body #listing {
|
||||
position: fixed;
|
||||
bottom: 35px;
|
||||
}
|
||||
|
||||
#navbar {
|
||||
float: right;
|
||||
padding: 0;
|
||||
@@ -37,6 +23,39 @@ html > body #listing {
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
window.addEvent("domready", function() {
|
||||
navparams = new Hash({
|
||||
{% for k, v in navparams.items %}
|
||||
{{ k }} : "{{ v }}",
|
||||
{% endfor %}
|
||||
});
|
||||
|
||||
navbarcallback = function(event) {
|
||||
event.stop();
|
||||
current_anchor.setparams(navparams);
|
||||
current_anchor.parse_string(event.target.getParent().get("href")).update();
|
||||
}
|
||||
|
||||
viewmail = function(event) {
|
||||
event.stop();
|
||||
if (event.target.parentNode.id) {
|
||||
var url = event.target.parentNode.id + "/";
|
||||
event.target.parentNode.setStyle("background", "#ffffcc");
|
||||
current_anchor.baseurl(url).update();
|
||||
}
|
||||
}
|
||||
|
||||
updatelisting = function(resp) {
|
||||
if ($defined(resp.menu)) {
|
||||
$("menubar").set("html", resp.menu);
|
||||
parse_menubar("menubar");
|
||||
}
|
||||
$("listing").set("html", resp.listing);
|
||||
if ($defined(resp.navbar)) {
|
||||
$("navbar").set("html", resp.navbar);
|
||||
$("navbar").getChildren("a").addEvent("click", navbarcallback);
|
||||
}
|
||||
}
|
||||
|
||||
if ($("selectall")) {
|
||||
$("selectall").addEvent("click", function(event) {
|
||||
if ($("selectall").checked) {
|
||||
@@ -47,6 +66,7 @@ window.addEvent("domready", function() {
|
||||
});
|
||||
}
|
||||
{% block js %}{% endblock %}
|
||||
ajaxListener("{{ deflocation }}", {{ defcallback }});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -55,5 +75,5 @@ window.addEvent("domready", function() {
|
||||
<div id="listing">{{ listing }}</div>
|
||||
<div class="spacer"></div>
|
||||
{% endblock %}
|
||||
{% block footer %}<div id="navbar"></div>{% endblock %}
|
||||
{% block footer %}<div id="navbar">{{ navbar }}</div>{% endblock %}
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{% load i18n %}
|
||||
<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>
|
||||
@@ -0,0 +1,54 @@
|
||||
{% load i18n %}
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head profile="http://www.w3.org/2005/10/profile">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="/static/stylesheets/box.css" />
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 5px;
|
||||
}
|
||||
#mailcontent {
|
||||
width: 100%;
|
||||
border: 0px transparent none;
|
||||
margin: 0;
|
||||
}
|
||||
table#emailheaders {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
#emailheaders td,
|
||||
#emailheaders th {
|
||||
height: 22px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
#emailheaders td {
|
||||
font-size: 1em;
|
||||
}
|
||||
#emailheaders th {
|
||||
background: #F7F9Fb;
|
||||
}
|
||||
#emailheaders a, #emailheaders a:visited {
|
||||
color: blue;
|
||||
text-decoration: none;
|
||||
}
|
||||
#emailheaders a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
pre {
|
||||
font-size: medium;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="table-container">
|
||||
{{ headers }}
|
||||
</div>
|
||||
{% if pre %}<pre>{% endif %}{{ mailbody }}{% if pre %}</pre>{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user