my %values = map { $_ => {$oper, $params{$_} } }
grep { $params{$_} and $fields{$_} } keys %params;
+ $self = $self->do_pager($r);
$r->objects([ %values ? $self->search_where(%values) : $self->retrieve_all ]);
$r->template("list");
$r->{template_args}{search} = 1;
}
+sub do_pager {
+ my ($self, $r) = @_;
+ if ( my $rows = $r->config->{rows_per_page}) {
+ return $r->{template_args}{pager} = $self->pager($rows, $r->query->{page});
+ } else { return $self }
+}
+
sub list :Exported {
my ($self, $r) = @_;
my %ok_columns = map {$_ => 1} $self->columns;
- if ( my $rows = $r->config->{rows_per_page}) {
- $self = $self->pager($rows, $r->query->{page});
- $r->{template_args}{pager} = $self;
- }
+ $self = $self->do_pager($r);
my $order;
if ($order = $r->query->{order} and $ok_columns{$order}) {
$r->objects([ $self->retrieve_all_sorted_by( $order.