Commit 5e493e9f authored by Jean-Paul Smets's avatar Jean-Paul Smets

form_view_editable can be useful to create editable forms in Web mode without using a dialog.

HTML display should always be based on asStrippedHTML and never on asTextContent.
WebSite now includes a custom renderer ad well as WebSection.
Some fields now have hiddenLabel CSS (to be renamed hidden_label).
Renames WebSite_createWebSiteAccountForm to WebSite_viewRegistrationDialog
admin toolbox CSS improvement

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15461 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 798c3c95
......@@ -221,7 +221,7 @@
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string>page</string> </value>
<value> <string>page hiddenLabel</string> </value>
</item>
<item>
<key> <string>default</string> </key>
......
......@@ -45,6 +45,12 @@
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_text_content</string> </value>
......@@ -136,7 +142,9 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -283,4 +291,23 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.getTextContent().replace(\'\\\\\', \'\\\\\\\\\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -103,6 +103,7 @@
<string>my_short_title</string>
<string>my_container_layout</string>
<string>my_content_layout</string>
<string>my_custom_render_method_id</string>
</list>
</value>
</item>
......
......@@ -65,7 +65,7 @@
dummy python: response.redirect(url);"/>\n
</tal:block>\n
<tal:block tal:condition="not: isAnon">\n
<tal:block tal:define="came_from python: \'%s/group_section\' % request.get(\'came_from\') or here.portal_url() + \'/view\';\n
<tal:block tal:define="came_from python: \'%s\' % request.get(\'came_from\') or here.portal_url() + \'/view\';\n
dummy python: response.redirect(came_from);" />\n
</tal:block>\n
</tal:block>
......@@ -86,7 +86,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Login Page Template used by login and resitration main page</string> </value>
<value> <string>Login Page Template used by login and registration main page</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -103,6 +103,7 @@
<string>my_short_title</string>
<string>my_container_layout</string>
<string>my_content_layout</string>
<string>my_custom_render_method_id</string>
</list>
</value>
</item>
......@@ -112,6 +113,8 @@
<list>
<string>my_aggregate_title_list</string>
<string>my_webmaster</string>
<string>my_int_index</string>
<string>my_visible</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.StandardFields</string>
<string>CheckBoxField</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_visible</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Visible</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.TALESField</string>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:here.isVisible() * \'checked\'</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</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/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>WebSite_createPersonAccount</string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>your_first_name</string>
<string>your_last_name</string>
<string>your_default_email_text</string>
<string>your_default_telephone_text</string>
<string>your_default_fax_text</string>
<string>your_default_address_street_address</string>
<string>your_default_address_city</string>
<string>your_default_address_zip_code</string>
<string>your_default_address_region</string>
<string>your_reference</string>
<string>your_password</string>
<string>your_password_confirm</string>
<string>submit</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSite_viewRegistrationDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>WebSite_createWebSiteAccountForm</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view_editable</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Create Your New Account</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>submit</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_address_city</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_address_region</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_address_street_address</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_address_zip_code</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_email_text</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_fax_text</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_default_telephone_text</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_first_name</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_last_name</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_password</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_password_confirm</string> </value>
......
......@@ -12,6 +12,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_reference</string> </value>
......
......@@ -93,12 +93,14 @@ Example of macro use (similar to \'erp5_web_default_template\' use):\n
<tal:block tal:repeat="group group_list">\n
<tal:block tal:define="gid group/gid;\n
gtitle group/gtitle;\n
goid group/goid;">\n
goid group/goid;\n
field_list python: layout_form.get_fields_in_group(goid);">\n
<div tal:attributes="class python: gid;\n
id python: \'fieldset_\' + gid.replace(\' \', \'_\');">\n
id python: \'fieldset_\' + gid.replace(\' \', \'_\');"\n
tal:condition="python:len(field_list)">\n
<fieldset class="widget">\n
<legend tal:content="python: gtitle" class="group_title"/>\n
<tal:block tal:repeat="field python: layout_form.get_fields_in_group(goid)">\n
<tal:block tal:repeat="field field_list">\n
<tal:block metal:use-macro="here/field_render/macros/field_render"/>\n
</tal:block>\n
</fieldset>\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>OFS.Image</string>
<string>Image</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>folder.png</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/png</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="base64">iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA
BGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VG
AAAByElEQVR42mJkgAKjktv/Gf4zMDAC2f8ZwSRY/FyPKiMDHgAQQGBkWHDt/9fff/9//fkXQUMx
SA6fXoAAYjHIvfR/e6s6w+dfUBGo5TA36PHeZmDIvfj/PyNIjJEB7Eyo/PnJ+owAAcTC8PcXw+ff
mCb//wdUxMTAUFPoA+EzQPgMQHEGJgg/7O+Z/wABxPL/zy+GDz/wuBFoVVTZFRySrAwAAcTyH+iC
d1DnMwPxXxj9H0Jn1l1hqEyXZYgz40fRuuEqA0Nl3xUGgABi+f/vL8QFQJtqWjBtSoySBmuecBBo
KCw+kIIVIICALvjN8OEnA0Nn2zkGz0AjholBmA7NX4sIXGTw99dvBoAAAobBT4b3QBf8/fmL4ek7
BobgOQhbQMnhP2aQQMSAxJ+fPxkAAgjshU9AF/z9/oPh5XuoCniwI9mKnJygciA9AAEEDkRQGvgD
5Lz/ikMzmhDMrL/ffjAABBA4DL4CXfD7+1eGq40MRIONG08ypO75zgAQQEwM//7ATSMV/P32jQEg
gIAu+MPw9jvQBT++g00lBfwB6gEIILB31L2n/3906RdqUCP7GpwR0EITyP3+OJ8RIIAY////z0AJ
AAgwAMOI0lA6uJJcAAAAAElFTkSuQmCC</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>16</int> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>594</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>16</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block tal:replace="nothing"\n
xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal"\n
xmlns:i18n="http://xml.zope.org/namespaces/i18n">\n
<!--\n
Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved.\n
Vincent Pelletier <vincent@nexedi.com>\n
Christophe Dumez <christophe@nexedi.com>\n
Jean-Paul Smets <jp@nexedi.com>\n
\n
This program is Free Software; you can redistribute it and/or\n
modify it under the terms of the GNU General Public License\n
as published by the Free Software Foundation; either version 2\n
of the License, or (at your option) any later version.\n
\n
This program is distributed in the hope that it will be useful,\n
but WITHOUT ANY WARRANTY; without even the implied warranty of\n
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n
GNU General Public License for more details.\n
\n
You should have received a copy of the GNU General Public License\n
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:use-macro="here/view_main/macros/master">\n
<tal:block metal:fill-slot="main"\n
tal:define="editable_mode python: True;\n
dummy python: request.set(\'editable_mode\', editable_mode)">\n
<tal:block metal:use-macro="here/form_render/macros/master" />\n
</tal:block>\n
</tal:block>\n
</tal:block>
]]></string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>form_view_editable</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -66,10 +66,15 @@
<tal:block define="dummy python: request.RESPONSE.setHeader(\'Content-Type\', \'text/css;; charset=utf-8\')"/>\n
\n
\n
div.adminToolbox input, textarea, select { /* This should be common XXX */\n
div.adminToolbox input, textarea{ /* This should be common XXX */\n
border: 1px solid #999;\n
}\n
\n
div.adminToolbox select {\n
border: 1px solid #999;\n
max-width: 12em;\n
}\n
\n
div.adminToolbox input, textarea {\n
padding: 1px;\n
}\n
......
......@@ -44,6 +44,12 @@
</object>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
......@@ -88,7 +94,7 @@ Description:\n
<input type="submit" name="search_area/WebSite_viewQuickSearchResultList:method" value="Search"/>\n
</div>\n
<div class="searchOptions">\n
<a tal:attributes="href string: ${web_site_url}/search_area/WebSite_viewAdvancedSearch" i18n:translate="" i18n:domain="ui">Advanced Search</a> | <a href="javascript:void 0" onclick="javascript:openTips();" value="" i18n:translate="" i18n:domain="ui">Search Tips</a>\n
<a tal:attributes="href string: search_area/Base_viewAdvancedSearchDialog" i18n:translate="" i18n:domain="ui">Advanced Search</a> | <a href="javascript:void 0" onclick="javascript:openTips();" value="" i18n:translate="" i18n:domain="ui">Search Tips</a>\n
</div>\n
</div>\n
<div class="clear"></div>\n
......
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