wip: UI refactoring

* Cleanup

see #204
This commit is contained in:
Antoine Nguyen
2012-04-22 10:58:44 +02:00
parent 89d946c8cf
commit 5f4b4dee5d
61 changed files with 30 additions and 25 deletions
+9 -5
View File
@@ -429,11 +429,12 @@ class IMAPconnector(object):
if len(topmailbox):
md_mailboxes = []
else:
md_mailboxes = [{"name" : "INBOX", "class" : "icon-home"},
md_mailboxes = [{"name" : "INBOX", "class" : "icon-inbox"},
{"name" : parameters.get_user(user, "DRAFTS_FOLDER"),
"class" : "icon-file"},
{"name" : 'Junk'},
{"name" : parameters.get_user(user, "SENT_FOLDER")},
{"name" : 'Junk', "class" : "icon-fire"},
{"name" : parameters.get_user(user, "SENT_FOLDER"),
"class" : "icon-envelope"},
{"name" : parameters.get_user(user, "TRASH_FOLDER"),
"class" : "icon-trash"}]
if until_mailbox:
@@ -600,9 +601,12 @@ class IMAPconnector(object):
if not r'\Seen' in data[int(uid)]['FLAGS']:
msg['style'] = 'unseen'
if r'\Answered' in data[int(uid)]['FLAGS']:
msg['img_flags'] = static_url('pics/answered.png')
msg['img_flags'] = [static_url('pics/answered.png')]
if r'$Forwarded' in data[int(uid)]['FLAGS']:
msg['img_flags'] = static_url('pics/forwarded.png')
if msg.has_key('img_flags'):
msg['img_flags'] += [static_url('pics/forwarded.png')]
else:
msg['img_flags'] = [static_url('pics/forwarded.png')]
bs = BodyStructure(data[int(uid)]['BODYSTRUCTURE'])
if bs.has_attachments():
msg['img_withatts'] = static_url('pics/attachment.png')
+1 -2
View File
@@ -28,7 +28,7 @@ class WMtable(tables.Table):
defvalue="%spics/grippy.png" % settings.MEDIA_URL,
header="<input type='checkbox' name='toggleselect' id='toggleselect' />"
)
flags = tables.ImgColumn("flags", width="2%")
flags = tables.ImgColumn("flags", width="4%")
withatts = tables.ImgColumn("withatts", width="2%")
subject = tables.Column("subject", label=__("Subject"), width="50%", limit=60)
from_ = tables.Column("from", width="20%", label=__("From"), limit=30)
@@ -427,7 +427,6 @@ def decode_payload(encoding, payload):
:param payload: the value to decode
:return: a string
"""
print payload
encoding = encoding.lower()
if encoding == "base64":
import base64
+8 -16
View File
@@ -1,3 +1,4 @@
# coding: utf-8
from django import template
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
@@ -20,33 +21,27 @@ def viewmail_menu(selection, folder, user, mail_id=None):
"label" : _("Back")},
{"name" : "reply",
"url" : "action=reply&mbox=%s&mailid=%s" % (folder, mail_id),
"img" : static_url("pics/reply.png"),
"img" : "icon-share",
"label" : _("Reply")},
{"name" : "replyall",
"url" : "action=reply&mbox=%s&mailid=%s&all=1" % (folder, mail_id),
"img" : static_url("pics/reply-all.png"),
"img" : "",
"label" : _("Reply all")},
{"name" : "forward",
"url" : "action=forward&mbox=%s&mailid=%s" % (folder, mail_id),
"img" : static_url("pics/alias.png"),
"img" : "icon-arrow-right",
"label" : _("Forward")},
{"name" : "delete",
"img" : static_url("pics/remove.png"),
"img" : "icon-trash",
"url" : reverse(webmail.views.delete) + "?mbox=%s&mailid=%s" % (folder, mail_id),
"label" : _("Delete")},
{"name" : "display_options",
"label" : _("Display options"),
"img" : static_url("pics/settings.png"),
"class" : "menubardropdown",
"menu" : [
{"name" : "activate_links",
"label" : _("Activate links"),
"url" : ""},
#reverse(webmail.views.viewmail, args=[folder, mail_id]) + "?links=1"},
"label" : _("Activate links")},
{"name" : "disable_links",
"label" : _("Disable links"),
"url" : ""}
#reverse(webmail.views.viewmail, args=[folder, mail_id]) + "?links=0"},
"label" : _("Disable links")}
]
}
]
@@ -80,7 +75,6 @@ def listmailbox_menu(selection, folder, user):
"label" : _("New message"),
"class" : "btn"},
{"name" : "mark",
"label" : _("Mark messages"),
"class" : "btn",
"menu" : [
@@ -93,14 +87,12 @@ def listmailbox_menu(selection, folder, user):
]
},
{"name" : "actions",
"img" : static_url("pics/settings.png"),
"label" : _("Actions"),
"class" : "btn",
"menu" : [
{"name" : "fdaction",
"label" : _("Compress folder"),
"img" : static_url("pics/compress.png"),
"url" : "compact/%s/" % folder},
"url" : "compact/%s/" % folder}
]
}
]