Added pagination to organisation listings
This commit is contained in:
parent
ed8607fd35
commit
dcd5896cea
2 changed files with 14 additions and 2 deletions
|
@ -6,7 +6,14 @@ use Try::Tiny;
|
|||
sub list {
|
||||
my $c = shift;
|
||||
|
||||
my $orgs_rs = $c->schema->resultset('Organisation');
|
||||
my $orgs_rs = $c->schema->resultset('Organisation')->search(
|
||||
undef,
|
||||
{
|
||||
page => $c->param('page') || 1,
|
||||
rows => 10,
|
||||
order_by => { -asc => 'name' },
|
||||
},
|
||||
);
|
||||
|
||||
$c->stash(
|
||||
orgs_rs => $orgs_rs,
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<strong>Success!</strong> <%= $success %>
|
||||
</div>
|
||||
% }
|
||||
<div class="row">
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<h3 class="card-header">
|
||||
|
@ -35,3 +35,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
%= bootstrap_pagination( $c->param('page') || 1, $orgs_rs->pager->last_page, { class => 'justify-content-center' } );
|
||||
</div>
|
||||
</div>
|
||||
|
|
Reference in a new issue