port actionform, field widgets to declarative system
[catagits/Reaction.git] / lib / Reaction / UI / Widget / ActionForm.pm
CommitLineData
9de685fc 1package Reaction::UI::Widget::ActionForm;
2
3use Reaction::UI::WidgetClass;
4
5class ActionForm, which {
664d660c 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 };
9de685fc 42
43};
44
451;
46
47__END__;
48
5a1a893e 49=head1 NAME
9de685fc 50
5a1a893e 51Reaction::UI::Widget::ActionForm
9de685fc 52
5a1a893e 53=head1 DESCRIPTION
9de685fc 54
5a1a893e 55=head1 FRAGMENTS
9de685fc 56
5a1a893e 57=head2 widget
9de685fc 58
5a1a893e 59Additional variables available in topic hash: "viewport".
9de685fc 60
6bc27bd3 61Renders "header", "field_list", "buttons" and "footer"
9de685fc 62
6bc27bd3 63=head2 field_list
9de685fc 64
5a1a893e 65Sequentially renders the C<ordered_fields> of the viewport
9de685fc 66
5a1a893e 67=head2 buttons
9de685fc 68
5a1a893e 69Additional variables available in topic hash: "message"
9de685fc 70
5a1a893e 71=head2 header
72
73Content is a dummy value
74
75=head2 footer
76
77Content is a dummy value
78
79=head1 AUTHORS
80
81See L<Reaction::Class> for authors.
82
83=head1 LICENSE
84
85See L<Reaction::Class> for the license.
9de685fc 86
87=cut
5a1a893e 88