Fix presentation problems

This commit is contained in:
2014-12-04 19:15:15 +01:00
parent 897f96232c
commit 5f72a9c912
3 changed files with 39 additions and 36 deletions

View File

@@ -146,7 +146,7 @@ class DisplayHTMLBlockTable(DisplayHTMLBlock):
class DisplayHTMLBlockTableWithGraph(DisplayHTMLBlockTable):
def __init__(self, title, cols, short_titles=None, nb_valid_rows=0):
def __init__(self, title, cols, short_titles=None, nb_valid_rows=0, graph_cols=None):
super(DisplayHTMLBlockTableWithGraph, self).__init__(title=title, cols=cols)
self.short_titles = short_titles or []
self.nb_valid_rows = nb_valid_rows
@@ -156,6 +156,8 @@ class DisplayHTMLBlockTableWithGraph(DisplayHTMLBlockTable):
self.raw_rows = []
self.maxes = [0] * len(cols)
self.table_graph_css = 'iwla_graph_table'
self.td_img_css = 'iwla_td_img'
self.graph_cols = graph_cols or []
def appendRow(self, row):
self.raw_rows.append(row)
@@ -196,8 +198,10 @@ class DisplayHTMLBlockTableWithGraph(DisplayHTMLBlockTable):
html += '<tr>'
for i in range(0, self.nb_valid_rows):
row = self.rows[i]
html += '<td>'
for j in range(1, len(row)):
css = ''
if self.td_img_css: css=' class="%s"' % (self.td_img_css)
html += '<td%s>' % (css)
for j in self.graph_cols:
style = self.getColCSSClass(j)
icon = self._getIconFromStyle(style)
if not icon: continue