# HG changeset patch # User Alexandre Richardson # Date 1442486859 -7200 # Node ID 6bc480ec5665ef704014ac168620d038248ed701 # Parent 40e74d6d7e99eb8dd79fc7e1970484d7fc749f50 refactor a bit breadcrumbs to ease overriding of the root's display diff -r 40e74d6d7e99 -r 6bc480ec5665 cubicweb/web/views/ibreadcrumbs.py --- a/cubicweb/web/views/ibreadcrumbs.py Wed Jan 14 13:35:22 2015 +0100 +++ b/cubicweb/web/views/ibreadcrumbs.py Thu Sep 17 12:47:39 2015 +0200 @@ -121,13 +121,16 @@ def close_breadcrumbs(self, w): w(u'') - def render_breadcrumbs(self, w, contextentity, path): + def render_root(self, w, contextentity, path): root = path.pop(0) if isinstance(root, Entity): w(self.link_template % (self._cw.build_url(root.__regid__), root.dc_type('plural'))) w(self.separator) self.wpath_part(w, root, contextentity, not path) + + def render_breadcrumbs(self, w, contextentity, path): + self.render_root(w, contextentity, path) for i, parent in enumerate(path): w(self.separator) w(u"\n")