From 474bc7c3b0c87c7eebc2171f3bd1bd18370da4cd Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 24 May 2019 12:42:28 +0100 Subject: Consistent status message block. --- perllib/FixMyStreet/App/Controller/Admin.pm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 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 6167a16f5..d0d84ff70 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -484,15 +484,14 @@ sub report_edit : Path('report_edit') : Args(1) { $problem->resend; $problem->update(); - $c->stash->{status_message} = - '

' . _('That problem will now be resent.') . '

'; + $c->stash->{status_message} = _('That problem will now be resent.'); $c->forward( 'log_edit', [ $id, 'problem', 'resend' ] ); } elsif ( $c->get_param('mark_sent') ) { $c->forward('/auth/check_csrf_token'); $problem->update({ whensent => \'current_timestamp' })->discard_changes; - $c->stash->{status_message} = '

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

'; + $c->stash->{status_message} = _('That problem has been marked as sent.'); $c->forward( 'log_edit', [ $id, 'problem', 'marked sent' ] ); } elsif ( $c->get_param('flaguser') ) { @@ -571,8 +570,7 @@ sub report_edit : Path('report_edit') : Args(1) { } $c->forward( 'log_edit', [ $id, 'problem', 'edit' ] ); - $c->stash->{status_message} = - '

' . _('Updated!') . '

'; + $c->stash->{status_message} = _('Updated!'); # do this here otherwise lastupdate and confirmed times # do not display correctly @@ -921,13 +919,12 @@ sub update_edit : Path('update_edit') : Args(1) { $self->remove_photo($c, $update, $remove_photo_param); } - $c->stash->{status_message} = '

' . _('Updated!') . '

'; + $c->stash->{status_message} = _('Updated!'); # Must call update->hide while it's not hidden (so is_latest works) if ($new_state eq 'hidden') { my $outcome = $update->hide; - $c->stash->{status_message} .= - '

' . _('Problem marked as open.') . '

' + $c->stash->{status_message} .= _('Problem marked as open.') if $outcome->{reopened}; } -- cgit v1.2.3 From f763cb953402bb71254e5f5db44293e64704d528 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 17 May 2019 20:45:33 +0100 Subject: Fix uses of != instead of not_in. --- perllib/FixMyStreet/App/Controller/Admin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 d0d84ff70..5f18f8557 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -831,7 +831,7 @@ sub template_edit : Path('templates') : Args(2) { $template->update_or_insert; $template->contact_response_templates->search({ - contact_id => { '!=' => \@new_contact_ids }, + contact_id => { -not_in => \@new_contact_ids }, })->delete; foreach my $contact_id (@new_contact_ids) { $template->contact_response_templates->find_or_create({ -- cgit v1.2.3