[Checkins] SVN: plone.z3cform/trunk/plone/z3cform/macros.pt As the
standard macro, let's start off with something simpler, namely
Daniel Nouri
daniel.nouri at gmail.com
Tue Jul 22 13:44:12 EDT 2008
Log message for revision 88718:
As the standard macro, let's start off with something simpler, namely
the template that plone.z3cform used before the adding of support for
fieldsets in r21503:
http://dev.plone.org/plone/changeset/21503
Changed:
U plone.z3cform/trunk/plone/z3cform/macros.pt
-=-
Modified: plone.z3cform/trunk/plone/z3cform/macros.pt
===================================================================
--- plone.z3cform/trunk/plone/z3cform/macros.pt 2008-07-22 17:28:36 UTC (rev 88717)
+++ plone.z3cform/trunk/plone/z3cform/macros.pt 2008-07-22 17:44:07 UTC (rev 88718)
@@ -14,27 +14,15 @@
<h3 tal:condition="view/label | nothing">
<span tal:replace="view/label">Form title</span>:</h3>
+ <div class="description"
+ tal:condition="view/description | nothing"
+ tal:content="structure view/description">Form description</div>
<metal:define define-macro="titlelessform">
-
- <tal:status define="status view/status" condition="status">
- <dl class="portalMessage error"
- tal:condition="view/widgets/errors">
- <dt i18n:translate="">
- Error
- </dt>
- <dd tal:content="status" />
- </dl>
-
- <dl class="portalMessage info"
- tal:condition="not: view/widgets/errors">
- <dt i18n:translate="">
- Info
- </dt>
- <dd tal:content="status" />
- </dl>
- </tal:status>
+ <div class="portalMessage"
+ tal:condition="view/status" tal:content="view/status">
+ </div>
- <tal:comment condition="nothing">
+ <tal:comment condition="nothing">
<ul tal:define="errors view/widgets/errors"
tal:condition="errors">
<li tal:repeat="error errors">
@@ -42,124 +30,67 @@
<tal:block replace="structure error/render" />
</li>
</ul>
- </tal:comment>
-
- <p class="discreet"
- tal:define="description view/description | nothing"
- tal:content="description">
- Description
- </p>
+ </tal:comment>
- <form class="rowlike enableUnloadProtection" action="." method="post"
- tal:define="groups view/groups | nothing;
- form_name view/form_name | nothing;
- default_fieldset_label view/default_fieldset_label | form_name;
- has_groups python:bool(groups);
- show_default_label python:has_groups and default_fieldset_label or form_name;"
- tal:attributes="action request/getURL; enctype view/enctype;
- class python: has_groups and 'rowlike enableUnloadProtection enableFormTabbing' or default">
+ <form class="rowlike" action="." method="post"
+ tal:attributes="action request/getURL; enctype view/enctype">
- <input type="hidden"
- name="fieldset.current"
- tal:condition="has_groups"
- tal:attributes="value request/fieldset.current | string:" />
-
- <!-- Default fieldset -->
-
<metal:define define-macro="fields">
- <fieldset id="fieldset-default" tal:omit-tag="not:show_default_label">
-
- <legend tal:condition="show_default_label"
- tal:attributes="id string:fieldsetlegend-default"
- tal:content="default_fieldset_label">Form name</legend>
-
- <metal:define define-macro="widget_rendering">
- <tal:widgets repeat="widget view/widgets/values">
- <div class="row horizontal"
- tal:define="hidden python:widget.mode == 'hidden'"
- tal:omit-tag="hidden">
-
- <metal:field define-macro="field">
- <div class="field"
- tal:define="error widget/error"
- tal:attributes="class python:'field' + (error and ' error' or '')">
+ <tal:widgets repeat="widget view/widgets/values">
+ <div class="row horizontal"
+ tal:define="hidden python:widget.mode == 'hidden'"
+ tal:omit-tag="hidden">
+
+ <metal:field define-macro="field">
+ <div class="field"
+ tal:define="error widget/error"
+ tal:attributes="class python:'field' + (error and ' error' or '')">
- <label for="" class="horizontal"
- tal:attributes="for widget/id"
- tal:condition="not:hidden">
- <span i18n:translate=""
- tal:content="widget/label">label</span>
- </label>
+ <label for="" class="horizontal"
+ tal:attributes="for widget/id"
+ tal:condition="not:hidden">
+ <span i18n:translate=""
+ tal:content="widget/label">label</span>
+ </label>
- <span class="fieldRequired horizontal" title="Required"
- tal:condition="python:widget.required and not hidden"
- i18n:translate="label_required"
- i18n:attributes="title title_required;">
- (Required)
- </span>
+ <span class="fieldRequired horizontal" title="Required"
+ tal:condition="python:widget.required and not hidden"
+ i18n:translate="label_required"
+ i18n:attributes="title title_required;">
+ (Required)
+ </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>
+ <div class="formHelp"
+ 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="error/message">
- Error
- </div>
+ <div tal:condition="error"
+ tal:content="structure error/render">
+ Error
+ </div>
- <div class="widget horizontal">
- <input type="text" tal:replace="structure widget/render" />
- </div>
- </div>
- </metal:field>
+ <div class="widget horizontal">
+ <input type="text" tal:replace="structure widget/render" />
+ </div>
+ </div>
+ </metal:field>
- </div>
- </tal:widgets>
- </metal:define>
-
- </fieldset>
-
- <!-- Secondary fieldsets -->
+ </div>
+ </tal:widgets>
- <fieldset
- tal:condition="has_groups"
- tal:repeat="group groups"
- tal:attributes="id string:fieldset-${repeat/group/index}">
-
- <legend tal:define="form_name group/label"
- tal:condition="form_name"
- tal:attributes="id string:fieldsetlegend-${repeat/group/index}"
- tal:content="form_name">Form name</legend>
-
- <p i18n:translate=""
- tal:define="group_description group/description|nothing"
- tal:condition="group_description"
- tal:content="group_description">
- Description
- </p>
-
- <tal:block define="view nocall:group">
- <metal:block use-macro="context/@@ploneform-macros/widget_rendering" />
- </tal:block>
-
- </fieldset>
</metal:define>
<metal:define define-macro="actions">
-
- <div class="formFields" tal:condition="view/actions/values|nothing">
- <tal:block repeat="action view/actions/values">
- <input type="submit"
- tal:replace="structure action/render" />
- </tal:block>
+ <div class="action horizontal" tal:repeat="action view/actions/values|nothing">
+ <input type="submit" tal:replace="structure action/render" />
</div>
</metal:define>
- </form>
+ </form>
</metal:define>
</div>
More information about the Checkins
mailing list