(implement #761403) The breadcrumb final element is now a link too. stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 15 Apr 2010 17:35:17 +0200
branchstable
changeset 5291 593adaccd737
parent 5290 15846058378b
child 5292 8b496574b65c
(implement #761403) The breadcrumb final element is now a link too. This allow getting a proper url for item fetched throught search.
web/test/unittest_breadcrumbs.py
web/views/ibreadcrumbs.py
--- a/web/test/unittest_breadcrumbs.py	Thu Apr 15 17:28:27 2010 +0200
+++ b/web/test/unittest_breadcrumbs.py	Thu Apr 15 17:35:17 2010 +0200
@@ -15,7 +15,7 @@
         ibc = self.vreg['components'].select('breadcrumbs', self.request(), rset=childrset)
         self.assertEquals(ibc.render(),
                           """<span id="breadcrumbs" class="pathbar">&#160;&gt;&#160;<a href="http://testing.fr/cubicweb/Folder">folder_plural</a>&#160;&gt;&#160;<a href="http://testing.fr/cubicweb/folder/%s" title="">par&amp;ent</a>&#160;&gt;&#160;
-chi&amp;ld</span>""" % f1.eid)
+<a href="http://testing.fr/cubicweb/folder/%s" title="">chi&amp;ld</a></span>""" % (f1.eid, f2.eid))
 
 if __name__ == '__main__':
     from logilab.common.testlib import unittest_main
--- a/web/views/ibreadcrumbs.py	Thu Apr 15 17:28:27 2010 +0200
+++ b/web/views/ibreadcrumbs.py	Thu Apr 15 17:35:17 2010 +0200
@@ -62,10 +62,7 @@
 
     def wpath_part(self, part, contextentity, last=False):
         if isinstance(part, Entity):
-            if last and part.eid == contextentity.eid:
-                self.w(xml_escape(part.view('breadcrumbtext')))
-            else:
-                self.w(part.view('breadcrumbs'))
+            self.w(part.view('breadcrumbs'))
         elif isinstance(part, tuple):
             url, title = part
             textsize = self._cw.property_value('navigation.short-line-size')