[Mpuls-commits] r3864 - base/trunk/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Oct 4 10:38:03 CEST 2010


Author: torsten
Date: 2010-10-04 10:38:02 +0200 (Mon, 04 Oct 2010)
New Revision: 3864

Modified:
   base/trunk/mpulsweb/lib/renderer.py
Log:
* mpulsweb/lib/renderer.py: Issue893: Added numebering of entries in
casedigest. Further added alternating colors per row.


Modified: base/trunk/mpulsweb/lib/renderer.py
===================================================================
--- base/trunk/mpulsweb/lib/renderer.py	2010-10-01 17:42:42 UTC (rev 3863)
+++ base/trunk/mpulsweb/lib/renderer.py	2010-10-04 08:38:02 UTC (rev 3864)
@@ -989,7 +989,7 @@
         out = []
         out.append('<div class="widget">')
         out.append('<table class="list">')
-        out.append('<tr><th>%s</th><th class="actions">%s</th>'
+        out.append('<tr><th class="table_width_small"></th><th colspan>%s</th><th class="actions">%s</th>'
                    % (escape(_('Description')),
                       escape(_('Actions'))))
         items = self.page.getChildren()
@@ -1024,8 +1024,13 @@
         sorted_items = sorted(unsorted_items, key=lambda rg: rg.value,
                               reverse=reverse_order)
 
-        for sd in sorted_items:
-            out.append('<tr>')
+        for num, sd in enumerate(sorted_items):
+            out.append('<tr class="%s">' % (num%2 and "hl" or ""))
+            out.append('<td align="center">')
+            out.append('<strong>')
+            out.append('(%s)' % (num+1))
+            out.append('</strong>')
+            out.append('</td>')
             out.append('<td>')
             out.append(self.render_digest(sd.rg, sd.fields))
             out.append('</td>')
@@ -1048,6 +1053,7 @@
             out.append('</tr>')
 
         out.append('<tr>')
+        out.append('<td></td>')
         out.append('<td style="text-align:right;">')
         if not self.ro_mode:
             out.append(escape(_('Create new item')))



More information about the Mpuls-commits mailing list