equal
deleted
inserted
replaced
1 from logilab.mtconverter import html_escape |
1 from logilab.mtconverter import html_escape |
2 |
2 |
3 from cubicweb.interfaces import ITree |
3 from cubicweb.interfaces import ITree |
4 from cubicweb.common.selectors import interface_selector, yes |
4 from cubicweb.common.selectors import implement_interface, yes |
5 from cubicweb.common.view import EntityView |
5 from cubicweb.common.view import EntityView |
6 |
6 |
7 from cubicweb.web.views.baseviews import OneLineView |
7 from cubicweb.web.views.baseviews import OneLineView |
8 |
8 |
9 class TreeView(EntityView): |
9 class TreeView(EntityView): |
85 (each item should be exandable if it's not a tree leaf) |
85 (each item should be exandable if it's not a tree leaf) |
86 """ |
86 """ |
87 id = 'treeitemview' |
87 id = 'treeitemview' |
88 # XXX append yes to make sure we get an higher score than |
88 # XXX append yes to make sure we get an higher score than |
89 # the default treeitem view |
89 # the default treeitem view |
90 __selectors__ = (interface_selector, yes) |
90 __selectors__ = (implement_interface, yes) |
91 accepts_interfaces = (ITree,) |
91 accepts_interfaces = (ITree,) |
92 |
92 |
93 def cell_call(self, row, col, vid='oneline', parentvid='treeview'): |
93 def cell_call(self, row, col, vid='oneline', parentvid='treeview'): |
94 entity = self.entity(row, col) |
94 entity = self.entity(row, col) |
95 cssclasses = [] |
95 cssclasses = [] |