[saem-devel] [PATCH] [views] display Organization with tab and box in startup view

Philippe Pepiot philippe.pepiot at logilab.fr
Thu Feb 9 11:16:55 CET 2017


# HG changeset patch
# User Philippe Pepiot <philippe.pepiot at logilab.fr>
# Date 1486634306 -3600
#      Thu Feb 09 10:58:26 2017 +0100
# Node ID f0eb1da37bd34492aecc64f4699c221f0c8f8cf8
# Parent  8a064175a178fcaa2e116f031821b70e786ddbce
# Available At https://hg.logilab.org/review/cubes/saem_ref
#              hg pull https://hg.logilab.org/review/cubes/saem_ref -r f0eb1da37bd3
# Tested at https://jenkins.logilab.org/job/cubicweb-saem_ref/79/
[views] display Organization with tab and box in startup view

Closes extranet #12251003

diff --git a/cubicweb_saem_ref/views/__init__.py b/cubicweb_saem_ref/views/__init__.py
--- a/cubicweb_saem_ref/views/__init__.py
+++ b/cubicweb_saem_ref/views/__init__.py
@@ -280,6 +280,7 @@ def main_navigation_menu():
         ('ConceptScheme', _('Vocabularies')),
         ('SEDAArchiveTransfer', 'SEDAArchiveTransfer_plural'),
         ('sedalib', _('SEDA components')),
+        ('Organization', 'Organization_plural'),
     ]):
         if label is None:
             label = path + '_plural'
diff --git a/cubicweb_saem_ref/views/startup.py b/cubicweb_saem_ref/views/startup.py
--- a/cubicweb_saem_ref/views/startup.py
+++ b/cubicweb_saem_ref/views/startup.py
@@ -87,6 +87,9 @@ class SAEMRefIndexView(startup.IndexView
             'Any X,XT,XA,XD,MD ORDERBY MD DESC LIMIT 5 WHERE X is SEDAArchiveTransfer, '
             'X modification_date MD, X title XT, X ark XA, '
             'X user_annotation XD'),
+        'Organization': (
+            'Any X,XN,MD ORDERBY XN WHERE X is Organization, X name XN, '
+            'X modification_date MD'),
     }
 
     def _render_modified_rset(self, rset):
@@ -130,20 +133,11 @@ class SAEMRefIndexView(startup.IndexView
             ('AuthorityRecord', self._cw.build_url('view', vid='eac.import')),
             ('ConceptScheme', self._cw.build_url('add/skossource')),
             ('SEDAArchiveTransfer', None),
+            ('Organization', None),
         ]:
             self.render_box(etype, import_url)
         self.render_seda_lib_box()
         self.w(u'</div>')
-        self.w(u'<div class="row">')
-        title_html = u'<b>{0}</b>'.format(self._cw.__('Organization_plural'))
-        title_html += add_etype_link(self._cw, 'Organization')
-        title_html += view_link(self._cw, 'Organization')
-        rql = 'Any X,XN,MD ORDERBY XN WHERE X is Organization, X name XN, X modification_date MD'
-        with index_box(self.w, title_html, 'panel-default'):
-            rset = self._cw.execute(rql)
-            if rset:
-                self._cw.view('listgroup', rset=rset, w=self.w)
-        self.w(u'</div>')
 
 
 def registration_callback(vreg):



More information about the saem-devel mailing list