From 31f64c0b4e7377a135a0a570b3f95ce2d8088153 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Sat, 30 Aug 2014 17:08:16 +0200 Subject: [PATCH] More work around bootstrap 3 integration. see #585 --- modoboa/core/tables.py | 1 + .../extensions/admin/static/admin/js/admin.js | 4 + .../admin/templates/admin/identities.html | 2 +- .../admin/templatetags/admin_tags.py | 9 +- .../amavis/static/amavis/css/quarantine.css | 2 +- .../amavis/static/amavis/js/quarantine.js | 3 +- .../amavis/templates/amavis/index.html | 8 +- modoboa/extensions/amavis/views.py | 5 +- .../radicale/templatetags/radicale_tags.py | 4 +- .../extensions/stats/static/stats/js/stats.js | 34 ++++-- .../stats/templates/stats/index.html | 115 +++++++++--------- modoboa/extensions/webmail/lib/listing.py | 12 +- modoboa/extensions/webmail/lib/tables.py | 48 -------- .../webmail/static/webmail/css/webmail.css | 50 +++++--- .../webmail/static/webmail/js/webmail.js | 82 ++++++------- .../webmail/templates/webmail/folders.html | 11 +- .../webmail/templates/webmail/index.html | 14 ++- .../webmail/templatetags/webmail_tags.py | 36 +++--- modoboa/lib/tables.py | 4 +- modoboa/static/css/custom.css | 32 ++--- modoboa/static/js/global.js | 6 +- modoboa/templates/fluid.html | 2 + modoboa/templates/nlayout.html | 2 +- modoboa/templates/twocols.html | 2 +- 24 files changed, 243 insertions(+), 245 deletions(-) delete mode 100644 modoboa/extensions/webmail/lib/tables.py diff --git a/modoboa/core/tables.py b/modoboa/core/tables.py index e35868cab..78a730983 100644 --- a/modoboa/core/tables.py +++ b/modoboa/core/tables.py @@ -4,6 +4,7 @@ from modoboa.lib import tables class ExtensionsTable(tables.Table): idkey = "id" + styles = "table-hover" selection = tables.SelectionColumn("selection", width="4%", header=False) label = tables.Column("label", label=ugettext_lazy("Name"), width="15%") version = tables.Column( diff --git a/modoboa/extensions/admin/static/admin/js/admin.js b/modoboa/extensions/admin/static/admin/js/admin.js index a56bd6fc6..33162d160 100644 --- a/modoboa/extensions/admin/static/admin/js/admin.js +++ b/modoboa/extensions/admin/static/admin/js/admin.js @@ -203,6 +203,10 @@ Identities.prototype = { page_loader: function(e) { var $link = get_target(e); e.preventDefault(); + if ($link.hasClass("navigation")) { + $(".sidebar li.active").removeClass("active"); + $link.parent().addClass("active"); + } this.navobj.baseurl($link.attr("href")).update(); }, diff --git a/modoboa/extensions/admin/templates/admin/identities.html b/modoboa/extensions/admin/templates/admin/identities.html index 632a6f31c..1964d5931 100644 --- a/modoboa/extensions/admin/templates/admin/identities.html +++ b/modoboa/extensions/admin/templates/admin/identities.html @@ -22,4 +22,4 @@ $(document).ready(function() { {% extra_static_content "identities" user %} {% endblock %} -{% block actions %}{% identities_menu user %}{% endblock %} +{% block actions %}{% identities_menu user "identities" %}{% endblock %} diff --git a/modoboa/extensions/admin/templatetags/admin_tags.py b/modoboa/extensions/admin/templatetags/admin_tags.py index e1a079506..d85322c96 100644 --- a/modoboa/extensions/admin/templatetags/admin_tags.py +++ b/modoboa/extensions/admin/templatetags/admin_tags.py @@ -60,7 +60,7 @@ def domains_menu(selection, user): @register.simple_tag -def identities_menu(user): +def identities_menu(user, selection=None): """Menu specific to the Identities page. :param ``User`` user: the connecter user @@ -71,12 +71,12 @@ def identities_menu(user): {"name": "identities", "label": _("List identities"), "img": "glyphicon glyphicon-user", - "class": "ajaxlink", + "class": "ajaxlink navigation", "url": "list/"}, {"name": "quotas", "label": _("List quotas"), "img": "glyphicon glyphicon-hdd", - "class": "ajaxlink", + "class": "ajaxlink navigation", "url": "quotas/"}, {"name": "newaccount", "label": _("Add account"), @@ -119,7 +119,8 @@ def identities_menu(user): return render_to_string('common/menulist.html', { "entries": entries, - "user": user + "user": user, + "selection": selection }) diff --git a/modoboa/extensions/amavis/static/amavis/css/quarantine.css b/modoboa/extensions/amavis/static/amavis/css/quarantine.css index 07133c6bc..c5e08286e 100644 --- a/modoboa/extensions/amavis/static/amavis/css/quarantine.css +++ b/modoboa/extensions/amavis/static/amavis/css/quarantine.css @@ -40,7 +40,7 @@ margin: 0; } -#listing.fluid-content-quarantine{ +#listing.fluid-content-quarantine { position: relative; padding-top: 30px; height: 0; diff --git a/modoboa/extensions/amavis/static/amavis/js/quarantine.js b/modoboa/extensions/amavis/static/amavis/js/quarantine.js index 9b9517c1b..0807a667b 100644 --- a/modoboa/extensions/amavis/static/amavis/js/quarantine.js +++ b/modoboa/extensions/amavis/static/amavis/js/quarantine.js @@ -286,7 +286,8 @@ Quarantine.prototype = { viewmail_cb: function(data) { this.update_page(data); - $("#listing").css("overflow", "hidden"); + /*$("#listing").css("overflow", "hidden");*/ + $("body").css("overflow", "hidden"); }, action_cb: function(data) { diff --git a/modoboa/extensions/amavis/templates/amavis/index.html b/modoboa/extensions/amavis/templates/amavis/index.html index 7bdfd3779..cad7f7ca7 100644 --- a/modoboa/extensions/amavis/templates/amavis/index.html +++ b/modoboa/extensions/amavis/templates/amavis/index.html @@ -19,6 +19,10 @@ $(document).ready(function() { {% endblock %} {% block fixed_content %} - -
+
+ +
+
+
+
{% endblock %} diff --git a/modoboa/extensions/amavis/views.py b/modoboa/extensions/amavis/views.py index 8a3284004..92f811b0a 100644 --- a/modoboa/extensions/amavis/views.py +++ b/modoboa/extensions/amavis/views.py @@ -1,12 +1,13 @@ # coding: utf-8 import email + from django.shortcuts import render from django.http import HttpResponseRedirect, Http404 from django.template import Template, Context from django.utils.translation import ugettext as _, ungettext from django.core.urlresolvers import reverse -from django.contrib.auth.decorators \ - import login_required, user_passes_test +from django.contrib.auth.decorators import login_required + from modoboa.lib import parameters from modoboa.lib.exceptions import BadRequest from modoboa.lib.webutils import ( diff --git a/modoboa/extensions/radicale/templatetags/radicale_tags.py b/modoboa/extensions/radicale/templatetags/radicale_tags.py index b80fa3a0e..29ccd4ed1 100644 --- a/modoboa/extensions/radicale/templatetags/radicale_tags.py +++ b/modoboa/extensions/radicale/templatetags/radicale_tags.py @@ -22,7 +22,7 @@ def radicale_left_menu(user): entries = [ {"name": "newusercalendar", "label": _("Add calendar"), - "img": "icon-plus", + "img": "glyphicon glyphicon-plus", "modal": True, "modalcb": "radicale.add_calendar_cb", "url": reverse("new_user_calendar")}, @@ -31,7 +31,7 @@ def radicale_left_menu(user): entries += [ {"name": "newsharedcalendar", "label": _("Add shared calendar"), - "img": "icon-plus", + "img": "glyphicon glyphicon-plus", "modal": True, "modalcb": "radicale.shared_calendar_cb", "url": reverse("new_shared_calendar")}, diff --git a/modoboa/extensions/stats/static/stats/js/stats.js b/modoboa/extensions/stats/static/stats/js/stats.js index d81027ccb..d54a55e25 100644 --- a/modoboa/extensions/stats/static/stats/js/stats.js +++ b/modoboa/extensions/stats/static/stats/js/stats.js @@ -7,7 +7,8 @@ Stats.prototype = { defaults: { deflocation: "graphs/", - language: "en" + language: "en", + domain_list_url: null }, initialize: function(options) { @@ -17,19 +18,19 @@ Stats.prototype = { var navobj = new History(this.options); this.navobj = navobj; - if (navobj.params.searchquery != undefined) { + if (navobj.params.searchquery !== undefined) { $("#searchquery").val(navobj.params.searchquery); } $("#searchquery").focus(function() { var $this = $(this); - if ($this.val() == undefined) { + if ($this.val() === undefined) { return; } $this.data("oldvalue", $this.val()); $this.val(""); }).blur(function() { var $this = $(this); - if ($this.val() == "") { + if ($this.val() === "") { if ($this.data("oldvalue")) { $this.val($this.data('oldvalue')); $this.data("oldvalue", null); @@ -52,7 +53,7 @@ Stats.prototype = { language: this.options.language }); $("#searchquery").autocompleter({ - choices: get_domains_list, + choices: $.proxy(this.get_domain_list, this), choice_selected: $.proxy(this.search_domain, this), empty_choice: $.proxy(this.reset_search, this) }); @@ -72,9 +73,25 @@ Stats.prototype = { $.proxy(this.charts_cb, this)); }, + /** + * Retrieve a list of domain from the server. + */ + get_domain_list: function() { + var result; + + $.ajax({ + url: this.options.domain_list_url, + dataType: "json", + async: false + }).done(function(data) { + result = data; + }); + return result; + }, + change_period: function(e) { e.preventDefault(); - var $link = $(e.target); + var $link = $(e.target).children("input"); this.navobj.delparam("start").delparam("end"); this.navobj.setparam("period", $link.attr("data-period")).update(); @@ -99,6 +116,9 @@ Stats.prototype = { * @param {Object} data */ charts_cb: function(data) { + var menuid = "menu_" + this.navobj.getparam("gset"); + + $("#" + menuid).addClass("active"); this.data = data; if (this.charts !== undefined) { $.each(this.charts, function(id, mychart) { @@ -128,7 +148,7 @@ Stats.prototype = { var $fromdate = $("#id_from"); var $todate = $("#id_to"); - if ($fromdate.val() == "" || $todate.val() == "") { + if ($fromdate.val() === "" || $todate.val() === "") { return; } this.navobj.setparams({ diff --git a/modoboa/extensions/stats/templates/stats/index.html b/modoboa/extensions/stats/templates/stats/index.html index 633083d5e..c22a6753b 100644 --- a/modoboa/extensions/stats/templates/stats/index.html +++ b/modoboa/extensions/stats/templates/stats/index.html @@ -9,15 +9,10 @@ {% endblock %} {% block leftcol %} -
- -
-
- - -
-
- -
-
-
- -
- -
- + +
+ +
+
+ {% for p in periods %} + + {% endfor %}
-{% endblock %} -{% block apparea %} -
- {% endfor %} -
{% for id, gset in graph_sets.items %} -
-
-
-
{% endfor %} + + + +
+ {% for id, gset in graph_sets.items %} +
+
+
+ {% endfor %} +
+ {% endblock %} - diff --git a/modoboa/extensions/webmail/lib/listing.py b/modoboa/extensions/webmail/lib/listing.py index 6a49fa149..c17f544b6 100644 --- a/modoboa/extensions/webmail/lib/listing.py +++ b/modoboa/extensions/webmail/lib/listing.py @@ -7,11 +7,11 @@ from . import IMAPconnector, imapheader class WMtable(tables.Table): - """ - Webmail listing table. - """ + + """Webmail listing table.""" + tableid = "emails" - styles = "table-condensed" + styles = "table-hover" idkey = "imapid" drag = tables.ImgColumn( "drag", cssclass="draggable left", width="1%", @@ -24,7 +24,7 @@ class WMtable(tables.Table): flags = tables.ImgColumn("flags", width="3%") withatts = tables.ImgColumn("withatts", width="2%") subject = tables.Column( - "subject", label=ugettext_lazy("Subject"), width="50%", limit=60, + "subject", label=ugettext_lazy("Subject"), limit=60, cssclass="openable" ) from_ = tables.Column( @@ -36,7 +36,7 @@ class WMtable(tables.Table): ) cols_order = [ - "drag", "selection", "withatts", "flags", "subject", "from_", "date" + "drag", "selection", "flags", "from_", "subject", "withatts", "date" ] def parse(self, header, value): diff --git a/modoboa/extensions/webmail/lib/tables.py b/modoboa/extensions/webmail/lib/tables.py deleted file mode 100644 index 4830c6799..000000000 --- a/modoboa/extensions/webmail/lib/tables.py +++ /dev/null @@ -1,48 +0,0 @@ -from django.conf import settings -from django.utils.translation import ugettext_lazy - -from modoboa.lib import tables -from . import imapheader - - -class WMtable(tables.Table): - """ - The webmail listing. - """ - tableid = "emails" - styles = "table-condensed" - idkey = "imapid" - drag = tables.ImgColumn( - "drag", cssclass="draggable left", width="1%", - defvalue="%spics/grippy.png" % settings.STATIC_URL, - header="" - ) - selection = tables.SelectionColumn( - "selection", safe=True, width='1%', header=None, sortable=False - ) - flags = tables.ImgColumn("flags", width="3%") - withatts = tables.ImgColumn("withatts", width="2%") - subject = tables.Column( - "subject", label=ugettext_lazy("Subject"), width="50%", limit=60, - cssclass="openable" - ) - from_ = tables.Column( - "from", width="20%", label=ugettext_lazy("From"), limit=30, - cssclass="openable" - ) - date = tables.Column( - "date", width="15%", label=ugettext_lazy("Date"), cssclass="openable" - ) - - cols_order = [ - "drag", "selection", "withatts", "flags", "subject", "from_", "date" - ] - - def parse(self, header, value): - if value is None: - return "" - try: - value = getattr(imapheader, "parse_%s" % header)(value) - except AttributeError: - pass - return value diff --git a/modoboa/extensions/webmail/static/webmail/css/webmail.css b/modoboa/extensions/webmail/static/webmail/css/webmail.css index 41a3cf352..aa5b1961b 100644 --- a/modoboa/extensions/webmail/static/webmail/css/webmail.css +++ b/modoboa/extensions/webmail/static/webmail/css/webmail.css @@ -53,14 +53,18 @@ } - /* GENERAL */ +/* GENERAL */ body, html { - overflow: hidden; + /*overflow: hidden;*/ +} + +#rightcol { +/* padding-top: 20px;*/ } #folders { - position: fixed; - top: 73px; + /*position: fixed; + top: 73px;*/ overflow-y: auto; margin-bottom: 5px; } @@ -91,9 +95,14 @@ body, html { } #mboxes_container { - overflow: auto; + /*overflow: auto;*/ } +.nav-sidebar > li > a { + padding-top: 5px; + padding-bottom: 5px; +} + #mboxes_container a[name=loadfolder] { white-space: nowrap; overflow: hidden; @@ -138,13 +147,14 @@ td[name="date"] { /* *listing */ -#listing{ +#listing { overflow: auto; + padding-top: 60px; } -#listing.listing-up-1198{ +#listing.listing-up-1198 { padding-left: 15px; } -#listing.listing-less-1198{ +#listing.listing-less-1198 { bottom: 0px; left: 0px; padding-left: 0px; @@ -153,7 +163,7 @@ td[name="date"] { overflow-y: hidden; } -#listing .test{ +#listing .test { overflow-y: scroll; position: absolute; left: 0; @@ -172,10 +182,11 @@ td[name="date"] { div.clickbox { position: absolute; - left: 0px; - top: 2px; + left: 15px; + top: 5px; width: 14px; height: 14px; + z-index: 100; } div.collapsed { @@ -243,6 +254,7 @@ li.droppable li{ #body_container { position: static; + /*height: 600px;*/ } #id_body { @@ -309,6 +321,13 @@ td[class*=openable] { *Action buttons */ +#menubar { + background-color: #fff; + position: fixed; + padding-top: 20px; + z-index: 100; +} + #menubar .btn-toolbar ul.navbar-right{ margin-right: 3%; } @@ -328,12 +347,3 @@ td[class*=openable] { #menubar .md-margin-left-back{ margin-left: 16px; } - - -/* - *send mail - */ - -#body_container{ - height: 600px; -} diff --git a/modoboa/extensions/webmail/static/webmail/js/webmail.js b/modoboa/extensions/webmail/static/webmail/js/webmail.js index 1fe5651ae..36de81c9e 100644 --- a/modoboa/extensions/webmail/static/webmail/js/webmail.js +++ b/modoboa/extensions/webmail/static/webmail/js/webmail.js @@ -52,32 +52,31 @@ Webmail.prototype = { $("#leftcol").addClass( "leftcol-display-none" ); - $("#listing").addClass( - "col-lg-12 col-md-12 col-ms-12 col-xs-12" - ); $("#listing").css({ height: $(window).height() - 150 + 'px' }); } if ($(window).width() > 1198) { - $("#folders").css({ + /*$("#folders").css({ bottom: $("#bottom-bar").outerHeight(true) + 10, width: this.options.mboxes_col_width + 'px' - }); + });*/ + /*$("#folders").innerWidth(this.options.mboxes_col_width);*/ $("#listing").addClass( "listing-up-1198" ); - $("#listing").css({ - height: $(window).height() - 180 + 'px' - }); - $("#rightcol").css({ + /*$("#listing").css({ + height: $(window).height() - 180 + 'px' + });*/ + + /*$("#rightcol").css({ marginLeft: 200 + 'px', paddingRight: 90 + 'px' - }); + });*/ } /* Responsive -> on resizing window */ @@ -102,34 +101,26 @@ Webmail.prototype = { $("#listing").addClass( "col-lg-12 col-md-12 col-ms-12 col-xs-12" ); - $("#listing").css({ + /*$("#listing").css({ height: $(window).height() - 150 + 'px' - }); + });*/ $("#listing").removeClass( "listing-up-1198" ); - $("#rightcol").css({ - marginLeft: 0 + 'px', - paddingRight: 0 + 'px' - }); } if ($(window).width() > 1198) { $("#folders").css({ - bottom: $("#bottom-bar").outerHeight(true) + 10, + /*bottom: $("#bottom-bar").outerHeight(true) + 10,*/ width: that.options.mboxes_col_width + 'px' }); $("#listing").addClass( "listing-up-1198" ); - $("#listing").css({ - height: $(window).height() - 180 + 'px' - }); - - $("#rightcol").css({ - marginLeft: 200 + 'px', - paddingRight: 90 + 'px' - }); + //$("#listing").height($(window).height()); + // $("#listing").css({ + // height: $(window).height() + 'px' + // }); } }); @@ -150,20 +141,20 @@ Webmail.prototype = { resize: function(event, ui) { if ($(window).width() > 1198) { var width = ui.size.width; - $("#rightcol").css({ + /*$("#rightcol").css({ marginLeft: width + 'px' - }); + });*/ $("#folders").css({ width : width + 'px' }); - $("#rightcol").css({ + /*$("#rightcol").css({ paddingRight: width - 110 + 'px' }); if ($(window).width() < 1800) { $("#rightcol").css({ paddingRight: width - 110 + 'px' }); - } + }*/ } } }); @@ -231,8 +222,8 @@ Webmail.prototype = { }, resize: function() { - $("#mboxes_container").height( - $("#folders").height() - $("#mboxactions").height()); + /*$("#mboxes_container").height( + $("#folders").height() - $("#mboxactions").height());*/ }, /* @@ -308,7 +299,7 @@ Webmail.prototype = { break; } } - if (response.menu != undefined) { + if (response.menu !== undefined) { $("#menubar").html(response.menu); $("#searchfield").searchbar({navobj: this.navobject}); } @@ -317,6 +308,7 @@ Webmail.prototype = { $("#pagination-responsive").html(response.navbar); } $("#listing").html(response.listing); + $("body").css("overflow", "auto"); }, /* @@ -328,8 +320,8 @@ Webmail.prototype = { if (this.poller.running_request) { return; } - if (this.unseen_counters[mailbox] != undefined - && value == this.unseen_counters[mailbox]) { + if (this.unseen_counters[mailbox] !== undefined && + value == this.unseen_counters[mailbox]) { return; } @@ -372,7 +364,7 @@ Webmail.prototype = { * the left tree). */ get_visible_mailboxes: function() { - var res = new Array(); + var res = []; $("#folders").find("ul:visible").children("li.droppable").each(function() { res.push(encodeURIComponent($(this).attr("name"))); @@ -416,7 +408,7 @@ Webmail.prototype = { $li.append($link); $parent.append($li); - if (unseen != undefined) { + if (unseen !== undefined) { $link.addClass("unseen"); $link.html(displayname + " (" + unseen + ")"); this.unseen_counters[$link.attr("href")] = unseen; @@ -432,7 +424,7 @@ Webmail.prototype = { inject_mailboxes: function($parent, mboxes) { var $ul = $("
    ", { name: $parent.attr("name"), - 'class': "hidden nav nav-pills nav-stacked" + 'class': "hidden nav nav-sidebar" }); var $plink = $parent.children("a"); @@ -445,7 +437,7 @@ Webmail.prototype = { continue; } this.inject_mailbox($ul, mboxes[i].name, $plink.attr("name"), mboxes[i].unseen); - if (mboxes[i].sub != undefined) { + if (mboxes[i].sub !== undefined) { this.inject_clickbox($('li[name="' + mboxes[i].name + '"]')); } } @@ -464,7 +456,7 @@ Webmail.prototype = { url: this.options.submboxes_url, dataType: 'json', async: async, - data: "topmailbox=" + parent.attr("name") + data: "topmailbox=" + parent.parents("li").attr("name") }).done($.proxy(function(data) { this.inject_mailboxes(parent, data); }, this)); @@ -941,19 +933,18 @@ Webmail.prototype = { this.resize_editor(); }, this)); } - if (resp.id != undefined) { + if (resp.id !== undefined) { this.navobject.setparam("id", resp.id).update(false, true); } this.position_body(); }, position_body: function() { - var $mailheader = $("#mailheader"); - var top = $mailheader.outerHeight(true); + var $container = $("#body_container"); + var top = $container.offset().top; + var bottom = $("#bottom-bar").offset().top; - $("#body_container").css({ - height: $(window).height() * 0.58 + "px" - }); + $("#body_container").height(bottom - top - 30); }, /* @@ -962,6 +953,7 @@ Webmail.prototype = { viewmail_callback: function(resp) { this.page_update(resp); $("#listing").css("overflow", "hidden"); + $("body").css("overflow", "hidden"); $("a[name=close]").click($.proxy(function(e) { e.preventDefault(); this.go_back_to_listing(); diff --git a/modoboa/extensions/webmail/templates/webmail/folders.html b/modoboa/extensions/webmail/templates/webmail/folders.html index e961ac02f..00f94f58b 100644 --- a/modoboa/extensions/webmail/templates/webmail/folders.html +++ b/modoboa/extensions/webmail/templates/webmail/folders.html @@ -1,8 +1,7 @@ {% load i18n webmail_tags %} -
    - -
    + + +
    {% mboxes_menu %}
    diff --git a/modoboa/extensions/webmail/templates/webmail/index.html b/modoboa/extensions/webmail/templates/webmail/index.html index 849b2f725..a8c5b2b11 100644 --- a/modoboa/extensions/webmail/templates/webmail/index.html +++ b/modoboa/extensions/webmail/templates/webmail/index.html @@ -33,11 +33,17 @@ $(document).ready(function() { {% block fixed_content %}
    -
    - -
    +
    +
    + +
    +
    +
    +
    {% endblock %} diff --git a/modoboa/extensions/webmail/templatetags/webmail_tags.py b/modoboa/extensions/webmail/templatetags/webmail_tags.py index 6f0599dfc..28988a818 100644 --- a/modoboa/extensions/webmail/templatetags/webmail_tags.py +++ b/modoboa/extensions/webmail/templatetags/webmail_tags.py @@ -141,6 +141,17 @@ def print_mailboxes(tree, selected=None, withunseen=False, selectonly=False, hde elif selected == name: cssclass = "active" result += "
  • \n" % (name, cssclass) + cssclass = "block" + extra_attrs = "" + if withunseen and "unseen" in mbox: + label += " (%d)" % mbox["unseen"] + cssclass += " unseen" + extra_attrs = ' data-toggle="%d"' % mbox["unseen"] + + result += "" % ( + "path" in mbox and mbox["path"] or mbox["name"], cssclass, + 'selectfolder' if selectonly else 'loadfolder', extra_attrs + ) if "sub" in mbox: if selected is not None and selected != name and selected.count(name): ul_state = "visible" @@ -150,24 +161,15 @@ def print_mailboxes(tree, selected=None, withunseen=False, selectonly=False, hde div_state = "collapsed" result += "
    " % div_state - cssclass = "block" - extra_attrs = "" - if withunseen and "unseen" in mbox: - label += " (%d)" % mbox["unseen"] - cssclass += " unseen" - extra_attrs = ' data-toggle="%d"' % mbox["unseen"] - iclass = mbox["class"] if "class" in mbox else "glyphicon glyphicon-folder-close" - result += """
    - - %s - -""" % ("path" in mbox and mbox["path"] or mbox["name"], cssclass, - 'selectfolder' if selectonly else 'loadfolder', - extra_attrs, iclass, label) + iclass = mbox["class"] if "class" in mbox \ + else "glyphicon glyphicon-folder-close" + result += " %s" % (iclass, label) - if "sub" in mbox and len(mbox["sub"]): - result += "\n" + if "sub" in mbox and mbox["sub"]: + result += "\n" result += "
  • \n" return result diff --git a/modoboa/lib/tables.py b/modoboa/lib/tables.py index 3a0950652..46ea25236 100644 --- a/modoboa/lib/tables.py +++ b/modoboa/lib/tables.py @@ -9,10 +9,12 @@ output (using standard tags like and co.). """ import inspect + from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django.template import Template, RequestContext, Context -from templatetags.lib_tags import render_link + +from .templatetags.lib_tags import render_link class Column(object): diff --git a/modoboa/static/css/custom.css b/modoboa/static/css/custom.css index 363a360ed..e2c95b0f2 100644 --- a/modoboa/static/css/custom.css +++ b/modoboa/static/css/custom.css @@ -53,8 +53,8 @@ .sidebar { position: fixed; - top: 52px; - bottom: 0; + top: 51px; + bottom: 51px; left: 0; z-index: 1000; display: block; @@ -104,13 +104,16 @@ /* Global */ +body { + padding-top: 50px; +} -h5{ - font-size:15px; +h5 { + font-size: 15px; font-weight: bold; } -label{ +label { font-weight: normal; } @@ -233,22 +236,21 @@ html body div.navbar div.container-fluid div#navigate-navbar-collapse.collapse u margin-bottom: 4px; } +.main { + padding: 20px; +} /* listing */ - #listing{ - margin-bottom:60px; - } - - .table > thead > tr > th { - border-bottom: 2px solid #FBFBFB; - } +#listing { + /*margin-bottom:60px;*/ +} /* Bottom navBar*/ - .nav-bottom { +.nav-bottom { margin-top: 80px; - } +} #bottom-bar-middle { text-align: center; @@ -261,7 +263,7 @@ html body div.navbar div.container-fluid div#navigate-navbar-collapse.collapse u .navbar-text { color: #999999 !important; float:none; - } +} .simplepagination ul { margin-bottom: 0; diff --git a/modoboa/static/js/global.js b/modoboa/static/js/global.js index 8faabc6d8..d40dafb55 100644 --- a/modoboa/static/js/global.js +++ b/modoboa/static/js/global.js @@ -224,7 +224,7 @@ function gethref(obj) { * http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript */ function parse_qs(raw) { - if (raw == "") return {}; + if (raw === "") return {}; var res = {}; for (var i = 0; i < raw.length; i++) { @@ -242,11 +242,11 @@ function parse_qs(raw) { * Ref: http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript */ function get_parameter_by_name(url, name) { - var name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); + name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(url); - return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); + return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } /* diff --git a/modoboa/templates/fluid.html b/modoboa/templates/fluid.html index 98ce7df7f..05ece2737 100644 --- a/modoboa/templates/fluid.html +++ b/modoboa/templates/fluid.html @@ -1,6 +1,8 @@ {% extends "nlayout.html" %} {% block content %}
    +
    {% block rowcontent %}{% endblock %} +
    {% endblock %} diff --git a/modoboa/templates/nlayout.html b/modoboa/templates/nlayout.html index a73727acf..12e4aa22b 100644 --- a/modoboa/templates/nlayout.html +++ b/modoboa/templates/nlayout.html @@ -37,7 +37,7 @@ {% block html_head %}{% endblock %} -