From 17f69549732c2346c95dc4ffb460e4b7070ffb84 Mon Sep 17 00:00:00 2001 From: Jean-Paul Smets <jp@nexedi.com> Date: Fri, 3 Aug 2007 14:08:18 +0000 Subject: [PATCH] better support of editable mode in form_dialog (make sure the environment knows immediately that we moved to editable mode) allow layout_form_id to be passed in the request so that a page template can select the layout it wished to be rendered in (this is useful to create a front page of web site with very different layout from the rest of the site) git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15464 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../portal_skins/erp5_xhtml_style/form_dialog.xml | 8 ++++---- .../portal_skins/erp5_xhtml_style/main_template.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/form_dialog.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/form_dialog.xml index 054247dad8..1ff2b28bd2 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/form_dialog.xml +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/form_dialog.xml @@ -78,7 +78,9 @@ along with this program; if not, write to the Free Software\n Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n -->\n </tal:block>\n -<tal:block metal:define-macro="master">\n +<tal:block metal:define-macro="master"\n + tal:define="editable_mode python: True;\n + dummy python: request.set(\'editable_mode\', editable_mode)">\n <tal:block metal:use-macro="here/dialog_main/macros/master">\n <tal:block metal:fill-slot="main">\n <tal:block tal:define="field_errors python: request.get(\'field_errors\',{});\n @@ -87,9 +89,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n right_group python: form.get_fields_in_group(\'right\');\n center_group python: form.get_fields_in_group(\'center\');\n dialog_actions python: actions.get(dialog_category, []);\n - field_render here/field_render/macros/field_render;\n - editable_mode python: True;\n - dummy python: request.set(\'editable_mode\', editable_mode)">\n + field_render here/field_render/macros/field_render;">\n <tal:block tal:condition="preferred_html_style_developper_mode">\n <tal:block metal:use-macro="developper_shortcut_render/macros/form" />\n </tal:block>\n diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/main_template.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/main_template.xml index f047871f87..28d081c767 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/main_template.xml +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/main_template.xml @@ -84,7 +84,7 @@ IDEAS:\n <tal:block metal:define-macro="master">\n <tal:block\n tal:define="ignore_layout request/ignore_layout | nothing;\n - layout_form_id here/getApplicableLayout | nothing;\n + layout_form_id request/layout_form_id | here/getApplicableLayout | nothing;\n layout_form python: layout_form_id and getattr(here, layout_form_id, None) or None;\n is_web_mode python: (layout_form is not None) and (not ignore_layout);\n editable_mode python: (not is_web_mode) or request.get(\'editable_mode\', False);\n -- 2.30.9