Skip to content

Commit

Permalink
Added a consistent id on single checkbox widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdesvenain committed Feb 18, 2014
1 parent faa2d16 commit 033e027
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
3 changes: 1 addition & 2 deletions CHANGES.txt
Expand Up @@ -5,8 +5,7 @@ CHANGES
3.1.1 (unreleased)
------------------

- Nothing changed yet.

- Added a consistent id on single checkbox widget.

3.1.0 (2013-12-02)
------------------
Expand Down
2 changes: 1 addition & 1 deletion src/z3c/form/browser/README.txt
Expand Up @@ -246,7 +246,7 @@ We can also have a single checkbox button for the boolean.
>>> widget.update()

>>> print(widget.render())
<span class="option">
<span class="option" id="foo">
<input type="checkbox" id="foo-0" name="bar:list"
class="single-checkbox-widget required bool-field"
value="selected" checked="checked" />
Expand Down
6 changes: 3 additions & 3 deletions src/z3c/form/browser/checkbox.txt
Expand Up @@ -186,7 +186,7 @@ For there to be a sensible output, we need to give the widget a label:

>>> widget.update()
>>> print(widget.render())
<span class="option">
<span class="option" id="widget-id">
<input type="checkbox" id="widget-id-0"
name="widget.name:list"
class="single-checkbox-widget" value="selected" />
Expand All @@ -206,7 +206,7 @@ will make the box checked:

>>> widget.update()
>>> print(widget.render())
<span class="option">
<span class="option" id="widget-id">
<input type="checkbox" id="widget-id-0"
name="widget.name:list"
class="single-checkbox-widget" value="selected"
Expand All @@ -228,7 +228,7 @@ field
>>> widget.field = Bool(title=u"Do you REALLY want that?")
>>> widget.update()
>>> print(widget.render())
<span class="option">
<span class="option" id="widget-id">
<input type="checkbox" id="widget-id-0"
name="widget.name:list"
class="single-checkbox-widget" value="selected" />
Expand Down
6 changes: 4 additions & 2 deletions src/z3c/form/browser/checkbox_input.pt
@@ -1,8 +1,10 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:tal="http://xml.zope.org/namespaces/tal"
tal:omit-tag="">
tal:omit-tag=""
tal:define="items view/items">
<span class="option"
tal:repeat="item view/items">
tal:repeat="item items"
tal:attributes="id python:len(items) == 1 and view.id or None">
<input type="checkbox" id="" name="" class="" alt="" title=""
tabindex="" disabled="" readonly="" accesskey="" value=""
checked="checked"
Expand Down

0 comments on commit 033e027

Please sign in to comment.