[contextual components] missing layout for components in the toolbar
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 11 Oct 2010 18:01:25 +0200
changeset 6446 878fcf10cead
parent 6445 980f4415baab
child 6447 f5d1b1025702
[contextual components] missing layout for components in the toolbar
web/views/primary.py
--- a/web/views/primary.py	Mon Oct 11 18:00:51 2010 +0200
+++ b/web/views/primary.py	Mon Oct 11 18:01:25 2010 +0200
@@ -26,10 +26,10 @@
 
 from cubicweb import Unauthorized, NoSelectableObject
 from cubicweb.utils import support_args
-from cubicweb.selectors import match_kwargs
+from cubicweb.selectors import match_kwargs, match_context
 from cubicweb.view import EntityView
 from cubicweb.schema import META_RTYPES, VIRTUAL_RTYPES, display_name
-from cubicweb.web import uicfg
+from cubicweb.web import uicfg, component
 
 
 class PrimaryView(EntityView):
@@ -383,6 +383,14 @@
                 self.wview('autolimited', rset, initargs={'dispctrl': dispctrl})
 
 
+
+class ToolbarLayout(component.Layout):
+    __select__ = match_context('ctxtoolbar')
+
+    def render(self, w):
+        if self.init_rendering():
+            self.cw_extra_kwargs['view'].render_body(w)
+
 ## default primary ui configuration ###########################################
 
 _pvs = uicfg.primaryview_section