[PATCH 1 of 3 saem_ref v2] Remove ConceptTreeView

Frank Bessou frank.bessou at logilab.fr
Fri Sep 28 09:55:01 CEST 2018


# HG changeset patch
# User Frank Bessou <frank.bessou at logilab.fr>
# Date 1538063133 -7200
#      Thu Sep 27 17:45:33 2018 +0200
# Node ID d1a491d08cb0f0b6e8b9da25137e173120994a27
# Parent  4d3586d07bd4d6489657a1cbbf24e34bbae84839
# Available At http://hg.logilab.org/review/cubes/saem_ref
#              hg pull http://hg.logilab.org/review/cubes/saem_ref -r d1a491d08cb0
Remove ConceptTreeView

It seems to be unused and we are going to explicitly use jqtree to
display concepts in next changesets.

diff --git a/cubicweb_saem_ref/views/skos.py b/cubicweb_saem_ref/views/skos.py
--- a/cubicweb_saem_ref/views/skos.py
+++ b/cubicweb_saem_ref/views/skos.py
@@ -16,11 +16,10 @@
 """cubicweb-saem-ref custom views for skos entities"""
 
 
-from cubicweb import tags, _
-from cubicweb.view import AnyRsetView
+from cubicweb import _
 from cubicweb.predicates import is_instance
 from cubicweb.web import formwidgets as fw
-from cubicweb.web.views import baseviews, treeview, uicfg
+from cubicweb.web.views import baseviews, uicfg
 
 from cubicweb_skos import views as skos
 
@@ -84,36 +83,6 @@ class ConceptSchemeSameETypeListView(bas
             href=href, title=title))
 
 
-class ConceptTreeView(treeview.TreeView):
-    """`treeview` for Concept entities."""
-    __select__ = treeview.TreeView.__select__ & is_instance('Concept')
-    subvid = 'skos.concept-popover'
-
-
-class ConceptPopoverView(AnyRsetView):
-    """Popover view for Concept, to be displayed within treeview"""
-    __regid__ = 'skos.concept-popover'
-    __select__ = is_instance('Concept')
-
-    def cell_call(self, row, col, **kwargs):
-        entity = self.cw_rset.get_entity(row, col)
-        self._cw.add_onload("$('#{eid}').popover();".format(eid=entity.eid))
-        title = entity.dc_title()
-        content = u'<dl>'
-        for attr in ('definition', 'example'):
-            if getattr(entity, attr):
-                content += u'<dt>{label}</dt><dd>{value}</dd>'.format(
-                    label=self._cw._(attr),
-                    value=entity.printable_value(attr, format=u'text/html'))
-        content += u'</dl>'
-        content += tags.a(self._cw._('view'), href=entity.absolute_url())
-        data = {'data-title': title,
-                'data-content': content,
-                'data-html': 'true',
-                'data-trigger': 'focus'}
-        self.w(tags.a(title, href='javascript:$.noop();', id=str(entity.eid), **data))
-
-
 def registration_callback(vreg):
     from cubicweb_skos.views import ImportConceptSchemeAction
     vreg.unregister(ImportConceptSchemeAction)



More information about the saem-devel mailing list