From b2735e814c73fe76c8526563b7c5473281938833 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 18 Jun 2020 13:43:49 +0100 Subject: [Bromley] No updates on waste reports. --- perllib/FixMyStreet/Cobrand/Bromley.pm | 10 ++++++++++ t/app/controller/waste.t | 4 ++++ .../web/bromley/report/_updates_disallowed_message.html | 13 +++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 templates/web/bromley/report/_updates_disallowed_message.html diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm index 5fc03eb81..c9e85a484 100644 --- a/perllib/FixMyStreet/Cobrand/Bromley.pm +++ b/perllib/FixMyStreet/Cobrand/Bromley.pm @@ -406,6 +406,16 @@ sub munge_report_new_contacts { $self->SUPER::munge_report_new_contacts($categories); } +sub updates_disallowed { + my $self = shift; + my ($problem) = @_; + + # No updates on waste reports + return 'waste' if $problem->cobrand_data eq 'waste'; + + return $self->next::method(@_); +} + sub bin_addresses_for_postcode { my $self = shift; my $pc = shift; diff --git a/t/app/controller/waste.t b/t/app/controller/waste.t index 9c7b9a3ac..fe1b369d9 100644 --- a/t/app/controller/waste.t +++ b/t/app/controller/waste.t @@ -99,8 +99,12 @@ FixMyStreet::override_config { is $res->code, 403; $mech->log_in_ok($user->email); $mech->get_ok('/report/' . $report->id); + $mech->content_lacks('Provide an update'); + $report->update({ state => 'fixed - council' }); $mech->log_in_ok($staff_user->email); $mech->get_ok('/report/' . $report->id); + $mech->content_lacks('Provide an update'); + $mech->content_contains( 'See your bin collections' ); $mech->host('www.fixmystreet.com'); $res = $mech->get('/report/' . $report->id); diff --git a/templates/web/bromley/report/_updates_disallowed_message.html b/templates/web/bromley/report/_updates_disallowed_message.html new file mode 100644 index 000000000..436bc6354 --- /dev/null +++ b/templates/web/bromley/report/_updates_disallowed_message.html @@ -0,0 +1,13 @@ +[% IF c.cobrand.updates_disallowed(problem) == 'waste'; + SET uprn = problem.get_extra_field_value('uprn'); +%] +

+ See your bin collections. +

+[% ELSE %] +

[% loc('This report is now closed to updates.') %] + [% tprintf(loc('You can make a new report in the same location.'), + c.uri_for( '/report/new', { longitude = longitude, latitude = latitude } ) + ) %] +

+[% END %] -- cgit v1.2.3