diff --git a/modoboa/extensions/amavis/templatetags/amavis_tags.py b/modoboa/extensions/amavis/templatetags/amavis_tags.py
index 9426a7897..0688b1154 100644
--- a/modoboa/extensions/amavis/templatetags/amavis_tags.py
+++ b/modoboa/extensions/amavis/templatetags/amavis_tags.py
@@ -12,10 +12,10 @@ register = template.Library()
def viewm_menu(mail_id, rcpt):
entries = [
{"name": "back",
- "url": "javascript:history.go(-2);",
- "img": "glyphicon glyphicon-arrow-left",
- "class": "btn-primary",
- "label": _("Back")},
+ "url": "javascript:history.go(-2);",
+ "img": "glyphicon glyphicon-arrow-left",
+ "class": "btn-primary",
+ "label": _("Back")},
{"name": "release",
"img": "glyphicon glyphicon-ok",
"class": "btn-success",
diff --git a/modoboa/extensions/webmail/forms.py b/modoboa/extensions/webmail/forms.py
index cb329c9f4..0b88de9b9 100644
--- a/modoboa/extensions/webmail/forms.py
+++ b/modoboa/extensions/webmail/forms.py
@@ -91,6 +91,15 @@ class ComposeMailForm(forms.Form):
origmsgid = forms.CharField(label="", required=False)
body = forms.CharField()
+ def __init__(self, *args, **kwargs):
+ """Custom constructor."""
+ super(ComposeMailForm, self).__init__(*args, **kwargs)
+ self.field_widths = {
+ "cc": "11",
+ "cci": "11",
+ "subject": "11"
+ }
+
def _html_msg(self):
"""Create a multipart message.
diff --git a/modoboa/extensions/webmail/lib/imapemail.py b/modoboa/extensions/webmail/lib/imapemail.py
index b087e4f6e..dcdb34b9e 100644
--- a/modoboa/extensions/webmail/lib/imapemail.py
+++ b/modoboa/extensions/webmail/lib/imapemail.py
@@ -20,9 +20,11 @@ from .utils import decode_payload
class ImapEmail(Email):
+
"""
A class to represent an email fetched from an IMAP server.
"""
+
headernames = [
('From', True),
('To', True),
@@ -206,6 +208,9 @@ class ImapEmail(Email):
class Modifier(ImapEmail):
+
+ """Message modifier."""
+
def __init__(self, form, *args, **kwargs):
kwargs["dformat"] = "EDITOR"
super(Modifier, self).__init__(*args, **kwargs)
@@ -216,7 +221,9 @@ class Modifier(ImapEmail):
self.body = re.sub("?pre>", "", self.body)
def _modify_html(self):
- pass
+ if self.dformat == "html" and self.mformat != self.dformat:
+ self.body = re.sub("?pre>", "", self.body)
+ self.body = re.sub("\n", "
", self.body)
@property
def subject(self):
@@ -225,6 +232,9 @@ class Modifier(ImapEmail):
class ReplyModifier(Modifier):
+
+ """Modify a message to reply to it."""
+
headernames = ImapEmail.headernames + \
[("Reply-To", True),
("Message-ID", False)]
diff --git a/modoboa/extensions/webmail/lib/imaputils.py b/modoboa/extensions/webmail/lib/imaputils.py
index 0a306dd74..5b4447f8c 100644
--- a/modoboa/extensions/webmail/lib/imaputils.py
+++ b/modoboa/extensions/webmail/lib/imaputils.py
@@ -473,14 +473,14 @@ class IMAPconnector(object):
md_mailboxes = []
else:
md_mailboxes = [
- {"name": "INBOX", "class": "glyphicon glyphicon-inbox"},
+ {"name": "INBOX", "class": "fa fa-inbox"},
{"name": parameters.get_user(user, "DRAFTS_FOLDER"),
- "class": "glyphicon glyphicon-file"},
- {"name": 'Junk', "class": "glyphicon glyphicon-fire"},
+ "class": "fa fa-file"},
+ {"name": 'Junk', "class": "fa fa-fire"},
{"name": parameters.get_user(user, "SENT_FOLDER"),
- "class": "glyphicon glyphicon-envelope"},
+ "class": "fa fa-envelope"},
{"name": parameters.get_user(user, "TRASH_FOLDER"),
- "class": "glyphicon glyphicon-trash"}
+ "class": "fa fa-trash"}
]
if until_mailbox:
name, parent = separate_mailbox(until_mailbox, self.hdelimiter)
diff --git a/modoboa/extensions/webmail/static/webmail/css/webmail.css b/modoboa/extensions/webmail/static/webmail/css/webmail.css
index 59cace3c2..fba46bae9 100644
--- a/modoboa/extensions/webmail/static/webmail/css/webmail.css
+++ b/modoboa/extensions/webmail/static/webmail/css/webmail.css
@@ -9,62 +9,28 @@
padding-right: 15px;
}
-td[name=drag], td[name=selection] {
- width: 1%;
-}
-
@media (max-width: 400px) {
- td#subject,
- td[name='subject']
- {
- max-width: 120px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
+
}
@media (max-width: 500px) {
- th#date,
- td[name="date"],
- #menubar .actions {
- display: none;
- }
+
}
@media (max-width: 768px) {
#searchbox {
margin-left: 20px;
}
-
- td[name=from] {
- width: 35%;
- }
}
@media (min-width: 768px) {
- td[name=from] {
- width: 25%;
- }
+
}
@media (max-width: 1198px) {
.container-fluid {
padding:0;
}
- th#date,
- td[name="date"]{
- max-width: 100px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- th#withatts,
- td[name="withatts"],
- th#drag,
- td[name="drag"] {
- display: none;
- }
.display-up-1198-webmail {
display: none;
@@ -152,10 +118,6 @@ body, html {
font-weight: bold;
}
-td[name="date"] {
- text-align: right;
-}
-
#left-toolbar {
position: absolute;
width: 100%;
@@ -244,24 +206,14 @@ li.droppable li{
padding-bottom: 5px;
}
-#mailheader textarea {
- width: 99%;
- height: 40px;
- padding: 2px 0;
+#mailheader label {
+ text-align: left;
}
-/* #mailheader label { */
-/* text-align: left; */
-/* } */
-
#mailheader .options {
margin-bottom: 8px;
}
-#add_cc {
- margin-right: 20px;
-}
-
#attachments {
position: relative;
margin: 1px 0 5px 0;
@@ -311,19 +263,13 @@ list {
float: left;
}
-.shortlist {
- font-weight: normal !important;
- font-style: italic;
-}
-
/*
* Drap & Drop
*/
.dragbox {
padding : 5px;
text-align : center;
- background : white;
- z-index : 3;
+ z-index : 1001;
}
/*
diff --git a/modoboa/extensions/webmail/static/webmail/js/webmail.js b/modoboa/extensions/webmail/static/webmail/js/webmail.js
index 683ee4cc4..5825ee9f9 100644
--- a/modoboa/extensions/webmail/static/webmail/js/webmail.js
+++ b/modoboa/extensions/webmail/static/webmail/js/webmail.js
@@ -150,8 +150,8 @@ Webmail.prototype = {
$(document).on("click", "a[name=sendmail]", $.proxy(this.sendmail, this));
- $(document).on("click", "#attachments", $.proxy(function(e) {
- modalbox(e, undefined, $("#attachments").attr("name"),
+ $(document).on("click", "a[name=attachments]", $.proxy(function(e) {
+ modalbox(e, undefined, $("a[name=attachments]").attr("href"),
$.proxy(this.attachments_init, this));
}, this));
},
@@ -340,7 +340,7 @@ Webmail.prototype = {
var $link = $('a[href="' + mailbox + '"]');
var parts = mailbox.split(this.options.hdelimiter);
var dname = " " + parts[parts.length - 1];
- var $i = $link.children("i:visible");
+ var $span = $link.children("span:visible");
this.unseen_counters[mailbox] = value;
if (value) {
@@ -350,7 +350,7 @@ Webmail.prototype = {
$link.html(dname);
$link.removeClass("unseen");
}
- $link.prepend($i);
+ $link.prepend($span);
},
/*
@@ -403,11 +403,10 @@ Webmail.prototype = {
});
var $link = $("", {
name: linkname,
- 'class': "block",
href: mailbox
});
var parts = mailbox.split(this.options.hdelimiter);
- var linkcontent = " ";
+ var linkcontent = " ";
var displayname = linkcontent + parts[parts.length - 1];
$li.append($link);
@@ -433,7 +432,7 @@ Webmail.prototype = {
});
var $plink = $parent.children("a");
- $parent.append($ul);
+ $parent.after($ul);
if (!$parent.children("div").length) {
this.inject_clickbox($parent);
}
@@ -649,7 +648,7 @@ Webmail.prototype = {
$parent = $ul;
mailbox = $parent.attr("name") + this.options.hdelimiter + mailbox;
} else {
- $parent = $("#mboxes_container").children("ul");
+ $parent = $("#folders > div > ul");
}
var $li = this.inject_mailbox($parent, mailbox, "loadfolder");
this.init_droppables($li);
@@ -665,11 +664,11 @@ Webmail.prototype = {
var $link = $("#folders").find('a[href="' + oldpattern + '"]');
if (oldname != newname) {
- var $i = $link.children("i");
+ var $span = $link.children("span");
- $link.html(newname);
+ $link.html(" " + newname);
$link.parent("li").attr("name", newpattern);
- $link.prepend($i);
+ $link.prepend($span);
$link.attr("href", newpattern);
this.navobject.setparam("mbox", newpattern).update(false, true);
}
@@ -937,6 +936,7 @@ Webmail.prototype = {
if (resp.id !== undefined) {
this.navobject.setparam("id", resp.id).update(false, true);
}
+
this.resize_compose_body();
},
@@ -1016,7 +1016,7 @@ Webmail.prototype = {
attachments_init: function() {
$("#submit").click(function(e) {
e.preventDefault();
- if ($("#id_attachment").val() == "") {
+ if ($("#id_attachment").val() === "") {
return;
}
$("#upload_status").css("display", "block");
@@ -1024,7 +1024,7 @@ Webmail.prototype = {
$("#uploadfile").submit();
});
$("a[name=delattachment]").click(this.del_attachment);
- $(".modal").one("hide", this.close_attachments);
+ $(".modal").one("hide.bs.modal", $.proxy(this.close_attachments, this));
},
_reset_upload_form: function() {
@@ -1037,10 +1037,12 @@ Webmail.prototype = {
var $delbtn = $("", {
name: "delattachment",
href: this.options.delattachment_url + "?name=" + tmpname,
- html: ""
+ html: ""
});
var $label = $("", {html: fname});
- var $div = $("