Commit 10e7eef6 authored by Christophe Dumez's avatar Christophe Dumez

2006-08-21 Chris

* Made form_render code a lot lighter with same final result using a loop

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9276 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d0f6f1fe
...@@ -361,7 +361,7 @@ along with this program; if not, write to the Free Software\n ...@@ -361,7 +361,7 @@ 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 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n
*/\n */\n
\n \n
input, textarea, select, button, body, div, span {\n input, textarea, select, button, body, div, span, fieldset {\n
font-family: <dtml-var font_family>;\n font-family: <dtml-var font_family>;\n
font-size: <dtml-var font_size>;\n font-size: <dtml-var font_size>;\n
margin: 0;\n margin: 0;\n
...@@ -381,11 +381,11 @@ img {\n ...@@ -381,11 +381,11 @@ img {\n
border: 0;\n border: 0;\n
}\n }\n
\n \n
body, div, span {\n body, div, span, fieldset {\n
color: <dtml-var font_color>;\n color: <dtml-var font_color>;\n
}\n }\n
\n \n
div, span {\n div, span, fieldset {\n
background-color: inherit;\n background-color: inherit;\n
}\n }\n
\n \n
...@@ -418,6 +418,7 @@ a:hover {\n ...@@ -418,6 +418,7 @@ a:hover {\n
text-decoration: underline;\n text-decoration: underline;\n
}\n }\n
\n \n
p.clear,\n
h6.clear {\n h6.clear {\n
height: 0;\n height: 0;\n
margin: 0;\n margin: 0;\n
...@@ -505,21 +506,80 @@ div.index_html table {\n ...@@ -505,21 +506,80 @@ div.index_html table {\n
\n \n
.content .field {\n .content .field {\n
position: relative;\n position: relative;\n
clear: left;\n
}\n }\n
\n \n
.content .figure {\n .content .figure {\n
text-align: right;\n text-align: right;\n
}\n }\n
\n \n
.content .left {\n .group_title {\n
min-width: 50%;\n display: none;\n
}\n
\n
div.left,\n
fieldset.left {\n
width: 50%;\n
clear: left;\n clear: left;\n
float: left;\n float: left;\n
border: 0;\n
height: 100%;\n
border-style: solid;\n
border-width: 0;\n
/* border-top-width: 1px;\n
border-left-width: 1px;\n
border-bottom-width: 1px;\n
border-right-width: 0;*/\n
border-color: <dtml-var document_border_color>;\n
padding-top: 5px;\n
padding-bottom: 2px;\n
padding-left: 8px;\n
margin-right: -9px;\n
}\n }\n
\n \n
.content .right {\n div.right,\n
fieldset.right {\n
float: left;\n float: left;\n
width: 50%;\n width: 50%;\n
border: 0;\n
margin-left: -1px;\n
height: 100%;\n
border-style: solid;\n
border-width: 0;\n
/* border-top-width: 1px;\n
border-left-width: 0;\n
border-bottom-width: 1px;\n
border-right-width: 1px;*/\n
border-color: <dtml-var document_border_color>;\n
padding-top: 5px;\n
padding-bottom: 2px;\n
}\n
\n
div.center,\n
fieldset.center {\n
margin-top: 5px;\n
margin-bottom: 5px;\n
padding-bottom: 5px;\n
padding-top: 5px;\n
border-style: solid;\n
border-color: <dtml-var document_border_color>;\n
border-width: 1px;\n
}\n
\n
.document .content .top_group {\n
border-width: 1px;\n
border-style: solid;\n
padding: 5px;\n
margin-bottom: 5px;\n
}\n
\n
\n
fieldset.bottom {\n
border-width: 0;\n
}\n
\n
fieldset.bottom .field label {\n
display: none;\n
}\n }\n
\n \n
.content .field {\n .content .field {\n
...@@ -844,14 +904,6 @@ div.index_html table {\n ...@@ -844,14 +904,6 @@ div.index_html table {\n
padding: 5px;\n padding: 5px;\n
}\n }\n
\n \n
.document .content .top_group,\n
.document .content .center {\n
border-width: 1px;\n
border-style: solid;\n
padding: 5px;\n
margin-bottom: 5px;\n
}\n
\n
/* LISTBOX */\n /* LISTBOX */\n
/* FIXME:\n /* FIXME:\n
- listbox uses lots of IDs, but there can be more than one listbox in a page !\n - listbox uses lots of IDs, but there can be more than one listbox in a page !\n
...@@ -891,6 +943,7 @@ div.index_html table {\n ...@@ -891,6 +943,7 @@ div.index_html table {\n
.ListContent {\n .ListContent {\n
color: #000;\n color: #000;\n
background-color: <dtml-var document_background_color>;\n background-color: <dtml-var document_background_color>;\n
padding-left: 1px;\n
}\n }\n
\n \n
.ListContent table {\n .ListContent table {\n
......
...@@ -36,7 +36,9 @@ ...@@ -36,7 +36,9 @@
</item> </item>
<item> <item>
<key> <string>raw</string> </key> <key> <string>raw</string> </key>
<value> <string>/*\n <value> <string encoding="cdata"><![CDATA[
/*\n
Copyright (c) 20xx-2006 Nexedi SARL and Contributors. All Rights Reserved.\n Copyright (c) 20xx-2006 Nexedi SARL and Contributors. All Rights Reserved.\n
\n \n
This program is Free Software; you can redistribute it and/or\n This program is Free Software; you can redistribute it and/or\n
...@@ -57,7 +59,22 @@ function submitAction(form,act) {\n ...@@ -57,7 +59,22 @@ function submitAction(form,act) {\n
form.action = act;\n form.action = act;\n
form.submit();\n form.submit();\n
}\n }\n
</string> </value> \n
function fixLeftRightHeight(){\n
var lh=document.getElementById(\'fieldset_left\').offsetHeight;\n
var rh=document.getElementById(\'fieldset_right\').offsetHeight;\n
document.getElementById(\'fieldset_left\').style.height=(lh>rh)? lh+"px" : rh+"px";\n
document.getElementById(\'fieldset_right\').style.height=(lh>rh)? lh+"px" : rh+"px";\n
document.getElementById(\'fieldset_left\').style.borderTop = \'1px solid #3D7474\'\n
document.getElementById(\'fieldset_left\').style.borderLeft = \'1px solid #3D7474\'\n
document.getElementById(\'fieldset_left\').style.borderBottom = \'1px solid #3D7474\'\n
document.getElementById(\'fieldset_right\').style.borderTop = \'1px solid #3D7474\'\n
document.getElementById(\'fieldset_right\').style.borderRight = \'1px solid #3D7474\'\n
document.getElementById(\'fieldset_right\').style.borderBottom = \'1px solid #3D7474\'\n
}\n
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -95,45 +95,19 @@ Groups names becomes "left_group", "right_group", "left1_group", "right1_group", ...@@ -95,45 +95,19 @@ Groups names becomes "left_group", "right_group", "left1_group", "right1_group",
<tal:block metal:define-macro="master">\n <tal:block metal:define-macro="master">\n
<tal:block tal:define="field_errors python: request.get(\'field_errors\',{});\n <tal:block tal:define="field_errors python: request.get(\'field_errors\',{});\n
dummy python: request.set(\'here\', here);\n dummy python: request.set(\'here\', here);\n
left_group python: form.get_fields_in_group(\'left\');\n groups python: form.get_groups();">\n
right_group python: form.get_fields_in_group(\'right\');\n
center_group python: form.get_fields_in_group(\'center\');\n
bottom_group python: form.get_fields_in_group(\'bottom\');">\n
<tal:block tal:define="template python: here.developper_shortcut_render">\n <tal:block tal:define="template python: here.developper_shortcut_render">\n
<tal:block metal:use-macro="template/macros/form" />\n <tal:block metal:use-macro="template/macros/form" />\n
</tal:block>\n </tal:block>\n
<div tal:condition="python: len(left_group) > 0 or len(right_group) > 0"\n <tal:block tal:repeat="group groups">\n
class="top_group">\n \t <fieldset tal:attributes="class group; id python: \'fieldset_\'+group" tal:condition="python: group.find(\'hidden\') < 0 and len(form.get_fields_in_group(group)) > 0">\n
<div tal:condition="python: len(left_group) > 0"\n <legend tal:content="group" class="group_title"/>\n
class="left">\n <tal:block tal:repeat="field python:form.get_fields_in_group(group)">\n
<tal:block tal:repeat="field left_group">\n <tal:block metal:use-macro="here/field_render/macros/field_render"/>\n
<tal:block metal:use-macro="here/field_render/macros/field_render" />\n
</tal:block>\n </tal:block>\n
</div>\n </fieldset>\n
<div tal:condition="python: len(right_group) > 0"\n <p tal:condition="python: group.find(\'right\') >= 0" class="clear">&nbsp;</p>\n
class="right">\n </tal:block>\n
<tal:block tal:repeat="field right_group">\n
<tal:block metal:use-macro="here/field_render/macros/field_render" />\n
</tal:block>\n
</div>\n
<h6 class="clear">&nbsp;</h6>\n
</div>\n
<div tal:condition="python: len(center_group) > 0"\n
class="center">\n
<tal:block tal:repeat="field center_group">\n
<tal:block metal:use-macro="here/field_render/macros/field_render" />\n
</tal:block>\n
</div>\n
<div tal:condition="python: len(bottom_group) > 0"\n
class="bottom">\n
<tal:block tal:repeat="field bottom_group">\n
<tal:block tal:define="template python: here.developper_shortcut_render">\n
<tal:block metal:use-macro="template/macros/field" />\n
</tal:block>\n
<tal:block tal:define="value python:request.get(field.id, None)"\n
tal:replace="structure python:field.render(value, request)" />\n
</tal:block>\n
</div>\n
</tal:block>\n </tal:block>\n
</tal:block> </tal:block>
......
...@@ -137,7 +137,7 @@ IDEAS:\n ...@@ -137,7 +137,7 @@ IDEAS:\n
type="text/javascript"></script>\n type="text/javascript"></script>\n
</tal:block>\n </tal:block>\n
</head>\n </head>\n
<body>\n <body onload="fixLeftRightHeight()">\n
<!-- <tal:block tal:replace="structure request"/> -->\n <!-- <tal:block tal:replace="structure request"/> -->\n
<form id="main_form"\n <form id="main_form"\n
tal:attributes="enctype form/enctype | nothing;\n tal:attributes="enctype form/enctype | nothing;\n
......
2006-08-21 Chris
* Made form_render code a lot lighter with same final result using a loop
2006-08-02 Romain 2006-08-02 Romain
* Add documentation_view to fix Inspector with xhtml_style. * Add documentation_view to fix Inspector with xhtml_style.
......
81 83
\ No newline at end of file \ No newline at end of file
1.1 1.2
\ 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