Display contextual components
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 22 Feb 2017 23:20:44 +0100
changeset 138 b596d5cf6585
parent 137 4d69e4c3c881
child 141 7c07c14a64a8
Display contextual components in the contenttop section (e.g. add / import links)
views/templates.py
views/templates/maintemplate.jinja2
--- a/views/templates.py	Wed Feb 22 22:26:50 2017 +0100
+++ b/views/templates.py	Wed Feb 22 23:20:44 2017 +0100
@@ -80,6 +80,8 @@
             for component in components:
                 component.render(w=w)
         breadcrumbs = stream.getvalue()
+        # contextual components
+        contextual_components = self._cw.view('contentheader', rset=self.cw_rset, view=view)
 
         ctx = self.base_context()
         url = self._cw.build_url
@@ -88,6 +90,7 @@
             'page_content': view.render(),
             'breadcrumbs': breadcrumbs,
             'application_message': application_message,
+            'contextual_components': contextual_components,
             'right_header_component': right_header_component,
             'left_boxes': left_boxes_html,
             'side_box': {
--- a/views/templates/maintemplate.jinja2	Wed Feb 22 22:26:50 2017 +0100
+++ b/views/templates/maintemplate.jinja2	Wed Feb 22 23:20:44 2017 +0100
@@ -44,6 +44,7 @@
     </aside>
     <div class="col-md-10 page-content" id="pageContent">
       {{ application_message }}
+      {{ contextual_components }}
       {{ page_content }}
     </div>
   </div>