Commit 27a66278 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* optimise TALES (use STRING expression or PATH expression instead of PYTHON...

* optimise TALES (use STRING expression or PATH expression instead of PYTHON expression if possible).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23828 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 47bc4e0c
...@@ -56,13 +56,13 @@ ...@@ -56,13 +56,13 @@
<tal:block tal:condition="python: here.getPortalTypeName() in portal.portal_types.objectIds() and portal.portal_types.getTypeInfo(here).Base_getSourceVisibility()">\n <tal:block tal:condition="python: here.getPortalTypeName() in portal.portal_types.objectIds() and portal.portal_types.getTypeInfo(here).Base_getSourceVisibility()">\n
<option value="1" disabled="disabled" i18n:translate="" i18n:domain="ui">-- Developper Mode --</option>\n <option value="1" disabled="disabled" i18n:translate="" i18n:domain="ui">-- Developper Mode --</option>\n
<option tal:attributes="value python: \'%s/manage_workspace\' % (here.portal_types.getTypeInfo(here).absolute_url(),)"\n <option tal:attributes="value python: \'%s/manage_workspace\' % (here.portal_types.getTypeInfo(here).absolute_url(),)"\n
i18n:translate="" i18n:domain="ui">Edit Portal Type \'<tal:block tal:content="python: here.getPortalTypeName()"\n i18n:translate="" i18n:domain="ui">Edit Portal Type \'<tal:block tal:content="here/getPortalTypeName"\n
i18n:name="portal_type" i18n:translate="" i18n:domain="ui" />\'</option>\n i18n:name="portal_type" i18n:translate="" i18n:domain="ui" />\'</option>\n
</tal:block>\n </tal:block>\n
<tal:block tal:condition="portal/portal_workflow/Base_getSourceVisibility">\n <tal:block tal:condition="portal/portal_workflow/Base_getSourceVisibility">\n
<option value="1" disabled="disabled" i18n:translate="" i18n:domain="ui">-- Workflows --</option>\n <option value="1" disabled="disabled" i18n:translate="" i18n:domain="ui">-- Workflows --</option>\n
<tal:block tal:repeat="workflow python: portal.portal_workflow.getWorkflowsFor(here)">\n <tal:block tal:repeat="workflow python: portal.portal_workflow.getWorkflowsFor(here)">\n
<option tal:attributes="value python: \'%s/manage_properties\' % (workflow.absolute_url(), )" tal:content="workflow/title" />\n <option tal:attributes="value string:${workflow/absolute_url}/manage_properties" tal:content="workflow/title" />\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
i18n:translate="" i18n:domain="ui">Action...</option>\n i18n:translate="" i18n:domain="ui">Action...</option>\n
<tal:block tal:define="allowed_content_type_list here/getVisibleAllowedContentTypeList | python:[]">\n <tal:block tal:define="allowed_content_type_list here/getVisibleAllowedContentTypeList | python:[]">\n
<tal:block tal:repeat="content_id allowed_content_type_list">\n <tal:block tal:repeat="content_id allowed_content_type_list">\n
<option tal:attributes="value python: \'add %s\' % (content_id, )"\n <option tal:attributes="value string:add $content_id"\n
i18n:translate="" i18n:domain="ui">Add <tal:block tal:content="content_id"\n i18n:translate="" i18n:domain="ui">Add <tal:block tal:content="content_id"\n
i18n:name="portal_type" i18n:translate="" i18n:domain="ui" /></option>\n i18n:name="portal_type" i18n:translate="" i18n:domain="ui" /></option>\n
</tal:block>\n </tal:block>\n
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
tal:condition="document_template_list">\n tal:condition="document_template_list">\n
<option disabled="disabled">-- <tal:block i18n:translate="" i18n:domain="ui">Templates</tal:block> --</option>\n <option disabled="disabled">-- <tal:block i18n:translate="" i18n:domain="ui">Templates</tal:block> --</option>\n
<tal:block tal:repeat="document_template document_template_list">\n <tal:block tal:repeat="document_template document_template_list">\n
<option tal:attributes="value python:\'template %s\' % (document_template.getRelativeUrl(), )"\n <option tal:attributes="value string:template ${document_template/getRelativeUrl}"\n
i18n:translate="" i18n:domain="ui">Add <tal:block tal:content="document_template/getTitle"\n i18n:translate="" i18n:domain="ui">Add <tal:block tal:content="document_template/getTitle"\n
i18n:name="document_template" /></option>\n i18n:name="document_template" /></option>\n
</tal:block>\n </tal:block>\n
...@@ -105,13 +105,13 @@ ...@@ -105,13 +105,13 @@
<option disabled="disabled">-- <tal:block i18n:translate="" i18n:domain="ui">Workflows</tal:block> --</option>\n <option disabled="disabled">-- <tal:block i18n:translate="" i18n:domain="ui">Workflows</tal:block> --</option>\n
<tal:block tal:repeat="action actions/workflow">\n <tal:block tal:repeat="action actions/workflow">\n
<option tal:content="action/name"\n <option tal:content="action/name"\n
tal:attributes="value python: \'workflow %s\' % (action[\'url\'], )"\n tal:attributes="value string:workflow ${action/url}"\n
i18n:translate="" i18n:domain="ui" />\n i18n:translate="" i18n:domain="ui" />\n
</tal:block>\n </tal:block>\n
<option disabled="disabled">-- <tal:block i18n:translate="" i18n:domain="ui">Object</tal:block> --</option>\n <option disabled="disabled">-- <tal:block i18n:translate="" i18n:domain="ui">Object</tal:block> --</option>\n
<tal:block tal:repeat="action actions/object_action | nothing">\n <tal:block tal:repeat="action actions/object_action | nothing">\n
<option tal:content="action/name"\n <option tal:content="action/name"\n
tal:attributes="value python: \'object %s\' % (action[\'url\'], )"\n tal:attributes="value string:object ${action/url}"\n
i18n:translate="" i18n:domain="ui" />\n i18n:translate="" i18n:domain="ui" />\n
</tal:block>\n </tal:block>\n
<tal:block tal:define="object_view_list actions/object_view|nothing;\n <tal:block tal:define="object_view_list actions/object_view|nothing;\n
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
tal:condition="module_view_list">\n tal:condition="module_view_list">\n
<tal:block tal:repeat="action module_view_list">\n <tal:block tal:repeat="action module_view_list">\n
<option tal:content="action/name"\n <option tal:content="action/name"\n
tal:attributes="value python: \'object %s\' % (action[\'url\'],)"\n tal:attributes="value string:object ${action/url}"\n
i18n:translate="" i18n:domain="ui" />\n i18n:translate="" i18n:domain="ui" />\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
<option disabled="disabled">-- <tal:block i18n:translate="" i18n:domain="ui">Folder</tal:block> --</option>\n <option disabled="disabled">-- <tal:block i18n:translate="" i18n:domain="ui">Folder</tal:block> --</option>\n
<tal:block tal:repeat="action actions/folder">\n <tal:block tal:repeat="action actions/folder">\n
<option tal:content="action/name"\n <option tal:content="action/name"\n
tal:attributes="value python: \'folder %s\' % (action[\'url\'], )"\n tal:attributes="value string:folder ${action/url}"\n
i18n:translate="" i18n:domain="ui" />\n i18n:translate="" i18n:domain="ui" />\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
...@@ -185,8 +185,8 @@ ...@@ -185,8 +185,8 @@
<span class="description" i18n:translate="" i18n:domain="ui">New</span>\n <span class="description" i18n:translate="" i18n:domain="ui">New</span>\n
</button>\n </button>\n
<button class="clone" type="submit" title="Clone"\n <button class="clone" type="submit" title="Clone"\n
tal:condition="python: not list_mode"\n tal:condition="not: list_mode"\n
tal:attributes="name python: \'Base_createCloneDocument:method\'"\n tal:attributes="name string:Base_createCloneDocument:method"\n
i18n:attributes="title" i18n:domain="ui">\n i18n:attributes="title" i18n:domain="ui">\n
<span class="image"></span>\n <span class="image"></span>\n
<span class="description" i18n:translate="" i18n:domain="ui">Clone</span>\n <span class="description" i18n:translate="" i18n:domain="ui">Clone</span>\n
...@@ -200,13 +200,13 @@ ...@@ -200,13 +200,13 @@
<tal:block tal:condition="request/selection_index | nothing">\n <tal:block tal:condition="request/selection_index | nothing">\n
<span class="separator"><!--separator--></span>\n <span class="separator"><!--separator--></span>\n
<a class="jump_first" title="First"\n <a class="jump_first" title="First"\n
tal:attributes="href python: \'portal_selections/viewFirst?%s\' % (http_parameters, )"\n tal:attributes="href string:portal_selections/viewFirst?$http_parameters"\n
i18n:attributes="title" i18n:domain="ui">\n i18n:attributes="title" i18n:domain="ui">\n
<span class="image"></span>\n <span class="image"></span>\n
<span class="description" i18n:translate="" i18n:domain="ui">First</span>\n <span class="description" i18n:translate="" i18n:domain="ui">First</span>\n
</a>\n </a>\n
<a class="jump_previous" title="Previous"\n <a class="jump_previous" title="Previous"\n
tal:attributes="href python: \'portal_selections/viewPrevious?%s\' % (http_parameters, )"\n tal:attributes="href string:portal_selections/viewPrevious?$http_parameters"\n
i18n:attributes="title" i18n:domain="ui">\n i18n:attributes="title" i18n:domain="ui">\n
<span class="image"></span>\n <span class="image"></span>\n
<span class="description" i18n:translate="" i18n:domain="ui">Previous</span>\n <span class="description" i18n:translate="" i18n:domain="ui">Previous</span>\n
...@@ -217,13 +217,13 @@ ...@@ -217,13 +217,13 @@
<span class="description" i18n:translate="" i18n:domain="ui">List Mode</span>\n <span class="description" i18n:translate="" i18n:domain="ui">List Mode</span>\n
</a>\n </a>\n
<a class="jump_next" title="Next"\n <a class="jump_next" title="Next"\n
tal:attributes="href python: \'portal_selections/viewNext?%s\' % (http_parameters, )"\n tal:attributes="href string:portal_selections/viewNext?$http_parameters"\n
i18n:attributes="title" i18n:domain="ui">\n i18n:attributes="title" i18n:domain="ui">\n
<span class="image"></span>\n <span class="image"></span>\n
<span class="description" i18n:translate="" i18n:domain="ui">Next</span>\n <span class="description" i18n:translate="" i18n:domain="ui">Next</span>\n
</a>\n </a>\n
<a class="jump_last" title="Last"\n <a class="jump_last" title="Last"\n
tal:attributes="href python: \'portal_selections/viewLast?%s\' % (http_parameters, )"\n tal:attributes="href string:portal_selections/viewLast?$http_parameters"\n
i18n:attributes="title" i18n:domain="ui">\n i18n:attributes="title" i18n:domain="ui">\n
<span class="image"></span>\n <span class="image"></span>\n
<span class="description" i18n:translate="" i18n:domain="ui">Last</span>\n <span class="description" i18n:translate="" i18n:domain="ui">Last</span>\n
...@@ -280,9 +280,9 @@ ...@@ -280,9 +280,9 @@
<tal:block tal:repeat="button_action button_actions">\n <tal:block tal:repeat="button_action button_actions">\n
<a tal:attributes="href python: \'%s%s%s\' % (button_action[\'url\'], \'?\' in button_action[\'url\'] and \'&amp;\' or \'?\', http_parameters)">\n <a tal:attributes="href python: \'%s%s%s\' % (button_action[\'url\'], \'?\' in button_action[\'url\'] and \'&amp;\' or \'?\', http_parameters)">\n
<img i18n:attributes="title" i18n:domain="ui"\n <img i18n:attributes="title" i18n:domain="ui"\n
tal:attributes="src python:button_action[\'icon\'];\n tal:attributes="src button_action/icon;\n
title python:button_action[\'name\'];\n title button_action/name;\n
alt python:button_action[\'name\']" />\n alt button_action/name" />\n
</a>\n </a>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
......
...@@ -45,23 +45,23 @@ ...@@ -45,23 +45,23 @@
<tal:block metal:define-macro="edit_link">\n <tal:block metal:define-macro="edit_link">\n
<a tabindex="1000" tal:condition="python: (getattr(object, \'meta_type\', None) is not None) and (getattr(object, \'getPortalObject\', None) is not None)"\n <a tabindex="1000" tal:condition="python: (getattr(object, \'meta_type\', None) is not None) and (getattr(object, \'getPortalObject\', None) is not None)"\n
tal:attributes="href python: \'%s/manage_main\' % (\'/\'.join(object.getPhysicalPath()[len(object.getPortalObject().getPhysicalPath()):])) # XXX: quick hack to get path;\n tal:attributes="href python: \'%s/manage_main\' % (\'/\'.join(object.getPhysicalPath()[len(object.getPortalObject().getPhysicalPath()):])) # XXX: quick hack to get path;\n
title info;"><img tal:attributes="src python: \'%s/images/%s\' % (portal_path, image);\n title info;"><img tal:attributes="src string:$portal_path/images/$image;\n
alt info;" /></a>\n alt info;" /></a>\n
</tal:block>\n </tal:block>\n
<tal:block metal:define-macro="translate_link">\n <tal:block metal:define-macro="translate_link">\n
<a tabindex="1000" tal:define="image image | python: \'translate.png\'"\n <a tabindex="1000" tal:define="image image | python: \'translate.png\'"\n
tal:attributes="href python: \'%s/manage_messages?regex=^%s%%24&amp;lang=%s\' % (\'/\'.join(here.Localizer.erp5_ui.getPhysicalPath()[len(here.Localizer.erp5_ui.getPortalObject().getPhysicalPath()):]), message.replace(\'(\', \'\\(\').replace(\')\', \'\\)\'), selected_language);\n tal:attributes="href python: \'%s/manage_messages?regex=^%s%%24&amp;lang=%s\' % (\'/\'.join(here.Localizer.erp5_ui.getPhysicalPath()[len(here.Localizer.erp5_ui.getPortalObject().getPhysicalPath()):]), message.replace(\'(\', \'\\(\').replace(\')\', \'\\)\'), selected_language);\n
title info;"><img tal:attributes="src python: \'%s/images/%s\' % (portal_path, image);\n title info;"><img tal:attributes="src string:$portal_path/images/$image;\n
alt info;" /></a>\n alt info;" /></a>\n
</tal:block>\n </tal:block>\n
<tal:block metal:define-macro="form">\n <tal:block metal:define-macro="form">\n
<tal:block tal:define="image python: \'editform.png\';\n <tal:block tal:define="image string:editform.png;\n
info python: \'Edit this form\';\n info string:Edit this form;\n
object nocall: form;">\n object nocall: form;">\n
<tal:block metal:use-macro="developper_shortcut_render/macros/edit_link" />\n <tal:block metal:use-macro="developper_shortcut_render/macros/edit_link" />\n
</tal:block>\n </tal:block>\n
<tal:block tal:define="image python: \'editformaction.png\';\n <tal:block tal:define="image string:editformaction.png;\n
info python: \'Edit this form\\\'s action\';\n info string:Edit this form\'s action;\n
object python: getattr(here, form.action, None);">\n object python: getattr(here, form.action, None);">\n
<tal:block metal:use-macro="developper_shortcut_render/macros/edit_link" />\n <tal:block metal:use-macro="developper_shortcut_render/macros/edit_link" />\n
<div class="clear">\n <div class="clear">\n
...@@ -69,23 +69,23 @@ ...@@ -69,23 +69,23 @@
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
<tal:block metal:define-macro="field_developper">\n <tal:block metal:define-macro="field_developper">\n
<tal:block tal:define="image python: \'editfield.png\';\n <tal:block tal:define="image string:editfield.png;\n
info python: \'Edit this field\';\n info string:Edit this field;\n
object nocall: field;">\n object nocall: field;">\n
<tal:block metal:use-macro="developper_shortcut_render/macros/edit_link" />\n <tal:block metal:use-macro="developper_shortcut_render/macros/edit_link" />\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
<tal:block metal:define-macro="field_translator">\n <tal:block metal:define-macro="field_translator">\n
<tal:block tal:define="info python: \'Translate this field title\';\n <tal:block tal:define="info string:Translate this field title;\n
message python: field[\'title\'];\n message field/title;\n
image python: \'translate.png\'">\n image string:translate.png">\n
<tal:block metal:use-macro="developper_shortcut_render/macros/translate_link" />\n <tal:block metal:use-macro="developper_shortcut_render/macros/translate_link" />\n
</tal:block>\n </tal:block>\n
<tal:block tal:condition="field_description | nothing">\n <tal:block tal:condition="field_description | nothing">\n
<tal:block tal:define="message field_description;\n <tal:block tal:define="message field_description;\n
info python: \'Translate this field description\';\n info string:Translate this field description;\n
image python: \'translate_tooltip.png\'"\n image string:translate_tooltip.png"\n
tal:condition="python: message not in (None, \'\')">\n tal:condition="message | nothing">\n
<tal:block metal:use-macro="developper_shortcut_render/macros/translate_link" />\n <tal:block metal:use-macro="developper_shortcut_render/macros/translate_link" />\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</tal:block>\n </tal:block>\n
</label>\n </label>\n
<div class="input" tal:content="structure python: html_tuple[1]" />\n <div class="input" tal:content="structure python: html_tuple[1]" />\n
<span tal:condition="python: field_has_error"\n <span tal:condition="field_has_error"\n
class="error"\n class="error"\n
tal:content="python: field_errors[field_id].error_text"\n tal:content="python: field_errors[field_id].error_text"\n
i18n:translate="" i18n:domain="ui" />\n i18n:translate="" i18n:domain="ui" />\n
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
\n \n
<tal:block metal:define-macro="content">\n <tal:block metal:define-macro="content">\n
<div class="content"\n <div class="content"\n
tal:define="group_list python: form.Form_getGroupTitleAndId();\n tal:define="group_list form/Form_getGroupTitleAndId;\n
gid_list python: \' \'.join([x[\'gid\'] for x in group_list if x not in (\'bottom\', \'hidden\')]);">\n gid_list python: \' \'.join([x[\'gid\'] for x in group_list if x not in (\'bottom\', \'hidden\')]);">\n
<tal:block tal:repeat="group group_list">\n <tal:block tal:repeat="group group_list">\n
<tal:block tal:define="gid group/gid">\n <tal:block tal:define="gid group/gid">\n
......
...@@ -71,7 +71,7 @@ It is possible to specify a group id and a group title by naming a group followi ...@@ -71,7 +71,7 @@ It is possible to specify a group id and a group title by naming a group followi
<tal:block\n <tal:block\n
tal:define="field_errors python: request.get(\'field_errors\', {});\n tal:define="field_errors python: request.get(\'field_errors\', {});\n
dummy python: request.set(\'here\', here);\n dummy python: request.set(\'here\', here);\n
group_list python: form.Form_getGroupTitleAndId();\n group_list form/Form_getGroupTitleAndId;\n
gid_list python: \' \'.join([x[\'gid\'] for x in group_list if x!=\'hidden\']);\n gid_list python: \' \'.join([x[\'gid\'] for x in group_list if x!=\'hidden\']);\n
field_render nocall: here/field_render/macros/field_render">\n field_render nocall: here/field_render/macros/field_render">\n
<tal:block tal:condition="preferred_html_style_developper_mode">\n <tal:block tal:condition="preferred_html_style_developper_mode">\n
......
...@@ -75,7 +75,7 @@ IDEAS:\n ...@@ -75,7 +75,7 @@ IDEAS:\n
<tal:block tal:define="css python: field.render_css(REQUEST=request)">\n <tal:block tal:define="css python: field.render_css(REQUEST=request)">\n
<style tal:condition="python: css is not None"\n <style tal:condition="python: css is not None"\n
tal:content="css"\n tal:content="css"\n
tal:attributes="type python:\'text/css\'">\n tal:attributes="type string:text/css">\n
</style>\n </style>\n
</tal:block>\n </tal:block>\n
<tal:block tal:define="dummy python: css_list.extend(field.get_css_list(REQUEST=request))" />\n <tal:block tal:define="dummy python: css_list.extend(field.get_css_list(REQUEST=request))" />\n
...@@ -83,10 +83,10 @@ IDEAS:\n ...@@ -83,10 +83,10 @@ IDEAS:\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
<tal:block tal:repeat="css python: css_list">\n <tal:block tal:repeat="css css_list">\n
<link tal:attributes="href css" type="text/css" rel="stylesheet" />\n <link tal:attributes="href css" type="text/css" rel="stylesheet" />\n
</tal:block>\n </tal:block>\n
<tal:block tal:repeat="js python: js_list">\n <tal:block tal:repeat="js js_list">\n
<script tal:attributes="src js" type="text/javascript"></script>\n <script tal:attributes="src js" type="text/javascript"></script>\n
</tal:block>\n </tal:block>\n
<link rel="icon" tal:attributes="href string:${portal_path}/favicon.ico" type="image/x-icon" />\n <link rel="icon" tal:attributes="href string:${portal_path}/favicon.ico" type="image/x-icon" />\n
......
613 614
\ 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