# HG changeset patch # User Florent Cayre # Date 1389261225 -3600 # Node ID 430859af32c6c0f1d467698778130de0311ca077 # Parent 7b3fa5a7a5a3628d99fc4bbf67ba09f8e5f79c86 [breadcrumbs] Small breadcrumb components refactoring * use `open_breadcrumbs` and `close_breadcrumbs` methods where applicable in the BreadCrumbEntityVComponent hierarchy * include the first separator related code in `open_breadcrumbs` to avoid code duplication Closes #3223911. diff -r 7b3fa5a7a5a3 -r 430859af32c6 doc/3.18.rst --- a/doc/3.18.rst Mon Jan 06 12:01:35 2014 +0100 +++ b/doc/3.18.rst Thu Jan 09 10:53:45 2014 +0100 @@ -41,6 +41,9 @@ get a `name` attribute that maps the CubicWeb contraint entities to corresponding backend index. +* BreadCrumbEntityVComponent's open_breadcrumbs method now includes + the first breadcrumbs separator + Deprecation --------------------- diff -r 7b3fa5a7a5a3 -r 430859af32c6 web/views/ibreadcrumbs.py --- a/web/views/ibreadcrumbs.py Mon Jan 06 12:01:35 2014 +0100 +++ b/web/views/ibreadcrumbs.py Thu Jan 09 10:53:45 2014 +0100 @@ -115,13 +115,13 @@ path = adapter.breadcrumbs(view) if path: self.open_breadcrumbs(w) - if self.first_separator: - w(self.separator) self.render_breadcrumbs(w, entity, path) self.close_breadcrumbs(w) def open_breadcrumbs(self, w): w(u'') + if self.first_separator: + w(self.separator) def close_breadcrumbs(self, w): w(u'') @@ -172,11 +172,9 @@ # XXX support kwargs for compat with other components which gets the view as # argument def render(self, w, **kwargs): - w(u'') - if self.first_separator: - w(self.separator) + self.open_breadcrumbs(w) w(self._cw._('search')) - w(u'') + self.close_breadcrumbs(w) class BreadCrumbLinkToVComponent(BreadCrumbEntityVComponent):