From fb792c07ba49c15c1c9c4b9ae6372a7e33dba0ba Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 24 Jun 2016 18:05:00 +0100 Subject: Improve admin report edit page. Show map, break into two columns, fix display of sent time after clicking "Mark as sent", tidy up labels. --- perllib/FixMyStreet/App/Controller/Admin.pm | 31 +++++++++++++---------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'perllib/FixMyStreet/App/Controller/Admin.pm') diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 28c543810..b7f051c11 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -652,23 +652,21 @@ sub report_edit : Path('report_edit') : Args(1) { $c->forward('/auth/get_csrf_token'); - if ( $c->cobrand->moniker eq 'zurich' ) { - $c->stash->{page} = 'admin'; - FixMyStreet::Map::display_map( - $c, + $c->stash->{page} = 'admin'; + FixMyStreet::Map::display_map( + $c, + latitude => $problem->latitude, + longitude => $problem->longitude, + pins => $problem->used_map + ? [ { latitude => $problem->latitude, longitude => $problem->longitude, - pins => $problem->used_map - ? [ { - latitude => $problem->latitude, - longitude => $problem->longitude, - colour => $c->cobrand->pin_colour($problem), - type => 'big', - } ] - : [], - print_report => 1, - ); - } + colour => $c->cobrand->pin_colour($problem, 'admin'), + type => 'big', + } ] + : [], + print_report => 1, + ); if (my $rotate_photo_param = $self->_get_rotate_photo_param($c)) { $self->rotate_photo($c, $problem, @$rotate_photo_param); @@ -707,8 +705,7 @@ sub report_edit : Path('report_edit') : Args(1) { } elsif ( $c->get_param('mark_sent') ) { $c->forward('/auth/check_csrf_token'); - $problem->whensent(\'current_timestamp'); - $problem->update(); + $problem->update({ whensent => \'current_timestamp' })->discard_changes; $c->stash->{status_message} = '

' . _('That problem has been marked as sent.') . '

'; $c->forward( 'log_edit', [ $id, 'problem', 'marked sent' ] ); } -- cgit v1.2.3