Skip to content

Commit

Permalink
Replaced the existing radiobutton-based boolean widget with the standard
Browse files Browse the repository at this point in the history
single checkbox Plone version.

svn path=/plone.app.z3cform/trunk/; revision=35017
  • Loading branch information
limi committed Mar 17, 2010
1 parent 5503de5 commit fca10c3
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/HISTORY.txt
Expand Up @@ -4,8 +4,13 @@ Changelog
0.5 - unreleased
----------------

* Replaced the existing radiobutton-based boolean widget with the standard
single checkbox Plone version.
[limi]

* Add @@ploneform-render-widget view, so that the widget chrome can be
customized for particular widget types.
[davisagli]

* Added slots to the ``titlelessform`` macro. See ``README.txt`` in
``plone.z3cform`` for details.
Expand Down
13 changes: 13 additions & 0 deletions plone/app/z3cform/configure.zcml
Expand Up @@ -33,6 +33,13 @@
template="templates/widget.pt"
permission="zope.Public"
/>
<browser:page
name="ploneform-render-widget"
for="z3c.form.interfaces.ISingleCheckBoxWidget"
layer=".interfaces.IPloneFormLayer"
template="templates/singlecheckbox.pt"
permission="zope.Public"
/>

<adapter factory=".templates.layout_factory" />
<adapter factory=".templates.form_factory" />
Expand Down Expand Up @@ -85,4 +92,10 @@
z3c.form.interfaces.IFormLayer"
/>

<adapter
factory="z3c.form.browser.checkbox.SingleCheckBoxFieldWidget"
for="zope.schema.interfaces.IBool
plone.app.z3cform.interfaces.IPloneFormLayer"
/>

</configure>
24 changes: 24 additions & 0 deletions plone/app/z3cform/templates/singlecheckbox.pt
@@ -0,0 +1,24 @@
<div
tal:define="widget context;
hidden python:widget.mode == 'hidden';
error widget/error;
error_class python:error and ' error' or '';
fieldname_class string:kssattr-fieldname-${widget/name};"
tal:attributes="class string:field z3cformInlineValidation ${fieldname_class}${error_class};
id string:formfield-${widget/id};">

<input type="text" tal:replace="structure widget/render" />

<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="fieldErrorBox"
tal:content="structure error/render|nothing">
Error
</div>

</div>

0 comments on commit fca10c3

Please sign in to comment.