refactpored most of the action stuff into roles. should fields be a role too?
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / ListView.pm
CommitLineData
7adfd53f 1package Reaction::UI::ViewPort::ListView;
2
3use Reaction::Class;
c8fbb8ad 4use aliased 'Reaction::UI::ViewPort::Collection::Grid::Member::WithActions';
7adfd53f 5
81393881 6use namespace::clean -except => [ qw(meta) ];
7extends 'Reaction::UI::ViewPort::Collection::Grid';
7adfd53f 8
81393881 9with 'Reaction::UI::ViewPort::Collection::Role::Order';
10with 'Reaction::UI::ViewPort::Collection::Role::Pager';
11with 'Reaction::UI::ViewPort::Role::Actions';
12
13#If I decide that object actions and collection actions should be
14#lumped together i oculd move these into the collection action role
15#ooor we could create a third role that does this, but gah, no?
16sub _build_member_class { WithActions };
17
18#You'se has to goes aways. sorry.
19#if i saved the args as an attribute i could probably get around this....
20sub object_action_count {
21 my $self = shift;
22 for ( @{ $self->members } ) {
23 #pickup here, and of to the widget for listview
24 return scalar @{ $_->action_prototypes };
25 }
7adfd53f 26};
27
81393881 28__PACKAGE__->meta->make_immutable;
29
30
7adfd53f 311;