[saem-devel] [PATCH 08 of 10 sherpa] Display contextual components

Sylvain Thenault sylvain.thenault at logilab.fr
Thu Feb 23 09:32:57 CET 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1487802044 -3600
#      Wed Feb 22 23:20:44 2017 +0100
# Node ID b596d5cf6585e39292bdcdcd8c6538d30bdacc76
# Parent  4d69e4c3c881985b045270cc48ff21f3e6cf6bf6
Display contextual components

in the contenttop section (e.g. add / import links)

diff --git a/views/templates.py b/views/templates.py
--- a/views/templates.py
+++ b/views/templates.py
@@ -78,18 +78,21 @@ class SherpaMainTemplate(basetemplates.T
         components = self.get_components(view, context='header-center')
         if components:
             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
         ctx.update({
             'title': view.page_title(),
             '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': {
                 'goTo_links': [
                     {'url': url('sedalib'),
diff --git a/views/templates/maintemplate.jinja2 b/views/templates/maintemplate.jinja2
--- a/views/templates/maintemplate.jinja2
+++ b/views/templates/maintemplate.jinja2
@@ -42,10 +42,11 @@
         </div>
       </div>
     </aside>
     <div class="col-md-10 page-content" id="pageContent">
       {{ application_message }}
+      {{ contextual_components }}
       {{ page_content }}
     </div>
   </div>
   <div class="container-fluid">
     <footer role="contentinfo" id="pagefooter">


More information about the saem-devel mailing list