merge fixups
[catagits/Reaction.git] / lib / Reaction / UI / Widget / ActionForm.pm
1 package Reaction::UI::Widget::ActionForm;
2
3 use Reaction::UI::WidgetClass;
4
5 class ActionForm, which {
6
7   #implements fragment widget {
8   #  arg form_id => $_{viewport}->location;
9   #};
10
11   implements fragment field_list {
12     render field => over $_{viewport}->ordered_fields;
13   };
14
15   implements fragment field {
16     render 'viewport';
17   };
18
19   implements fragment ok_button_fragment {
20     if (grep { $_ eq 'ok' } $_{viewport}->accept_events) {
21       arg 'event_id' => event_id 'ok';
22       arg 'label' => $_{viewport}->ok_label;
23       render 'ok_button';
24     }
25   };
26
27   implements fragment apply_button_fragment {
28     if (grep { $_ eq 'apply' } $_{viewport}->accept_events) {
29       arg 'event_id' => event_id 'apply';
30       arg 'label' => $_{viewport}->apply_label;
31       render 'apply_button';
32     }
33   };
34
35   implements fragment cancel_button_fragment {
36     if (grep { $_ eq 'cancel' } $_{viewport}->accept_events) {
37       arg 'event_id' => event_id 'cancel';
38       arg 'label' => $_{viewport}->cancel_label;
39       render 'cancel_button';
40     }
41   };
42
43 };
44
45 1;
46
47 __END__;
48
49 =head1 NAME
50
51 Reaction::UI::Widget::ActionForm
52
53 =head1 DESCRIPTION
54
55 =head1 FRAGMENTS
56
57 =head2 widget
58
59 Additional variables available in topic hash: "viewport".
60
61 Renders "header", "field_list", "buttons" and "footer"
62
63 =head2 field_list
64
65 Sequentially renders the C<ordered_fields> of the viewport
66
67 =head2 buttons
68
69 Additional variables available in topic hash: "message"
70
71 =head2 header
72
73 Content is a dummy value
74
75 =head2 footer
76
77 Content is a dummy value
78
79 =head1 AUTHORS
80
81 See L<Reaction::Class> for authors.
82
83 =head1 LICENSE
84
85 See L<Reaction::Class> for the license.
86
87 =cut
88