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 @@
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
......@@ -206,15 +203,23 @@ if include_root:\n
relative = utool.getRelativeContentPath(context)\n
portal = utool.getPortalObject()\n
\n
for i in xrange( len( relative ) ):\n
now = relative[ :i+1 ]\n
obj = portal.restrictedTraverse( now )\n
if not now[ -1 ] == \'talkback\':\n
result.append( { \'id\' : now[ -1 ]\n
, \'title\' : obj.Title()\n
obj = portal\n
now = []\n
module = True\n
for name in relative:\n
obj = obj[name]\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
}\n
)\n
module = False\n
\n
return result\n
</string> </value>
......@@ -283,13 +288,15 @@ return result\n
<string>context</string>
<string>relative</string>
<string>portal</string>
<string>obj</string>
<string>now</string>
<string>True</string>
<string>module</string>
<string>_getiter_</string>
<string>xrange</string>
<string>len</string>
<string>i</string>
<string>name</string>
<string>_getitem_</string>
<string>now</string>
<string>obj</string>
<string>title</string>
<string>False</string>
</tuple>
</value>
</item>
......
......@@ -124,8 +124,7 @@ IDEAS:\n
<div id="status">\n
<div id="breadcrumb">\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:condition="python: repeat[\'item\'].index &gt;= 2" tal:attributes="href item/url" tal:content="item/title" />\n
<a tal:attributes="href item/url" tal:content="item/title" />\n
/\n
</tal:block>\n
</div>\n
......
445
\ No newline at end of file
450
\ 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