[Checkins] SVN: z3c.formui/trunk/ Add group support to templates.

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Jun 27 04:44:16 EDT 2007


Log message for revision 77118:
  Add group support to templates.
  

Changed:
  U   z3c.formui/trunk/CHANGES.txt
  U   z3c.formui/trunk/setup.py
  U   z3c.formui/trunk/src/z3c/formui/div-form.pt
  U   z3c.formui/trunk/src/z3c/formui/table-form.pt

-=-
Modified: z3c.formui/trunk/CHANGES.txt
===================================================================
--- z3c.formui/trunk/CHANGES.txt	2007-06-27 08:10:36 UTC (rev 77117)
+++ z3c.formui/trunk/CHANGES.txt	2007-06-27 08:44:15 UTC (rev 77118)
@@ -2,6 +2,11 @@
 CHANGES
 =======
 
+Version 1.1.0 (??/??/2007)
+-------------------------
+
+- Feature: Added support for groups to templates.
+
 Version 1.0.1 (6/22/2007)
 -------------------------
 

Modified: z3c.formui/trunk/setup.py
===================================================================
--- z3c.formui/trunk/setup.py	2007-06-27 08:10:36 UTC (rev 77117)
+++ z3c.formui/trunk/setup.py	2007-06-27 08:44:15 UTC (rev 77118)
@@ -23,7 +23,7 @@
 
 setup (
     name='z3c.formui',
-    version='1.0.1',
+    version='1.1.0b1',
     author = "Stephan Richter, Roger Ineichen and the Zope Community",
     author_email = "zope3-dev at zope.org",
     description = "A set of initial UI components for z3c.form.",

Modified: z3c.formui/trunk/src/z3c/formui/div-form.pt
===================================================================
--- z3c.formui/trunk/src/z3c/formui/div-form.pt	2007-06-27 08:10:36 UTC (rev 77117)
+++ z3c.formui/trunk/src/z3c/formui/div-form.pt	2007-06-27 08:44:15 UTC (rev 77118)
@@ -9,22 +9,22 @@
                       id view/id">
   <div class="viewspace" metal:define-slot="viewspace">
     <metal:block define-macro="header">
-    <div class="status"
-           tal:define="status view/status"
-           tal:condition="status">
-      <div class="summary"
-             i18n:translate=""
-             tal:content="view/status">
-        Form status summary
+      <div class="status"
+             tal:define="status view/status"
+             tal:condition="status">
+        <div class="summary"
+               i18n:translate=""
+               tal:content="view/status">
+          Form status summary
+        </div>
+        <ul class="errors" tal:condition="view/widgets/errors">
+          <li tal:repeat="error view/widgets/errors">
+            <span tal:replace="error/widget/label" />
+            :
+            <span tal:replace="structure error/render">Error Type</span>
+          </li>
+        </ul>
       </div>
-      <ul class="errors" tal:condition="view/widgets/errors">
-        <li tal:repeat="error view/widgets/errors">
-          <span tal:replace="error/widget/label" />
-          :
-          <span tal:replace="structure error/render">Error Type</span>
-        </li>
-      </ul>
-    </div>
     </metal:block>
     <div metal:define-slot="extra-info" tal:replace="nothing">
     </div>
@@ -37,7 +37,8 @@
                 <label tal:attributes="for widget/id">
                   <span i18n:translate=""
                       tal:content="widget/label">label</span>
-                  <span class="required" tal:condition="widget/required">*</span>
+                  <span class="required"
+                        tal:condition="widget/required">*</span>
                 </label>
               </div>
               <div class="widget" tal:content="structure widget/render">
@@ -54,6 +55,15 @@
                  tal:replace="structure widget/render" />
         </tal:block>
       </metal:block>
+      <metal:block define-macro="groups">
+        <fieldgroup tal:condition="view/groups|nothing"
+                    tal:repeat="view view/groups">
+          <legend tal:condition="view/label"
+                  tal:content="view/label">Label</legend>
+          <div metal:use-macro="template/macros/header" />
+          <div metal:use-macro="template/macros/widget-rows" />
+        </fieldgroup>
+      </metal:block>
     </div>
     <metal:block define-slot="above-buttons">
     </metal:block>

Modified: z3c.formui/trunk/src/z3c/formui/table-form.pt
===================================================================
--- z3c.formui/trunk/src/z3c/formui/table-form.pt	2007-06-27 08:10:36 UTC (rev 77117)
+++ z3c.formui/trunk/src/z3c/formui/table-form.pt	2007-06-27 08:44:15 UTC (rev 77118)
@@ -30,7 +30,9 @@
     </div>
     <div metal:define-slot="main">
       <table class="form-fields" metal:define-macro="formtable">
-        <tr class="extraTopRow" metal:define-slot="extra_top" tal:replace="nothing">
+        <tr class="extraTopRow"
+            metal:define-slot="extra_top"
+            tal:replace="nothing">
           <td class="label"> Extra top </td>
           <td class="field"><input type="text" />
           </td>
@@ -43,7 +45,8 @@
                 <label tal:attributes="for widget/id">
                   <span i18n:translate=""
                         tal:content="widget/label"> label </span>
-                  <span class="required" tal:condition="widget/required"> * </span>
+                  <span class="required"
+                        tal:condition="widget/required"> * </span>
                 </label>
               </td>
               <td class="field" metal:define-macro="widgetcell">
@@ -58,15 +61,27 @@
             </tr>
           </tal:block>
         </tbody>
-        <tr class="extraBottomRow" metal:define-slot="extra_bottom" tal:replace="nothing">
+        <tr class="extraBottomRow"
+            metal:define-slot="extra_bottom"
+            tal:replace="nothing">
           <td class="label"> Extra bottom </td>
           <td class="label"><input type="text" />
           </td>
         </tr>
       </table>
+      <metal:block define-macro="groups">
+        <fieldgroup tal:condition="view/groups|nothing"
+                    tal:repeat="view view/groups">
+          <legend tal:condition="view/label"
+                  tal:content="view/label">Label</legend>
+          <div metal:use-macro="template/macros/header" />
+          <div metal:use-macro="template/macros/formtable" />
+        </fieldgroup>
+      </metal:block>
       <tal:block repeat="widget view/widgets/values"
-	    ><input type="hidden" value="" tal:condition="python:widget.mode == 'hidden'"
-               tal:replace="structure widget/render" 
+	    ><input type="hidden" value=""
+                    tal:condition="python:widget.mode == 'hidden'"
+                    tal:replace="structure widget/render"
       /></tal:block>
     </div>
     <metal:block define-slot="above-buttons">



More information about the Checkins mailing list