aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 4091bf4b0..578d077b2 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -195,18 +195,24 @@ sub admin {
my @children = map { $_->id } $body->bodies->all;
my @all = (@children, $body->id);
+ my $order = $c->req->params->{o} || 'created';
+ my $dir = $c->req->params->{d} || 1;
+ $c->stash->{order} = $order;
+ $c->stash->{dir} = $dir;
+ $order .= ' desc' if $dir;
+
# XXX No multiples or missing bodies
$c->stash->{unconfirmed} = $c->cobrand->problems->search({
state => [ 'unconfirmed', 'confirmed' ],
bodies_str => $c->stash->{body}->id,
}, {
- order_by => 'created'
+ order_by => $order,
});
$c->stash->{approval} = $c->cobrand->problems->search({
state => 'planned',
bodies_str => $c->stash->{body}->id,
}, {
- order_by => 'created'
+ order_by => $order,
});
my $page = $c->req->params->{p} || 1;