completely new way of handling action prototypes for actions in CRUD that is much...
[catagits/Reaction.git] / lib / ComponentUI / Controller / TestModel / Foo.pm
CommitLineData
7adfd53f 1package ComponentUI::Controller::TestModel::Foo;
2
89b70ba7 3use base 'Reaction::UI::Controller::Collection::CRUD';
7adfd53f 4use 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 28for 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 47sub _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 541;