web/views/treeview.py
changeset 4459 f628abfb3a6c
parent 4436 294e084f1263
parent 4455 6af31772765f
child 4552 79f461d7ec37
--- a/web/views/treeview.py	Thu Feb 04 13:17:26 2010 +0100
+++ b/web/views/treeview.py	Fri Feb 05 07:25:16 2010 +0100
@@ -113,10 +113,8 @@
         assert treeid is not None
         entity = self.cw_rset.get_entity(row, col)
         itemview = self._cw.view(vid, self.cw_rset, row=row, col=col)
-        if row == len(self.cw_rset) - 1:
-            self.w(u'<li class="last">%s</li>' % itemview)
-        else:
-            self.w(u'<li>%s</li>' % itemview)
+        last_class = morekwargs['is_last'] and ' class="last"' or ''
+        self.w(u'<li%s>%s</li>' % (last_class, itemview))
 
 
 class TreeViewItemView(EntityView):