[web/view/treeview] add a 'selected' class on <li> 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.
--- 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: