aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm18
-rw-r--r--templates/web/zurich/admin/index-dm.html1
2 files changed, 18 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 3af086a24..366a1ff68 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -199,15 +199,25 @@ sub admin {
$c->stash->{unconfirmed} = $c->cobrand->problems->search({
state => [ 'unconfirmed', 'confirmed' ],
bodies_str => $c->stash->{body}->id,
+ }, {
+ order_by => 'created'
});
$c->stash->{approval} = $c->cobrand->problems->search({
state => 'planned',
bodies_str => $c->stash->{body}->id,
+ }, {
+ order_by => 'created'
});
+
+ my $page = $c->req->params->{p} || 1;
$c->stash->{other} = $c->cobrand->problems->search({
state => { -not_in => [ 'unconfirmed', 'confirmed', 'planned' ] },
bodies_str => \@all,
- });
+ }, {
+ order_by => 'created desc'
+ })->page( $page );
+ $c->stash->{pager} = $c->stash->{other}->pager;
+
} elsif ($type eq 'sdm') {
$c->stash->{template} = 'admin/index-sdm.html';
@@ -217,14 +227,20 @@ sub admin {
$c->stash->{reports_new} = $c->cobrand->problems->search( {
state => 'in progress',
bodies_str => $body->id,
+ }, {
+ order_by => 'created'
} );
$c->stash->{reports_unpublished} = $c->cobrand->problems->search( {
state => 'planned',
bodies_str => $body->parent->id,
+ }, {
+ order_by => 'created desc'
} );
$c->stash->{reports_published} = $c->cobrand->problems->search( {
state => 'fixed - council',
bodies_str => $body->parent->id,
+ }, {
+ order_by => 'created desc'
} );
}
}
diff --git a/templates/web/zurich/admin/index-dm.html b/templates/web/zurich/admin/index-dm.html
index a88100ee4..08634b5dd 100644
--- a/templates/web/zurich/admin/index-dm.html
+++ b/templates/web/zurich/admin/index-dm.html
@@ -11,6 +11,7 @@
<h2>[% loc('All reports') %]</h2>
[% INCLUDE list, problems = other.all, include_subdiv = 1 %]
+[% INCLUDE 'pagination.html', admin = 1, param = 'p' %]
[% INCLUDE 'admin/footer.html' %]