more Widget updates. this breaks old-style templates, also changed how VPs behave...
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Field / Boolean.pm
1 package Reaction::UI::Widget::Field::Boolean;
2
3 use Reaction::UI::WidgetClass;
4
5 class Boolean is 'Reaction::UI::Widget::Field', which {
6
7 };
8
9 1;
10
11 =for layout widget
12
13 [% label %] [% field %] [% message %] <br>
14
15 =for layout field
16
17 [%
18    IF content;
19     checked = 'checked="checked"';
20    ELSE;
21     checked = "";
22    END;
23 %]
24
25 <!-- We need a replacement for process_attrs -->
26 <input type="checkbox" id="[% id | html %]" name="[% name | html %]" value="1" [% checked %] />
27
28 =for layout label
29
30 <!-- This conditional goes away when mst comes up with something better -->
31 [% IF content %]
32   <label for="[% id %]"> [% content | html %]: </label>
33 [% END %]
34
35 =for layout message
36
37 <!-- This conditional goes away when mst comes up with something better -->
38 [% IF content %]
39   <span> [% content | html %] </span>
40 [% END %]
41
42 =cut