From b30ea3771d9b7ed24243b45c8b7dda4ee681021c Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Fri, 14 Aug 2009 13:23:32 +0000
Subject: [PATCH] make the title of the first item of breadcrumb 'Home' instead
 of the web site's title.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28386 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../WebSection_getBreadcrumbItemList.xml      | 19 +++++++++++--------
 bt5/erp5_web/bt/revision                      |  2 +-
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getBreadcrumbItemList.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getBreadcrumbItemList.xml
index 1ac7ef9627..48257ba79e 100644
--- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getBreadcrumbItemList.xml
+++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getBreadcrumbItemList.xml
@@ -113,21 +113,23 @@ crumb_list = []\n
 \n
 # Implementation consists in browsing the aq_parent sequence\n
 chain_list = document.Base_getAcquisitionParentValueList(upper_portal_type=\'Web Site\')\n
-for i in range(0, len(chain_list)):\n
+chain_list.reverse()\n
+for i in xrange(0, len(chain_list)):\n
   try:\n
     crumb = chain_list[i]\n
-    crumb_list.append((crumb.getProperty(\'translated_short_title\', None) or\\\n
-                     crumb.getProperty(\'translated_title_or_id\', None) or\\\n
-                     crumb.title\n
-                   , crumb\n
-                   ))\n
+    if i == 0:\n
+      title = context.Base_translateString(\'Home\')\n
+    else:\n
+      title = crumb.getProperty(\'translated_short_title\', None) or\\\n
+              crumb.getProperty(\'translated_title_or_id\', None) or\\\n
+              crumb.title\n
+    crumb_list.append((title, crumb))\n
   except Unauthorized:\n
     # We should ignore any item in the chain which raises \n
     # a security exception. We use a catchall except here\n
     # because there is no way to import Unauthorized permission\n
     pass\n
 \n
-crumb_list.reverse()\n
 return crumb_list\n
 </string> </value>
         </item>
@@ -180,11 +182,12 @@ return crumb_list\n
                             <string>_getattr_</string>
                             <string>chain_list</string>
                             <string>_getiter_</string>
-                            <string>range</string>
+                            <string>xrange</string>
                             <string>len</string>
                             <string>i</string>
                             <string>_getitem_</string>
                             <string>crumb</string>
+                            <string>title</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_web/bt/revision b/bt5/erp5_web/bt/revision
index e7fd4bfbe1..4fe21da97a 100644
--- a/bt5/erp5_web/bt/revision
+++ b/bt5/erp5_web/bt/revision
@@ -1 +1 @@
-838
\ No newline at end of file
+839
\ No newline at end of file
-- 
2.30.9