Commit | Line | Data |
9de685fc |
1 | package Reaction::UI::Widget::ActionForm; |
2 | |
3 | use Reaction::UI::WidgetClass; |
4 | |
5 | class 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 | |
45 | 1; |
46 | |
47 | __END__; |
48 | |
5a1a893e |
49 | =head1 NAME |
9de685fc |
50 | |
5a1a893e |
51 | Reaction::UI::Widget::ActionForm |
9de685fc |
52 | |
5a1a893e |
53 | =head1 DESCRIPTION |
9de685fc |
54 | |
5a1a893e |
55 | =head1 FRAGMENTS |
9de685fc |
56 | |
5a1a893e |
57 | =head2 widget |
9de685fc |
58 | |
5a1a893e |
59 | Additional variables available in topic hash: "viewport". |
9de685fc |
60 | |
6bc27bd3 |
61 | Renders "header", "field_list", "buttons" and "footer" |
9de685fc |
62 | |
6bc27bd3 |
63 | =head2 field_list |
9de685fc |
64 | |
5a1a893e |
65 | Sequentially renders the C<ordered_fields> of the viewport |
9de685fc |
66 | |
5a1a893e |
67 | =head2 buttons |
9de685fc |
68 | |
5a1a893e |
69 | Additional variables available in topic hash: "message" |
9de685fc |
70 | |
5a1a893e |
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. |
9de685fc |
86 | |
87 | =cut |
5a1a893e |
88 | |