mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-19 05:58:34 +02:00
Pure CSS layout working with FF. (at least for the webmail)
Trying to make it work with IE6+...
This commit is contained in:
@@ -94,25 +94,25 @@ class EmailListing:
|
||||
|
||||
def fetch(self, request, id_start, id_stop):
|
||||
table = self.tbltype(self.mbc.fetch(start=id_start, stop=id_stop,
|
||||
folder=self.folder)).render(request)
|
||||
folder=self.folder))
|
||||
tpl = Template("""
|
||||
<form method="POST" id="listingform">
|
||||
{{ table }}
|
||||
</form>""")
|
||||
return tpl.render(Context({"table" : table}))
|
||||
return tpl.render(Context({"table" : table.render(request)}))
|
||||
|
||||
def render(self, request, pageid=1, **kwargs):
|
||||
page = self.paginator.getpage(pageid)
|
||||
thead = listing = ""
|
||||
if "empty" in kwargs.keys() and not kwargs["empty"]:
|
||||
if not page:
|
||||
listing = "Empty folder"
|
||||
else:
|
||||
listing = self.fetch(request, page.id_start, page.id_stop)
|
||||
else:
|
||||
listing = ""
|
||||
elapsed = kwargs.has_key("start") and time.time() - kwargs["start"] or 0
|
||||
return _render(request, self.tpl, {
|
||||
"listing" : listing, "elapsed" : elapsed,
|
||||
"listing" : listing,
|
||||
"elapsed" : elapsed,
|
||||
"navbar" : self.render_navbar(page),
|
||||
"folders" : self.getfolders(),
|
||||
"selection" : self.folder,
|
||||
|
||||
+35
-6
@@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import inspect
|
||||
import lxml
|
||||
from django.template import Template, Context
|
||||
from django.template.loader import render_to_string
|
||||
|
||||
class Column:
|
||||
@@ -53,9 +54,9 @@ class Table(object):
|
||||
if isinstance(c, ImgColumn):
|
||||
key = "img_%s" % c.name
|
||||
if key in row.keys():
|
||||
nrow["cols"] += [{"value" : c.render(row[key]), "safe" : True}]
|
||||
nrow["cols"] += [{"value" : c.render(row[key]), "safe" : True, "width" : c.width}]
|
||||
else:
|
||||
nrow["cols"] += ["."]
|
||||
nrow["cols"] += [{"width" : c.width}]
|
||||
continue
|
||||
if row.has_key(c.name):
|
||||
try:
|
||||
@@ -66,10 +67,38 @@ class Table(object):
|
||||
cssclass += (cssclass != "") and ", %s" % row["class"] or row["class"]
|
||||
|
||||
nrow["cols"] += [{"value" : self.parse(c.name, row[c.name]),
|
||||
"class" : cssclass}]
|
||||
"class" : cssclass,
|
||||
"width" : c.width}]
|
||||
self.rows += [nrow]
|
||||
|
||||
def render(self, request):
|
||||
return render_to_string("common/tables.html", {
|
||||
"table" : self, "tableid" : self.tableid
|
||||
})
|
||||
t = Template("""
|
||||
<table id="{{ tableid }}">
|
||||
{% include "common/table_head.html" %}
|
||||
{% include "common/table_body.html" %}
|
||||
</table>
|
||||
""")
|
||||
return t.render(Context({
|
||||
"table" : self, "tableid" : self.tableid
|
||||
}))
|
||||
|
||||
def render_head(self, request):
|
||||
t = Template("""
|
||||
<table id="{{ tableid }}">
|
||||
{% include "common/table_head.html" %}
|
||||
</table>
|
||||
""")
|
||||
return t.render(Context({
|
||||
"table" : self, "tableid" : "%s_head" % self.tableid
|
||||
}))
|
||||
|
||||
def render_body(self, request):
|
||||
t = Template("""
|
||||
<table id="{{ tableid }}">
|
||||
{% include "common/table_body.html" %}
|
||||
</table>
|
||||
""")
|
||||
return t.render(Context({
|
||||
"table" : self, "tableid" : "%s_body" % self.tableid
|
||||
}))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user