diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 2 | ||||
-rw-r--r-- | t/app/controller/admin/search.t | 2 | ||||
-rw-r--r-- | templates/web/base/admin/list_updates.html | 31 |
4 files changed, 20 insertions, 16 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index cd2f4a038..600cc7348 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Add Mark/View private reports permission #2306 - Store more original stuff on moderation. - Sort user updates in reverse date order. + - Improve update display on admin report edit page. - Open311 improvements: - Fix bug in contact group handling. #2323 - Improve validation of fetched reports timestamps. #2327 diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 60dea4c1b..75f83c6b6 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -889,7 +889,7 @@ sub report_edit : Path('report_edit') : Args(1) { $c->stash->{updates} = [ $c->model('DB::Comment') - ->search( { problem_id => $problem->id }, { order_by => 'created' } ) + ->search( { problem_id => $problem->id }, { order_by => [ 'created', 'id' ] } ) ->all ]; if (my $rotate_photo_param = $self->_get_rotate_photo_param($c)) { diff --git a/t/app/controller/admin/search.t b/t/app/controller/admin/search.t index 497ac9fd6..f8e70cb7a 100644 --- a/t/app/controller/admin/search.t +++ b/t/app/controller/admin/search.t @@ -103,7 +103,7 @@ subtest 'report search' => sub { $update->update; $mech->get_ok('/admin/reports?search=' . $report->user->email); - $mech->content_like( qr{<tr [^>]*hidden[^>]*> \s* <td> \s* $u_id \s* </td>}xs ); + $mech->content_like( qr{<tr [^>]*hidden[^>]*> \s* <td[^>]*> \s* $u_id \s* </td>}xs ); $report->state('hidden'); $report->update; diff --git a/templates/web/base/admin/list_updates.html b/templates/web/base/admin/list_updates.html index a28c4ff81..b23cd7ca3 100644 --- a/templates/web/base/admin/list_updates.html +++ b/templates/web/base/admin/list_updates.html @@ -9,24 +9,25 @@ <th>[% loc('Council') %]</th> <th>[% loc('Cobrand') %]</th> <th>[% loc('State') %]</th> - <th>[% loc('Text') %]</th> <th>*</th> </tr> [% FOREACH update IN updates -%] <tr[% ' class="adminhidden"' IF update.state == 'hidden' || update.problem.state == 'hidden' %]> - <td>[%- IF update.state == 'confirmed' && update.problem.state != 'hidden' -%] - [%- cobrand_data = update.cobrand_data; - cobrand_data = c.data_for_generic_update IF !update.cobrand; - IF cobrand_data; + <td rowspan=2> + [%~ IF update.state == 'confirmed' && update.problem.state != 'hidden' -%] + [%- cobrand_data = update.cobrand_data; + cobrand_data = c.data_for_generic_update IF !update.cobrand; + IF cobrand_data; uri = c.uri_for_email( '/report', update.problem.id, cobrand_data ); - ELSE; + ELSE; uri = c.uri_for_email( '/report', update.problem.id ); - END; - %] - <a href="[% uri %]#update_[% update.id %]" class="admin-offsite-link">[% update.id %]</a> - [%- ELSE %] - [%- update.id %] - [%- END -%]</td> + END; + %] + <a href="[% uri %]#update_[% update.id %]" class="admin-offsite-link">[% update.id %]</a> + [%- ELSE %] + [%- update.id %] + [%- END ~%] + </td> <td>[% PROCESS value_or_nbsp value=update.name %] <br>[% PROCESS value_or_nbsp value=update.user.email %] <br>[% loc('Anonymous') %]: [% IF update.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %] @@ -38,13 +39,15 @@ [% loc('Created:') %] [% PROCESS format_time time=update.created %] <br>[% loc('Confirmed:') %] [% PROCESS format_time time=update.confirmed %] </small></td> - <td>[% update.text | html %]</td> - <td> + <td rowspan=2> [% IF c.user.has_permission_to('report_edit', update.problem.bodies_str_ids) %] <a href="[% c.uri_for( 'update_edit', update.id ) %]">[% loc('Edit') %]</a> [% END %] </td> </tr> + <tr> + <td colspan=5>[% update.text | html %]</td> + </tr> [% END -%] </table> |