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 => { |
13 | excluded_fields => [qw/id/], |
37728bba |
14 | action_order => [qw/delete_all create/], |
15 | Member => { |
16 | action_order => [qw/view update delete/], |
17 | }, |
599c1172 |
18 | }, |
19 | }, |
20 | view => { |
21 | ViewPort => { |
22 | excluded_fields => [qw/id/], |
23 | }, |
24 | }, |
25 | }, |
7adfd53f |
26 | ); |
27 | |
599c1172 |
28 | for my $action (qw/view create update/){ |
29 | __PACKAGE__->config( |
30 | action => { |
31 | $action => { |
32 | ViewPort => { |
33 | container_layouts => [ |
34 | { name => 'primary', fields => [qw/first_name last_name/]}, |
35 | { |
36 | name => 'secondary', |
37 | label => 'Optional Label', |
38 | fields => [qw/bars bazes/], |
39 | }, |
40 | ], |
41 | }, |
42 | }, |
43 | } |
44 | ); |
45 | } |
46 | |
37728bba |
47 | sub _build_action_viewport_args { |
48 | my $self = shift; |
49 | my $args = $self->next::method(@_); |
50 | $args->{list}{action_prototypes}{delete_all}{label} = 'Delete All Records'; |
51 | return $args; |
52 | } |
53 | |
7adfd53f |
54 | 1; |