diff --git a/extensions/stats/templates/content.html b/extensions/stats/templates/content.html index 9ade9ee4d..41d7f141e 100644 --- a/extensions/stats/templates/content.html +++ b/extensions/stats/templates/content.html @@ -65,7 +65,8 @@ window.addEvent("domready", function() { if (p == "") { return; } - new Request.JSON({url : url + "?" + p, onSuccess : getgraph_callback}).get(); + new Request.JSON({url : url + "?" + p, noCache: true, + onSuccess : getgraph_callback}).get(); } {% if admin %} diff --git a/extensions/webmail/lib.py b/extensions/webmail/lib.py index 30f7b3554..00b7b5156 100644 --- a/extensions/webmail/lib.py +++ b/extensions/webmail/lib.py @@ -277,8 +277,9 @@ class IMAPconnector(object): def move(self, msgset, oldfolder, newfolder): self.m.select(self._encodefolder(oldfolder), True) - self.m.copy(msgset, newfolder) - self.m.store(msgset, "+FLAGS", "\\Deleted") + status, data = self.m.copy(msgset, self._encodefolder(newfolder)) + if status == 'OK': + self.m.store(msgset, "+FLAGS", "\\Deleted") def push_mail(self, folder, msg): now = imaplib.Time2Internaldate(time.time()) diff --git a/extensions/webmail/static/css/webmail.css b/extensions/webmail/static/css/webmail.css index 8ca29d45f..8da9f93fd 100644 --- a/extensions/webmail/static/css/webmail.css +++ b/extensions/webmail/static/css/webmail.css @@ -67,7 +67,6 @@ tr.selected { .box li.selected { background-color: #ffffcc; - position: relative; } .box a:link, .box a:visited { @@ -117,8 +116,8 @@ th.selected { cursor: move; } -.dragging { - background: #6AB0C5; +.box li.dragging { + background-color: #6AB0C5; } ul.hidden { @@ -126,7 +125,7 @@ ul.hidden { } ul.visible { - background: white; + background-color: white; display: block; padding-bottom: 0; } diff --git a/extensions/webmail/templates/index.html b/extensions/webmail/templates/index.html index a9fb1165f..c60ca284b 100644 --- a/extensions/webmail/templates/index.html +++ b/extensions/webmail/templates/index.html @@ -105,19 +105,14 @@ register_callback("forward", compose_callback); loadFolder = function(event, obj) { + event.stop(); if (!$defined(obj)) { obj = $(event.target); } - event.stop(); - // the following code prevents a bug under IE7 - // because fullpath is returned instead of a relative one. - // (even if mootools uses getAttribute("href", 2), this is not working with AJAX requests) - var url = obj.get("href"); - var baseurl = "http://" + location.host + location.pathname; - url = url.replace(baseurl, ""); - current_anchor.parse_string(url, true).setparams(navparams); + current_anchor.parse_string(gethref(obj), true).setparams(navparams); current_anchor.update(); } + register_callback("folder", function(resp) { wm_updatelisting(resp); select($$("a[href=" + current_anchor.getbaseurl() + "]")); @@ -200,7 +195,7 @@ return; } droppable.removeClass("dragging"); - dest = droppable.getFirst("a").get("href"); + dest = gethref(droppable.getFirst("a")); msgset = new Array(); selectedRows.each(function(item, index) { msgset.include(item.get("id")); @@ -229,10 +224,10 @@ $$("a[name=mark-unread]").addEvent("click", buildmarkrequest); $$("a[name=fdaction]").addEvent("click", function(evt) { - evt.stop(); new Request.JSON({url : evt.target.get("href"), onSuccess : get_callback("folder") }).get(); + evt.stop(); }); if ($("toggleselect")) { @@ -273,6 +268,7 @@ select(event.target); loadFolder(event, event.target); } + {% endblock %} {% block middletitle %}{% trans "Webmail" %}{% endblock %} {% block leftcol %} diff --git a/extensions/webmail/templatetags/webextras.py b/extensions/webmail/templatetags/webextras.py index 731b003db..17a8615c5 100644 --- a/extensions/webmail/templatetags/webextras.py +++ b/extensions/webmail/templatetags/webextras.py @@ -119,10 +119,6 @@ def print_folders(folders): result += "%s\n" \ % (fd.has_key("path") and fd["path"] or fd["name"], cssclass, label) if fd.has_key("sub"): - #result += "\n" \ - # % (fd["path"], icon) result += "\n" - #else: - # result += "\n" % icon result += "\n" return result diff --git a/extensions/webmail/views.py b/extensions/webmail/views.py index 411b2ff1b..62a973924 100644 --- a/extensions/webmail/views.py +++ b/extensions/webmail/views.py @@ -8,7 +8,6 @@ from django.utils import simplejson from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required -from django.views.decorators.cache import cache_control, never_cache from mailng.admin.models import Mailbox from mailng.lib import parameters, _render, _render_error, getctx, is_not_localadmin from mailng.lib.email_listing import parse_search_parameters @@ -25,7 +24,6 @@ def __get_current_url(request): @login_required @is_not_localadmin() -@cache_control(must_revalidate=True, private=True, no_cache=True) def folder(request, name, updatenav=True): if not name: name = "INBOX" @@ -68,7 +66,6 @@ def folder(request, name, updatenav=True): @login_required @is_not_localadmin() -@cache_control(must_revalidate=True, private=True, no_cache=True) def index(request): #try: navp = request.session.has_key("navparams") \ @@ -254,8 +251,6 @@ def send_mail(request, withctx=False, origmsg=None, posturl=None): @login_required @is_not_localadmin() -#@cache_control(no_cache=True, expires=-1) -@never_cache def compose(request): if request.method == "POST": return send_mail(request, posturl=reverse(compose)) diff --git a/static/js/common.js b/static/js/common.js index 69ab1e599..4730380f5 100644 --- a/static/js/common.js +++ b/static/js/common.js @@ -34,7 +34,7 @@ check_anchor = function() { query = current_anchor.serialized.substring(1); } infobox.show(gettext("Loading..."), "gray"); - new Request.JSON({url: query, onSuccess: function(resp) { + new Request.JSON({url: query, noCache : true, onSuccess: function(resp) { callback = ($defined(resp.callback)) ? resp.callback : "default"; callbacks[callback](resp); infobox.notice(gettext("Done")); @@ -110,7 +110,7 @@ function HashWrapper(deflocation) { }; this.update = function(force) { - window.location.hash = this.serialize(); + location.hash = this.serialize(); if ($defined(force)) { this.force = force; } @@ -321,3 +321,14 @@ searchbox_init = function() { }); $("searchbox").setStyle("float", "left"); } + +// The following code prevents a bug under IE7 because fullpath is +// returned instead of a relative one. (even if mootools uses +// getAttribute("href", 2), this is not working with AJAX +// requests) +gethref = function(obj) { + var url = obj.get("href"); + var baseurl = "http://" + location.host + location.pathname; + + return url.replace(baseurl, ""); +} \ No newline at end of file