mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-20 06:08:35 +02:00
@@ -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
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user