From 891e8078800e5cc79636d84c46ce6343d122dbd4 Mon Sep 17 00:00:00 2001 From: Kevin Deldycke <kevin@nexedi.com> Date: Fri, 25 Aug 2006 09:14:45 +0000 Subject: [PATCH] Move hidden input and globals definition code to separate file. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9425 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../erp5_xhtml_style/global_definitions.xml | 106 ++++++++++++++++++ .../template_erp5_xhtml_style.xml | 36 +----- .../bootstrap/erp5_xhtml_style/bt/change_log | 3 + .../bootstrap/erp5_xhtml_style/bt/revision | 2 +- .../bootstrap/erp5_xhtml_style/bt/version | 2 +- 5 files changed, 115 insertions(+), 34 deletions(-) create mode 100644 product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/global_definitions.xml diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/global_definitions.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/global_definitions.xml new file mode 100644 index 0000000000..8282370006 --- /dev/null +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/global_definitions.xml @@ -0,0 +1,106 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <tuple> + <string>Products.PageTemplates.ZopePageTemplate</string> + <string>ZopePageTemplate</string> + </tuple> + <none/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>__ac_local_roles__</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_bind_names</string> </key> + <value> + <object> + <klass> + <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>_asgns</string> </key> + <value> + <dictionary> + <item> + <key> <string>name_subpath</string> </key> + <value> <string>traverse_subpath</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>_text</string> </key> + <value> <string encoding="cdata"><![CDATA[ + +\n +<tal:block metal:define-macro="header_definitions">\n + <tal:block tal:define="\n + cancel_url request/cancel_url | request/ACTUAL_URL;\n + local_parameter_list local_parameter_list | python: {};\n + dummy python: local_parameter_list.update({\'cancel_url\': cancel_url});\n +\n + global actions python: here.getPortalObject().portal_actions.listFilteredActionsFor(here);\n + global url python: \'%s%s\' % (request[\'SERVER_URL\'], here.getPath(), );\n + global current_form_id python: local_parameter_list.get(\'dialog_id\', local_parameter_list.get(\'form_id\', \'view\'));\n + global current_url python: \'%s/%s\' % (url, current_form_id);\n + global current_action python: here.ERP5XhtmlStyle_getCurrentAction(current_url, actions);\n +\n + dummy python: request.set(\'here\', here);\n +\n + global css_list css_list | python: [];\n + dummy python: css_list.append(\'%s/erp5.css\' % (here.portal_url.getPortalPath(), ));\n +\n + global js_list js_list | python: [];\n + dummy python: js_list.append(\'%s/erp5.js\' % (here.portal_url.getPortalPath(), ));\n +\n + global http_parameter_list request/form/copy;\n + http_parameter_list python: here.ERP5XhtmlStyle_filterParameterList(http_parameter_list);\n + dummy python: http_parameter_list.update(local_parameter_list);\n + global http_parameters python: here.ERP5XhtmlStyle_renderHTTPParameterList(http_parameter_list);\n + "/>\n +</tal:block>\n +\n +\n +<tal:block metal:define-macro="http_definitions">\n + <tal:block tal:repeat="parameter http_parameter_list/items">\n + <tal:block tal:condition="python: same_type(parameter[1], [])">\n + <tal:block tal:repeat="list_item python: parameter[1]">\n + <input type="hidden"\n + tal:condition="python: list_item is not None"\n + tal:attributes="name python: \'%s:list\' % (parameter[0], );\n + value python: list_item;"/>\n + </tal:block>\n + </tal:block>\n + <input type="hidden"\n + tal:condition="python: not same_type(parameter[1], []) and parameter[1] is not None"\n + tal:attributes="name python: parameter[0];\n + value python: parameter[1];"/>\n + </tal:block>\n +</tal:block> + +]]></string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>global_definitions</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/template_erp5_xhtml_style.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/template_erp5_xhtml_style.xml index 63b49a72e4..f78842fbd6 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/template_erp5_xhtml_style.xml +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/template_erp5_xhtml_style.xml @@ -75,29 +75,11 @@ IDEAS:\n - Add callbacks to ERP5Form object (selection ?) to gather needed fields -> put them in http_parameter_list.\n -->\n </tal:block>\n -<tal:block metal:define-macro="master">\n -<tal:block tal:define="\n - cancel_url request/cancel_url | request/ACTUAL_URL;\n - local_parameter_list local_parameter_list | python: {};\n - dummy python: local_parameter_list.update({\'cancel_url\': cancel_url});\n \n - global actions python: here.getPortalObject().portal_actions.listFilteredActionsFor(here);\n - global url python: \'%s%s\' % (request[\'SERVER_URL\'], here.getPath(), );\n - global current_form_id python: local_parameter_list.get(\'dialog_id\', local_parameter_list.get(\'form_id\', \'view\'));\n - global current_url python: \'%s/%s\' % (url, current_form_id);\n - global current_action python: here.ERP5XhtmlStyle_getCurrentAction(current_url, actions);\n - dummy python: request.set(\'here\', here);\n - global css_list css_list | python: [];\n - dummy python: css_list.append(\'%s/erp5.css\' % (here.portal_url.getPortalPath(), ));\n - global js_list js_list | python: [];\n - dummy python: js_list.append(\'%s/erp5.js\' % (here.portal_url.getPortalPath(), ));\n +<tal:block metal:define-macro="master">\n \n +<tal:block metal:use-macro="here/global_definitions/macros/header_definitions"/>\n \n - global http_parameter_list request/form/copy;\n - http_parameter_list python: here.ERP5XhtmlStyle_filterParameterList(http_parameter_list);\n - dummy python: http_parameter_list.update(local_parameter_list);\n - global http_parameters python: here.ERP5XhtmlStyle_renderHTTPParameterList(http_parameter_list);\n - " />\n <?xml version="1.0" encoding="UTF-8"?>\n <!DOCTYPE html\n PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n @@ -149,20 +131,10 @@ IDEAS:\n <input tal:condition="form_action | nothing"\n id="hidden_button" type="submit" value="dummy"\n tal:attributes="name python: \'%s:method\' % (form_action, )" />\n +\n <!-- Generic way of specifying http parameters -->\n - <tal:block tal:repeat="parameter http_parameter_list/items">\n - <tal:block tal:condition="python: same_type(parameter[1], [])">\n - <tal:block tal:repeat="list_item python: parameter[1]">\n - <input tal:condition="python: list_item is not None"\n - tal:attributes="name python: \'%s:list\' % (parameter[0], );\n - value python: list_item;" type="hidden" />\n - </tal:block>\n - </tal:block>\n - <input tal:condition="python: not same_type(parameter[1], []) and parameter[1] is not None"\n - tal:attributes="name python: parameter[0];\n - value python: parameter[1];" type="hidden" />\n + <tal:block metal:use-macro="here/global_definitions/macros/http_definitions"/>\n \n - </tal:block>\n <div id="main_bar">\n <span class="first">\n <span id="favourites">\n diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log b/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log index b7301fac68..198a4fc9fc 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log +++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log @@ -1,3 +1,6 @@ +2006-08-25 Kevin +* Move hidden input and globals definition code to separate file. + 2006-08-24 Kevin * Add a specific div wrapper class to differenciate editable mode. * Fix generator xhtml tag. diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision index 6d58c4e590..97e3504110 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision +++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision @@ -1 +1 @@ -109 \ No newline at end of file +110 \ No newline at end of file diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/version b/product/ERP5/bootstrap/erp5_xhtml_style/bt/version index 732aa7d7d5..67eb68059b 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/version +++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/version @@ -1 +1 @@ -1.2.10 \ No newline at end of file +1.2.12 \ No newline at end of file -- 2.30.9