Added pagination to organisation listings

This commit is contained in:
Tom Bloor 2017-10-24 13:31:04 +01:00
parent ed8607fd35
commit dcd5896cea
2 changed files with 14 additions and 2 deletions

View file

@ -6,7 +6,14 @@ use Try::Tiny;
sub list { sub list {
my $c = shift; 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( $c->stash(
orgs_rs => $orgs_rs, orgs_rs => $orgs_rs,

View file

@ -11,7 +11,7 @@
<strong>Success!</strong> <%= $success %> <strong>Success!</strong> <%= $success %>
</div> </div>
% } % }
<div class="row"> <div class="row mb-3">
<div class="col"> <div class="col">
<div class="card"> <div class="card">
<h3 class="card-header"> <h3 class="card-header">
@ -35,3 +35,8 @@
</div> </div>
</div> </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>