More work around bootstrap 3 integration.

see #585
This commit is contained in:
Antoine Nguyen
2014-08-30 17:08:16 +02:00
parent cc917aae24
commit 31f64c0b4e
24 changed files with 243 additions and 245 deletions
+1
View File
@@ -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(
@@ -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();
},
@@ -22,4 +22,4 @@ $(document).ready(function() {
</script>
{% extra_static_content "identities" user %}
{% endblock %}
{% block actions %}{% identities_menu user %}{% endblock %}
{% block actions %}{% identities_menu user "identities" %}{% endblock %}
@@ -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
})
@@ -40,7 +40,7 @@
margin: 0;
}
#listing.fluid-content-quarantine{
#listing.fluid-content-quarantine {
position: relative;
padding-top: 30px;
height: 0;
@@ -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) {
@@ -19,6 +19,10 @@ $(document).ready(function() {
</script>
{% endblock %}
{% block fixed_content %}
<div id="menubar">{% quar_menu %}</div>
<div id="listing" class="col-lg-12 col-md-12 col-dm-12 col-xs-12"></div>
<div class="row" style="padding-top: 20px">
<div id="menubar">{% quar_menu %}</div>
</div>
<div class="row">
<div id="listing" class="col-lg-12 col-md-12 col-dm-12 col-xs-12"></div>
</div>
{% endblock %}
+3 -2
View File
@@ -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 (
@@ -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")},
@@ -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({
@@ -9,15 +9,10 @@
<script type="text/javascript" src="{{ STATIC_URL }}stats/js/graphic.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}stats/js/stats.js"></script>
<script type="text/javascript">
function get_domains_list(container) {
$.getJSON("{% url 'modoboa.extensions.admin.views.domain.domains_list' %}", function(data) {
container.value = data;
});
}
$(document).ready(function() {
var stats = new Stats({
graphurl: "{% url 'modoboa.extensions.stats.views.graphs' %}",
domain_list_url: "{% url 'modoboa.extensions.admin.views.domain.domains_list' %}",
deflocation: "{{ deflocation|safe }}",
language: "{{ LANGUAGE_CODE }}"
});
@@ -25,61 +20,65 @@ $(document).ready(function() {
</script>
{% endblock %}
{% block leftcol %}
<div id="periods">
<ul class="nav nav-sidebar">
<li class="nav-header">
{% trans "Filter" %}
</li>
<li>
<div class="input-group input-group-sm">
<span class="input-group-addon">
<span class="glyphicon glyphicon-search"></span>
</span>
<input class="form-control" id="searchquery" type="text" value="{% trans 'Search a domain' %}">
<ul class="nav nav-sidebar">
{% for id, gset in graph_sets.items %}
<li id="menu_{{ gset.html_id }}"><a href="#">{{ gset.title }}</a></li>
{% endfor %}
</ul>
{% endblock %}
{% block apparea %}
<div class="row">
<div class="col-sm-5">
<form class="form-horizontal" role="form">
<div class="form-group has-feedback">
<div class="col-sm-12">
<input class="form-control" id="searchquery" type="text" value="{% trans 'Search a domain' %}">
<span class="glyphicon glyphicon-search form-control-feedback"></span>
</div>
</div>
</li>
<li class="nav-header">
{% trans "Predefined time ranges" %}
</li>
{% for p in periods %}<li class="period">
<a href="#" class="period_selector" data-period="{{ p.name }}">{% trans p.label %}</a>
</li>
{% endfor %}
<li class="nav-header">
{% trans "Custom time range" %}
</li>
</ul>
<div class="row">
<div class="col-md-12">
<form class="form-horizontal">
<span id="custom-period">
<div class="input-group input-group-sm">
<div class="input-group-addon"><span class="glyphicon glyphicon-indent-left"></span></div>
<input id="id_from" class="col-lg-10 form-control" name="date_from" value="{{ start }}" type="text" readonly="readonly" />
</div>
<div class="input-group input-group-sm">
<div class="input-group-addon"><span class="glyphicon glyphicon-indent-right"></span></div>
<input id="id_to" class="col-lg-10 form-control" name="date_to" value="{{ end }}" type="text" readonly="readonly" />
</div>
<button class="btn btn-primary pull-right" id="customsend">{% trans "Apply" %}</button>
</span>
</form>
</form>
</div>
<div class="col-md-3">
<div class="btn-group" data-toggle="buttons">
{% for p in periods %}
<label class="btn btn-primary period_selector">
<input type="radio" data-period="{{ p.name }}"> {% trans p.label %}
</label>
{% endfor %}
</div>
</div>
</div>
{% endblock %}
{% block apparea %}
<div id="graphs" class="tabbable">
<ul class="nav nav-tabs">{% for id, gset in graph_sets.items %}
<li {% if forloop.first %}class="active"{% endif %}>
<a href="#graphs_{{ gset.html_id }}" data-toggle="tab">{{ gset.title }}</a>
</li>
</ul>{% endfor %}
<div class="tab-content">{% for id, gset in graph_sets.items %}
<div class="tab-pane {% if forloop.first %}active{% endif %}" id="graphs_{{ gset.html_id }}">
<div id="gset"></div>
</div>
</div>{% endfor %}
<div class="row hidden">
<div class="col-md-7">
<form class="form-inline">
<span id="custom-period">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-indent-left"></span></div>
<input id="id_from" class="form-control" name="date_from" value="{{ start }}" type="text" readonly="readonly" />
</div>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><span class="glyphicon glyphicon-indent-right"></span></div>
<input id="id_to" class="form-control" name="date_to" value="{{ end }}" type="text" readonly="readonly" />
</div>
</div>
<button class="btn btn-primary" id="customsend">{% trans "Apply" %}</button>
</span>
</form>
</div>
</div>
<div id="graphs">
{% for id, gset in graph_sets.items %}
<div class="tab-pane {% if forloop.first %}active{% endif %}" id="graphs_{{ gset.html_id }}">
<div id="gset"></div>
</div>
{% endfor %}
</div>
{% endblock %}
+6 -6
View File
@@ -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):
-48
View File
@@ -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="<input type='checkbox' name='toggleselect' id='toggleselect' />"
)
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
@@ -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;
}
@@ -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 = $("<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();
@@ -1,8 +1,7 @@
{% load i18n webmail_tags %}
<div id="mboxes_container">
<ul class="nav nav-sidebar">
<li class="nav-header">{% trans "Mailboxes" %}</li>
{% print_mailboxes mboxes selected withunseen %}
</ul>
</div>
<!--<div id="mboxes_container">-->
<ul id="folders" class="nav nav-sidebar">
{% print_mailboxes mboxes selected withunseen %}
</ul>
<!--</div>-->
<div id="mboxactions">{% mboxes_menu %}</div>
@@ -33,11 +33,17 @@ $(document).ready(function() {
{% block fixed_content %}
<div class="row">
<div id="leftcol" class="col-lg-2 col-md-3 col-ms-3 col-xs-0 sidebar">
<div id="folders">{{ mboxes }}</div>
<!--<div class="row">-->
{{ mboxes }}
<!--</div>-->
</div>
<div id="rightcol" class="col-lg-11 col-md-12 col-ms-12 col-xs-12">
<div id="menubar" class="col-lg-12 col-md-12 col-ms-12 col-xs-12"></div>
<div id="listing" class=""></div>
<div id="rightcol" class="col-lg-offset-2 col-lg-10 col-md-offset-3 col-md-9 col-ms-offset-3 col-ms-9 col-xs-12">
<div class="row">
<div id="menubar" role="navbar" class="col-lg-12 col-md-12 col-ms-12 col-xs-12"></div>
</div>
<div class="row">
<div id="listing" class="col-lg-12 col-md-12 col-ms-12 col-xs-12"></div>
</div>
</div>
</div>
{% endblock %}
@@ -141,6 +141,17 @@ def print_mailboxes(tree, selected=None, withunseen=False, selectonly=False, hde
elif selected == name:
cssclass = "active"
result += "<li name='%s' class='droppable %s'>\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 += "<a href='%s' class='%s' name='%s'%s>" % (
"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 class='clickbox %s'></div>" % 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 += """<a href='%s' class='%s' name='%s'%s>
<i class="%s"></i>
%s
</a>
""" % ("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 += "<span class='%s'></span> %s</a>" % (iclass, label)
if "sub" in mbox and len(mbox["sub"]):
result += "<ul name='%s' class='nav nav-pills nav-stacked %s'>" % (mbox["path"], ul_state) \
+ print_mailboxes(mbox["sub"], selected, withunseen, selectonly, hdelimiter) + "</ul>\n"
if "sub" in mbox and mbox["sub"]:
result += "<ul name='%s' class='nav nav-pills nav-stacked %s'>" % (
mbox["path"], ul_state) + print_mailboxes(
mbox["sub"], selected, withunseen, selectonly, hdelimiter
) + "</ul>\n"
result += "</li>\n"
return result
+3 -1
View File
@@ -9,10 +9,12 @@ output (using standard tags like <table> 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):
+17 -15
View File
@@ -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;
+3 -3
View File
@@ -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, " "));
}
/*
+2
View File
@@ -1,6 +1,8 @@
{% extends "nlayout.html" %}
{% block content %}
<div class="container-fluid">
<div class="row">
{% block rowcontent %}{% endblock %}
</div>
</div>
{% endblock %}
+1 -1
View File
@@ -37,7 +37,7 @@
{% block html_head %}{% endblock %}
</head>
<body>
<div class="navbar navbar-inverse top-navbar" role="navigation">
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button class="navbar-toggle" data-target="#navigate-navbar-collapse" data-toggle="collapse" type="button">
+1 -1
View File
@@ -4,7 +4,7 @@
<div class="col-lg-2 col-md-3 col-sm-4 col-xs-12 sidebar">
{% block leftcol %}{% endblock %}
</div>
<div class="col-lg-offset-2 col-lg-10 col-md-offset-3 col-md-9 col-sm-offset-4 col-sm-8 col-xs-12">
<div class="main col-lg-offset-2 col-lg-10 col-md-offset-3 col-md-9 col-sm-offset-4 col-sm-8 col-xs-12">
{% if messages %}{% display_messages messages %}{% endif %}
{% block apparea %}{% endblock %}
</div>