wip: global UI refactoring

* More work on the webmail

see #204
This commit is contained in:
Antoine Nguyen
2012-03-30 11:15:34 +02:00
parent e10bba2d4e
commit 28e8e736ee
21 changed files with 142 additions and 191 deletions
+1 -3
View File
@@ -86,7 +86,6 @@ class Paginator(object):
return p
class EmailListing(object):
table_styles = "table-striped table-condensed"
def __init__(self, baseurl=None, folder=None, elems_per_page=40,
navparams={}, **kwargs):
@@ -125,8 +124,7 @@ class EmailListing(object):
</form>""")
return tpl.render(
Context(
{"table" : table.render(styles=self.table_styles,
withheader=False)}
{"table" : table.render(withheader=False)}
)
)
+7 -2
View File
@@ -188,8 +188,13 @@ class Table(object):
def __str__(self):
return self.render()
def render(self, styles="table-striped table-bordered", withheader=True):
def render(self, withheader=True):
if len(self.rows):
try:
styles = self.styles
except AttributeError:
styles = "table-striped table-bordered"
t = Template("""
<table id="{{ tableid }}" class="table {{ styles }}">
{% if withheader %}{% include "common/table_head.html" %}{% endif %}
@@ -201,7 +206,7 @@ class Table(object):
"withheader" : withheader
}))
t = Template("""
<div class="info">%s</div>
<div class="alert alert-info">%s</div>
""" % _("No entries to display"))
return t.render(Context())