web/views/primary.py
changeset 6446 878fcf10cead
parent 6377 3bb415310d4f
child 6476 de7f53cf75ec
equal deleted inserted replaced
6445:980f4415baab 6446:878fcf10cead
    24 
    24 
    25 from logilab.mtconverter import xml_escape
    25 from logilab.mtconverter import xml_escape
    26 
    26 
    27 from cubicweb import Unauthorized, NoSelectableObject
    27 from cubicweb import Unauthorized, NoSelectableObject
    28 from cubicweb.utils import support_args
    28 from cubicweb.utils import support_args
    29 from cubicweb.selectors import match_kwargs
    29 from cubicweb.selectors import match_kwargs, match_context
    30 from cubicweb.view import EntityView
    30 from cubicweb.view import EntityView
    31 from cubicweb.schema import META_RTYPES, VIRTUAL_RTYPES, display_name
    31 from cubicweb.schema import META_RTYPES, VIRTUAL_RTYPES, display_name
    32 from cubicweb.web import uicfg
    32 from cubicweb.web import uicfg, component
    33 
    33 
    34 
    34 
    35 class PrimaryView(EntityView):
    35 class PrimaryView(EntityView):
    36     """the full view of an non final entity"""
    36     """the full view of an non final entity"""
    37     __regid__ = 'primary'
    37     __regid__ = 'primary'
   381             rset = entity.related(rtype, role)
   381             rset = entity.related(rtype, role)
   382             if rset:
   382             if rset:
   383                 self.wview('autolimited', rset, initargs={'dispctrl': dispctrl})
   383                 self.wview('autolimited', rset, initargs={'dispctrl': dispctrl})
   384 
   384 
   385 
   385 
       
   386 
       
   387 class ToolbarLayout(component.Layout):
       
   388     __select__ = match_context('ctxtoolbar')
       
   389 
       
   390     def render(self, w):
       
   391         if self.init_rendering():
       
   392             self.cw_extra_kwargs['view'].render_body(w)
       
   393 
   386 ## default primary ui configuration ###########################################
   394 ## default primary ui configuration ###########################################
   387 
   395 
   388 _pvs = uicfg.primaryview_section
   396 _pvs = uicfg.primaryview_section
   389 for rtype in META_RTYPES:
   397 for rtype in META_RTYPES:
   390     _pvs.tag_subject_of(('*', rtype, '*'), 'hidden')
   398     _pvs.tag_subject_of(('*', rtype, '*'), 'hidden')