aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/Widget/ListView.pm
blob: 95629008737b3900269beac7d5388fc2fadb5c23 (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
31
32
33
34
35
36
package Reaction::UI::Widget::ListView;

use Reaction::UI::WidgetClass;

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

  implements fragment actions {
    render action => over $_{viewport}->actions;
  };

  implements fragment action {
    render 'viewport';
  };

  around fragment header_cell {
    arg order_uri => event_uri {
      order_by => $_,
      order_by_desc => ((($_{viewport}->order_by||'') ne $_
                        || $_{viewport}->order_by_desc) ? 0 : 1)
    };
    call_next;
  };

  after fragment header_cells {
    if ($_{viewport}->object_action_count) {
      render 'header_action_cell';
    }
  };

  implements fragment header_action_cell {
    arg 'col_count' => $_{viewport}->object_action_count;
  };

};

1;