aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm21
-rw-r--r--templates/web/zurich/admin/index-sdm.html2
2 files changed, 11 insertions, 12 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 6ef0f4f77..455e2bbbb 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -92,19 +92,18 @@ sub admin {
my $body = $c->stash->{body};
# XXX No multiples or missing bodies
- my $p = $c->cobrand->problems->search({
- 'me.state' => [ 'in progress', 'fixed - council' ],
+ $c->stash->{reports_new} = $c->cobrand->problems->search( {
+ state => 'in progress',
bodies_str => $body->id,
} );
- $c->stash->{reports_new} = $p->search({
- 'comments.state' => undef
- }, { join => 'comments', distinct => 1 } );
- $c->stash->{reports_unpublished} = $p->search({
- 'comments.state' => 'unconfirmed'
- }, { join => 'comments', distinct => 1 } );
- $c->stash->{reports_published} = $p->search({
- 'comments.state' => 'confirmed'
- }, { join => 'comments', distinct => 1 } );
+ $c->stash->{reports_unpublished} = $c->cobrand->problems->search( {
+ state => 'planned',
+ bodies_str => $body->parent->id,
+ } );
+ $c->stash->{reports_published} = $c->cobrand->problems->search( {
+ state => 'fixed - council',
+ bodies_str => $body->parent->id,
+ } );
}
}
diff --git a/templates/web/zurich/admin/index-sdm.html b/templates/web/zurich/admin/index-sdm.html
index 7f5d81970..1ecc0bbcb 100644
--- a/templates/web/zurich/admin/index-sdm.html
+++ b/templates/web/zurich/admin/index-sdm.html
@@ -8,7 +8,7 @@
[% INCLUDE list, problems = reports_unpublished.all, no_edit = 1 %]
<h2>Reports published</h2>
-[% INCLUDE list, problems = reports_published.all %]
+[% INCLUDE list, problems = reports_published.all, no_edit = 1 %]
[% INCLUDE 'admin/footer.html' %]