From 5b7347b91309cda3efa680e6358a9183410f4749 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Wed, 4 Jul 2007 16:16:31 +0000
Subject: [PATCH] Improve zpt code. Thanks to Vincent.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15143 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../template_erp5_xhtml_style.xml             | 23 ++++++++-----------
 .../bootstrap/erp5_xhtml_style/bt/revision    |  2 +-
 2 files changed, 10 insertions(+), 15 deletions(-)

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 f699e0b3a4..187b32bf7c 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
@@ -100,23 +100,18 @@ IDEAS:\n
       <!-- Render each field\'s css and javascript. -->\n
     </tal:block>\n
     <tal:block tal:condition="python: form is not None">\n
-      <tal:block tal:repeat="group python: form.Form_getGroupTitleAndId()">\n
-        <tal:block tal:define="gid group/gid;">\n
-          <tal:block tal:condition="python: gid.find(\'hidden\') < 0">\n
-            <tal:block tal:repeat="field python: form.get_fields_in_group(group[\'goid\'])">\n
+      <tal:block tal:repeat="group python: [x for x in form.get_groups(include_empty=0) if x != \'hidden\']">\n
+        <tal:block tal:repeat="field python: form.get_fields_in_group(group)">\n
 \n
-              <tal:block tal:define="css python: field.render_css(REQUEST=request)">\n
-                <tal:block tal:condition="python: css is not None">\n
-                  <style tal:content="css"\n
-                         tal:attributes="type python:\'text/css\'">\n
-                  </style>\n
-                </tal:block>\n
-              </tal:block>\n
+          <tal:block tal:define="css python: field.render_css(REQUEST=request)">\n
+            <style tal:condition="python: css is not None" \n
+                   tal:content="css"\n
+                   tal:attributes="type python:\'text/css\'">\n
+            </style>\n
+          </tal:block>\n
 \n
-              <tal:block tal:define="dummy python: js_list.extend(field.get_javascript_list(REQUEST=request))" />\n
+          <tal:block tal:define="dummy python: js_list.extend(field.get_javascript_list(REQUEST=request))" />\n
 \n
-            </tal:block>\n
-          </tal:block>\n
         </tal:block>\n
       </tal:block>\n
     </tal:block>\n
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
index 25493604ef..43f9cb6413 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
@@ -1 +1 @@
-395
\ No newline at end of file
+396
\ No newline at end of file
-- 
2.30.9