Commit 5bde2bc5 authored by Alexandre Boeglin's avatar Alexandre Boeglin

commit a change proposed by Jerome:

- translation is done in breadcrumbs, to save some tal:conditions
- do not restrictedTraverse() from portal for each element of the path

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17976 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0eb68563
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -206,15 +203,23 @@ if include_root:\n ...@@ -206,15 +203,23 @@ if include_root:\n
relative = utool.getRelativeContentPath(context)\n relative = utool.getRelativeContentPath(context)\n
portal = utool.getPortalObject()\n portal = utool.getPortalObject()\n
\n \n
for i in xrange( len( relative ) ):\n obj = portal\n
now = relative[ :i+1 ]\n now = []\n
obj = portal.restrictedTraverse( now )\n module = True\n
if not now[ -1 ] == \'talkback\':\n for name in relative:\n
result.append( { \'id\' : now[ -1 ]\n obj = obj[name]\n
, \'title\' : obj.Title()\n now.append(name)\n
if module:\n
title = obj.getTranslatedTitle()\n
else:\n
title = obj.getTitle()\n
if not name == \'talkback\':\n
result.append( { \'id\' : name\n
, \'title\' : title\n
, \'url\' : \'%s/%s/view\' % (portal_url, \'/\'.join(now))\n , \'url\' : \'%s/%s/view\' % (portal_url, \'/\'.join(now))\n
}\n }\n
)\n )\n
module = False\n
\n \n
return result\n return result\n
</string> </value> </string> </value>
...@@ -283,13 +288,15 @@ return result\n ...@@ -283,13 +288,15 @@ return result\n
<string>context</string> <string>context</string>
<string>relative</string> <string>relative</string>
<string>portal</string> <string>portal</string>
<string>obj</string>
<string>now</string>
<string>True</string>
<string>module</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>xrange</string> <string>name</string>
<string>len</string>
<string>i</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>now</string> <string>title</string>
<string>obj</string> <string>False</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -124,8 +124,7 @@ IDEAS:\n ...@@ -124,8 +124,7 @@ IDEAS:\n
<div id="status">\n <div id="status">\n
<div id="breadcrumb">\n <div id="breadcrumb">\n
<tal:block tal:repeat="item here/breadcrumbs">\n <tal:block tal:repeat="item here/breadcrumbs">\n
<a tal:condition="python: repeat[\'item\'].index &lt; 2" tal:attributes="href item/url" tal:content="item/title" i18n:translate="" i18n:domain="ui" />\n <a tal:attributes="href item/url" tal:content="item/title" />\n
<a tal:condition="python: repeat[\'item\'].index &gt;= 2" tal:attributes="href item/url" tal:content="item/title" />\n
/\n /\n
</tal:block>\n </tal:block>\n
</div>\n </div>\n
......
445 450
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment