[Checkins] SVN: plone.z3cform/trunk/ Added slots to the ``titlelessform`` macro. See ``README.txt`` for details.

Martin Aspeli optilude at gmx.net
Sun Mar 7 11:23:13 EST 2010


Log message for revision 109784:
  Added slots to the ``titlelessform`` macro. See ``README.txt`` for details.

Changed:
  U   plone.z3cform/trunk/README.txt
  U   plone.z3cform/trunk/docs/HISTORY.txt
  U   plone.z3cform/trunk/plone/z3cform/templates/macros.pt

-=-
Modified: plone.z3cform/trunk/README.txt
===================================================================
--- plone.z3cform/trunk/README.txt	2010-03-07 14:27:36 UTC (rev 109783)
+++ plone.z3cform/trunk/README.txt	2010-03-07 16:23:12 UTC (rev 109784)
@@ -231,7 +231,10 @@
 * ``form`` is a full page form, including the label (output as an ``<h3 />``),
   description, and all the elements of ``titlelessform``.
 * ``titlelessform`` includes the form ``status`` at the top, the ``<form />``
-  element, and the contents of the ``fields`` and ``actions`` macros.
+  element, and the contents of the ``fields`` and ``actions`` macros. It also
+  defines three slots: ``formtop`` is just inside the opening ``<form>`` tag;
+  ``formbottom``` is just inside the closing ``</form>`` tag;
+  ``beforeactions`` is just before the actions (form buttons) are output.
 * ``fields`` iterates over all widgets in the form and renders each, using the
   contents of the ``field`` macro.
 * ``field`` renders a single field. It expects the variable ``widget`` to be

Modified: plone.z3cform/trunk/docs/HISTORY.txt
===================================================================
--- plone.z3cform/trunk/docs/HISTORY.txt	2010-03-07 14:27:36 UTC (rev 109783)
+++ plone.z3cform/trunk/docs/HISTORY.txt	2010-03-07 16:23:12 UTC (rev 109784)
@@ -4,6 +4,9 @@
 0.5.11 - unreleased
 -------------------
 
+* Added slots to the ``titlelessform`` macro. See ``README.txt`` for details.
+  [optilude]
+
 * Remove the distinction between wrapped and unwrapped subforms. A subform is
   always wrapped by the form that contains it, and can use a Zope 3 page
   template.

Modified: plone.z3cform/trunk/plone/z3cform/templates/macros.pt
===================================================================
--- plone.z3cform/trunk/plone/z3cform/templates/macros.pt	2010-03-07 14:27:36 UTC (rev 109783)
+++ plone.z3cform/trunk/plone/z3cform/templates/macros.pt	2010-03-07 16:23:12 UTC (rev 109784)
@@ -18,14 +18,16 @@
            tal:condition="view/description | nothing"
            tal:content="structure view/description">Form description</div>
       <metal:define define-macro="titlelessform">
-	<div class="portalMessage"
+        <div class="portalMessage"
              tal:condition="view/status" tal:content="view/status">
-	</div>
+        </div>
 
 
-	<form action="." method="post"
+        <form action="." method="post"
               tal:attributes="action request/getURL; enctype view/enctype">
-
+          
+          <metal:block define-slot="formtop" />
+          
           <metal:define define-macro="fields">
 
             <tal:widgets repeat="widget view/widgets/values">
@@ -33,7 +35,7 @@
                    tal:define="hidden python:widget.mode == 'hidden'"
                    tal:omit-tag="hidden">
 
-		<metal:field define-macro="field">
+                <metal:field define-macro="field">
                   <div class="field"
                        tal:define="error widget/error"
                        tal:attributes="class python:'field' + (error and ' error' or '')">
@@ -52,14 +54,14 @@
                     </span>
 
                     <div class="formHelp"
-			 tal:define="description widget/field/description"
-			 i18n:translate=""
-			 tal:content="description"
-			 tal:condition="python:description and not hidden"
-			 >field description</div>
+                         tal:define="description widget/field/description"
+                         i18n:translate=""
+                         tal:content="description"
+                         tal:condition="python:description and not hidden"
+                         >field description</div>
 
                     <div tal:condition="error"
-			 tal:content="structure error/render">
+                         tal:content="structure error/render">
                       Error
                     </div>
 
@@ -67,20 +69,24 @@
                       <input type="text" tal:replace="structure widget/render" />
                     </div>
                   </div>
-		</metal:field>
+                </metal:field>
 
               </div>
             </tal:widgets>
 
           </metal:define>
-
+          
+          <metal:block define-slot="beforeactions" />
+          
           <metal:define define-macro="actions">
             <div class="action" tal:repeat="action view/actions/values|nothing">
               <input type="submit" tal:replace="structure action/render" />
             </div>
           </metal:define>
+          
+          <metal:block define-slot="formbottom" />
 
-	</form>
+        </form>
       </metal:define>
       </div>
 



More information about the checkins mailing list