aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/ViewPort/ListView.pm
blob: 3d21ad6c6ef67fb0df03de349f295d6373a1df6e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package Reaction::UI::ViewPort::ListView;

use Reaction::Class;
use aliased 'Reaction::UI::ViewPort::GridView::Entity::WithActions';

class ListView is 'Reaction::UI::ViewPort::GridView', which {

  does 'Reaction::UI::ViewPort::GridView::Role::Order';
  does 'Reaction::UI::ViewPort::GridView::Role::Pager';
  does 'Reaction::UI::ViewPort::GridView::Role::Actions';


  #If I decide that object actions and collection actions should be
  #lumped together i oculd move these into the collection action role
  #ooor we could create a third role that does this, but gah, no?
  implements build_entity_class => as { WithActions };

  #You'se has to goes aways. sorry.
  #if i saved the args as an attribute i could probably get around this....
  implements object_action_count => as {
    my $self = shift;
    for ( @{ $self->entities } ) {
      #pickup here, and of to the widget for listview
      return scalar @{ $_->action_prototypes };
    }
  };

};

1;