changeset 5128:fcdee4a8809c

data browser widget: add (h)column<idx> css class to make it styleable
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 06 Sep 2009 14:10:56 +0200
parents 030379520983
children 6fd215462090
files MoinMoin/widget/browser.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/widget/browser.py	Sun Sep 06 13:03:41 2009 +0200
+++ b/MoinMoin/widget/browser.py	Sun Sep 06 14:10:56 2009 +0200
@@ -129,7 +129,8 @@
                 col = self.data.columns[idx]
                 if col.hidden:
                     continue
-                result.append(fmt.table_cell(1))
+                cell_attrs = {'class': 'hcolumn%d' % idx}
+                result.append(fmt.table_cell(1, cell_attrs))
                 result.append(fmt.strong(1))
                 result.append(col.label or col.name)
                 result.append(fmt.strong(0))
@@ -183,11 +184,12 @@
                 for idx in range(len(row)):
                     if self.data.columns[idx].hidden:
                         continue
+                    cell_attrs = {'class': 'column%d' % idx}
                     if isinstance(row[idx], tuple):
-                        result.append(fmt.table_cell(1, abbr=unicode(row[idx][1])))
+                        result.append(fmt.table_cell(1, cell_attrs, abbr=unicode(row[idx][1])))
                         result.append(unicode(row[idx][0]))
                     else:
-                        result.append(fmt.table_cell(1))
+                        result.append(fmt.table_cell(1, cell_attrs))
                         result.append(unicode(row[idx]))
                     result.append(fmt.table_cell(0))
                 result.append(fmt.table_row(0))