drop useless render_entity_toolbox method and get toolbar_components implementation from primary view
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 12 Oct 2010 18:17:59 +0200
changeset 247 5d8466f096dc
parent 246 8482731e12b4
child 248 f33c8fc00ca4
drop useless render_entity_toolbox method and get toolbar_components implementation from primary view
views/entry.py
--- a/views/entry.py	Tue Oct 12 18:17:59 2010 +0200
+++ b/views/entry.py	Tue Oct 12 18:17:59 2010 +0200
@@ -12,7 +12,7 @@
 from logilab.mtconverter import xml_escape
 
 from cubicweb.schema import display_name
-from cubicweb.view import EntityView, StartupView
+from cubicweb.view import EntityView
 from cubicweb.selectors import paginated_rset, sorted_rset, is_instance
 from cubicweb.web import uicfg
 from cubicweb.web.views import primary, baseviews, calendar, navigation, workflow
@@ -52,15 +52,6 @@
     __select__ = is_instance('BlogEntry')
     show_attr_label = False
 
-    def render_entity_toolbox(self, entity):
-        # copy from PrimaryView
-        context = 'ctxtoolbar'
-        self.w(u'<div class="%s">' % context)
-        for comp in self._cw.vreg['ctxcomponents'].poss_visible_objects(
-            self._cw, rset=self.cw_rset, row=self.cw_row, view=self, context=context):
-            comp.render(w=self.w, row=self.cw_row, view=self)
-        self.w(u'</div>')
-
     def render_entity_title(self, entity):
         self._cw.add_css('cubes.blog.css')
         w = self.w
@@ -132,13 +123,7 @@
     __regid__ = 'blog'
     __select__ = is_instance('BlogEntry')
 
-    def toolbar_components(self, context):
-        # copy from PrimaryView
-        self.w(u'<div class="%s">' % context)
-        for comp in self._cw.vreg['contentnavigation'].poss_visible_objects(
-            self._cw, rset=self.cw_rset, row=self.cw_row, view=self, context=context):
-            comp.render(w=self.w, row=self.cw_row, view=self)
-        self.w(u'</div>')
+    toolbar_components = primary.PrimaryView.content_navigation_components.im_func
 
     def cell_call(self, row, col, **kwargs):
         entity = self.cw_rset.get_entity(row, col)