diff --git a/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm b/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm index 31f92b2..78d8460 100644 --- a/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm +++ b/lib/Pear/LocalLoop/Controller/Admin/Organisations.pm @@ -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, diff --git a/templates/admin/organisations/list.html.ep b/templates/admin/organisations/list.html.ep index de43a90..ac9b90e 100644 --- a/templates/admin/organisations/list.html.ep +++ b/templates/admin/organisations/list.html.ep @@ -11,7 +11,7 @@ Success! <%= $success %> % } -
+

@@ -35,3 +35,8 @@

+
+
+ %= bootstrap_pagination( $c->param('page') || 1, $orgs_rs->pager->last_page, { class => 'justify-content-center' } ); +
+