web/views/ibreadcrumbs.py
changeset 9384 430859af32c6
parent 9256 697a8181ba30
child 10006 8391bf718485
equal deleted inserted replaced
9383:7b3fa5a7a5a3 9384:430859af32c6
   113         adapter = entity.cw_adapt_to('IBreadCrumbs')
   113         adapter = entity.cw_adapt_to('IBreadCrumbs')
   114         view = self.cw_extra_kwargs.get('view')
   114         view = self.cw_extra_kwargs.get('view')
   115         path = adapter.breadcrumbs(view)
   115         path = adapter.breadcrumbs(view)
   116         if path:
   116         if path:
   117             self.open_breadcrumbs(w)
   117             self.open_breadcrumbs(w)
   118             if self.first_separator:
       
   119                 w(self.separator)
       
   120             self.render_breadcrumbs(w, entity, path)
   118             self.render_breadcrumbs(w, entity, path)
   121             self.close_breadcrumbs(w)
   119             self.close_breadcrumbs(w)
   122 
   120 
   123     def open_breadcrumbs(self, w):
   121     def open_breadcrumbs(self, w):
   124         w(u'<span id="breadcrumbs" class="pathbar">')
   122         w(u'<span id="breadcrumbs" class="pathbar">')
       
   123         if self.first_separator:
       
   124             w(self.separator)
   125 
   125 
   126     def close_breadcrumbs(self, w):
   126     def close_breadcrumbs(self, w):
   127         w(u'</span>')
   127         w(u'</span>')
   128 
   128 
   129     def render_breadcrumbs(self, w, contextentity, path):
   129     def render_breadcrumbs(self, w, contextentity, path):
   170     __select__ = basecomponents.HeaderComponent.__select__ & any_rset()
   170     __select__ = basecomponents.HeaderComponent.__select__ & any_rset()
   171 
   171 
   172     # XXX support kwargs for compat with other components which gets the view as
   172     # XXX support kwargs for compat with other components which gets the view as
   173     # argument
   173     # argument
   174     def render(self, w, **kwargs):
   174     def render(self, w, **kwargs):
   175         w(u'<span id="breadcrumbs" class="pathbar">')
   175         self.open_breadcrumbs(w)
   176         if self.first_separator:
       
   177             w(self.separator)
       
   178         w(self._cw._('search'))
   176         w(self._cw._('search'))
   179         w(u'</span>')
   177         self.close_breadcrumbs(w)
   180 
   178 
   181 
   179 
   182 class BreadCrumbLinkToVComponent(BreadCrumbEntityVComponent):
   180 class BreadCrumbLinkToVComponent(BreadCrumbEntityVComponent):
   183     __select__ = basecomponents.HeaderComponent.__select__ & match_form_params('__linkto')
   181     __select__ = basecomponents.HeaderComponent.__select__ & match_form_params('__linkto')
   184 
   182