Commit 5be97514 authored by Frank Bessou's avatar Frank Bessou 🍁
Browse files

Allow to override how concepts are rendered in ConceptScheme tab view

In SAEM we need to render the concept tree as a jquery tree. So we
introduce a render_tree method intended to be overidden by specific
parent 68cd0ac0693b
......@@ -153,6 +153,11 @@ class ConceptSchemeConceptsTab(tabs.TabsMixin, EntityView):
__regid__ = 'skos_top_concepts_tab' # don't use '.' in tab's regid
__select__ = is_instance('ConceptScheme')
def render_tree(self, entity, children_rset):
treeid = 'skos_tree_%s' % entity.eid
self._cw.view('treeview', rset=children_rset, treeid=treeid,
initial_thru_ajax=True, w=self.w)
def entity_call(self, entity):
rschema = self._cw.vreg.schema.rschema('in_scheme')
if rschema.has_perm(self._cw, 'add', toeid=entity.eid):
......@@ -164,8 +169,7 @@ class ConceptSchemeConceptsTab(tabs.TabsMixin, EntityView):
if not rset:
if len(rset) < self._cw.property_value(''):
treeid = 'skos_tree_%s' % entity.eid
self._cw.view('treeview', rset=rset, treeid=treeid, initial_thru_ajax=True, w=self.w)
self.render_tree(entity, rset)
self._cw.view('paginated-list', rset=rset, w=self.w)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment