Commit | Line | Data |
7adfd53f |
1 | package ComponentUI::Controller::TestModel::Foo; |
2 | |
89b70ba7 |
3 | use base 'Reaction::UI::Controller::Collection::CRUD'; |
7adfd53f |
4 | use Reaction::Class; |
5 | |
6 | __PACKAGE__->config( |
a4f82080 |
7 | model_name => 'TestModel', |
8 | collection_name => 'Foo', |
599c1172 |
9 | action => { |
10 | base => { Chained => '/base', PathPart => 'testmodel/foo' }, |
11 | list => { |
12 | ViewPort => { |
336b3bb0 |
13 | action_prototypes => { delete_all => 'Delete all records' }, |
599c1172 |
14 | excluded_fields => [qw/id/], |
37728bba |
15 | action_order => [qw/delete_all create/], |
16 | Member => { |
17 | action_order => [qw/view update delete/], |
18 | }, |
599c1172 |
19 | }, |
20 | }, |
21 | view => { |
22 | ViewPort => { |
23 | excluded_fields => [qw/id/], |
24 | }, |
25 | }, |
26 | }, |
7adfd53f |
27 | ); |
28 | |
599c1172 |
29 | for my $action (qw/view create update/){ |
30 | __PACKAGE__->config( |
31 | action => { |
32 | $action => { |
33 | ViewPort => { |
34 | container_layouts => [ |
35 | { name => 'primary', fields => [qw/first_name last_name/]}, |
36 | { |
37 | name => 'secondary', |
38 | label => 'Optional Label', |
39 | fields => [qw/bars bazes/], |
40 | }, |
41 | ], |
42 | }, |
43 | }, |
44 | } |
45 | ); |
46 | } |
47 | |
37728bba |
48 | sub _build_action_viewport_args { |
49 | my $self = shift; |
50 | my $args = $self->next::method(@_); |
51 | $args->{list}{action_prototypes}{delete_all}{label} = 'Delete All Records'; |
52 | return $args; |
53 | } |
54 | |
7adfd53f |
55 | 1; |