mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
No more <img> in folders listing, using background instead. Hope IE will be happy with that...
This commit is contained in:
@@ -3,7 +3,7 @@ from django.utils.translation import ugettext as _
|
||||
|
||||
class ComposeMailForm(forms.Form):
|
||||
from_ = forms.CharField(label=_("From"))
|
||||
to = forms.CharField(label=_("To"), widget=forms.Textarea(attrs={'rows': 2, 'cols': 60}))
|
||||
cc = forms.CharField(label=_("Cc"), widget=forms.Textarea(attrs={'rows': 2, 'cols': 60}), required=False)
|
||||
to = forms.CharField(label=_("To"), widget=forms.Textarea())
|
||||
cc = forms.CharField(label=_("Cc"), widget=forms.Textarea(), required=False)
|
||||
subject = forms.CharField(label=_("Subject"), max_length=255)
|
||||
|
||||
|
||||
@@ -353,20 +353,20 @@ class ImapListing(EmailListing):
|
||||
if folders[fd] is not None:
|
||||
descr["path"] = folders[fd]["path"]
|
||||
if folders[fd]["sub"] != {}:
|
||||
descr["icon"] = "subfolders.png"
|
||||
descr["class"] = "subfolders"
|
||||
descr["sub"] = self.__parse_folders(folders[fd]["sub"])
|
||||
result += [descr]
|
||||
return result
|
||||
|
||||
def getfolders(self):
|
||||
md_folders = [{"name" : "INBOX", "icon" : "overview.png"},
|
||||
md_folders = [{"name" : "INBOX", "class" : "inbox"},
|
||||
{"name" : 'Drafts'},
|
||||
{"name" : 'Junk'},
|
||||
{"name" : parameters.get_user(self.user, "webmail",
|
||||
"SENT_FOLDER")},
|
||||
{"name" : parameters.get_user(self.user, "webmail",
|
||||
"TRASH_FOLDER"),
|
||||
"icon" : "trash.png"}]
|
||||
"class" : "trash"}]
|
||||
folders = self.mbc.listfolders(md_folders=md_folders)
|
||||
md_folders += self.__parse_folders(folders)
|
||||
for fd in md_folders:
|
||||
|
||||
@@ -61,19 +61,18 @@ tr.selected {
|
||||
}
|
||||
|
||||
.box li {
|
||||
clear: both;
|
||||
margin-bottom: 4px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.box li.selected {
|
||||
background: #ffffcc;
|
||||
background-color: #ffffcc;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.box a:link, .box a:visited {
|
||||
background: transparent;
|
||||
color: black;
|
||||
/*font-weight: bold;*/
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@@ -88,6 +87,22 @@ tr.selected {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
li.inbox {
|
||||
background: url("/static/pics/overview.png") no-repeat;
|
||||
}
|
||||
|
||||
li.trash {
|
||||
background: url("/static/pics/trash.png") no-repeat;
|
||||
}
|
||||
|
||||
li.folder {
|
||||
background: url("/static/pics/folder.png") no-repeat;
|
||||
}
|
||||
|
||||
li.subfolders {
|
||||
background: url("/static/pics/subfolders.png") no-repeat;
|
||||
}
|
||||
|
||||
th {
|
||||
/*-moz-box-shadow: 0px -15px 10px -10px rgba(0,0,0,0.6) inset;
|
||||
-webkit-box-shadow: 0px -15px 10px -10px rgba(0,0,0,0.6) inset;*/
|
||||
@@ -113,7 +128,6 @@ ul.visible {
|
||||
background: white;
|
||||
display: block;
|
||||
padding-bottom: 0;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
/* Compose mail page */
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
$$(obj.getParents("ul[class*=hidden]")).each(function(item) {
|
||||
item.removeClass("hidden");
|
||||
item.addClass("visible");
|
||||
$$("img[name=" + item.get("name") + "]").each(function(item) {
|
||||
item.set("src", "/static/pics/folder-open.png");
|
||||
$$("li[name=" + item.get("name") + "]").each(function(item) {
|
||||
item.setStyle("background", "url('/static/pics/folder-open.png') no-repeat");
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -115,17 +115,18 @@
|
||||
register_callback("folder", function(resp) {
|
||||
wm_updatelisting(resp);
|
||||
select($$("a[href=" + current_anchor.getbaseurl() + "]"));
|
||||
$$("img[class=clickable]").removeEvents();
|
||||
$$("img[class=clickable]").addEvent("click", function(evt) {
|
||||
$$("li[class*=clickable]").removeEvents();
|
||||
$$("li[class*=clickable]").addEvent("click", function(evt) {
|
||||
$$("ul[name=" + evt.target.get("name") + "]").each(function(item) {
|
||||
if (item.hasClass("hidden")) {
|
||||
evt.target.set("src", "/static/pics/folder-open.png");
|
||||
evt.target.setStyle("background", "url('/static/pics/folder-open.png') no-repeat");
|
||||
item.removeClass("hidden").addClass("visible");
|
||||
} else {
|
||||
evt.target.set("src", "/static/pics/subfolders.png");
|
||||
evt.target.setStyle("background", "url('/static/pics/subfolders.png') no-repeat");
|
||||
item.removeClass("visible").addClass("hidden");
|
||||
}
|
||||
});
|
||||
evt.stop();
|
||||
});
|
||||
searchbox_init();
|
||||
if (navparams.has("order")) {
|
||||
|
||||
@@ -102,11 +102,15 @@ def listing_menu(selection, folder, user):
|
||||
def print_folders(folders):
|
||||
result = ""
|
||||
for fd in folders:
|
||||
if fd.has_key("icon"):
|
||||
icon = fd["icon"]
|
||||
if fd.has_key("class"):
|
||||
cssclass = fd["class"]
|
||||
else:
|
||||
icon = "folder.png"
|
||||
result += "<li class='droppable'>\n"
|
||||
cssclass = "folder"
|
||||
name = ""
|
||||
if fd.has_key("sub"):
|
||||
cssclass += " clickable"
|
||||
name = fd["path"]
|
||||
result += "<li name='%s' class='droppable %s'>\n" % (name, cssclass)
|
||||
label = fd["name"]
|
||||
cssclass = ""
|
||||
if fd.has_key("unseen"):
|
||||
@@ -115,10 +119,10 @@ def print_folders(folders):
|
||||
result += "<a href='%s' class='%s' name='loadfolder'>%s</a>\n" \
|
||||
% (fd.has_key("path") and fd["path"] or fd["name"], cssclass, label)
|
||||
if fd.has_key("sub"):
|
||||
result += "<img name='%s' class='clickable' src='/static/pics/%s' />\n" \
|
||||
% (fd["path"], icon)
|
||||
#result += "<img name='%s' class='clickable' src='/static/pics/%s' />\n" \
|
||||
# % (fd["path"], icon)
|
||||
result += "<ul name='%s' class='hidden'>" % (fd["path"]) + print_folders(fd["sub"]) + "</ul>\n"
|
||||
else:
|
||||
result += "<img src='/static/pics/%s' />\n" % icon
|
||||
#else:
|
||||
# result += "<img src='/static/pics/%s' />\n" % icon
|
||||
result += "</li>\n"
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user