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