# HG changeset patch # User Sylvain Thénault # Date 1429203552 -7200 # Node ID 4f3b6dad5084bad8131c1fdd382d23396f37ec1b # Parent e52efb73f9ee5746cf85f498891633be464e267a [web/view/treeview] add a 'selected' class on
  • if the entity's url is the currently displayed url An alternative would be to refactor the corresponding view so that controlling css classes wouldn't require overriding a 5O-lines method. Notice by default there is no associated class in the CSS so there is no rendering difference unless one explicitly add rule in his CSS file. diff -r e52efb73f9ee -r 4f3b6dad5084 web/views/treeview.py --- a/web/views/treeview.py Thu Apr 02 13:54:00 2015 +0200 +++ b/web/views/treeview.py Thu Apr 16 18:59:12 2015 +0200 @@ -244,6 +244,8 @@ entity = self.cw_rset.get_entity(row, col) itree = entity.cw_adapt_to('ITree') liclasses = [] + if self._cw.url(includeparams=False) == entity.absolute_url(): + liclasses.append(u'selected') is_open = self.open_state(entity.eid, treeid) is_leaf = itree is None or itree.is_leaf() if is_leaf: