diff options
-rw-r--r-- | t/app/controller/admin/bodies.t | 27 | ||||
-rw-r--r-- | templates/web/base/admin/bodies/contact-form.html | 1 | ||||
-rw-r--r-- | templates/web/fixmystreet-uk-councils/admin/bodies/_updates_disallowed_hint.html | 9 |
3 files changed, 37 insertions, 0 deletions
diff --git a/t/app/controller/admin/bodies.t b/t/app/controller/admin/bodies.t index 80ee22630..75db6f87c 100644 --- a/t/app/controller/admin/bodies.t +++ b/t/app/controller/admin/bodies.t @@ -413,4 +413,31 @@ subtest 'check log of the above' => sub { $mech->content_contains('Edited body <a href="/admin/body/' . $body->id . '">Aberdeen City Council</a>'); }; +subtest 'check update disallowed message' => sub { + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.uk/', + ALLOWED_COBRANDS => 'bathnes', + COBRAND_FEATURES => { updates_allowed => { bathnes => 'open' } } + }, sub { + $mech->get_ok('/admin/body/' . $body->id .'/test%20category'); + $mech->content_contains('even if this is unticked, only open reports can have updates left on them.'); + }; + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.uk/', + ALLOWED_COBRANDS => 'bathnes', + COBRAND_FEATURES => { updates_allowed => { bathnes => 'staff' } } + }, sub { + $mech->get_ok('/admin/body/' . $body->id .'/test%20category'); + $mech->content_contains('even if this is unticked, only staff will be able to leave updates.'); + }; + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.uk/', + ALLOWED_COBRANDS => 'bathnes', + COBRAND_FEATURES => { updates_allowed => { bathnes => 'reporter' } } + }, sub { + $mech->get_ok('/admin/body/' . $body->id .'/test%20category'); + $mech->content_contains('even if this is unticked, only the problem reporter will be able to leave updates'); + }; +}; + done_testing(); diff --git a/templates/web/base/admin/bodies/contact-form.html b/templates/web/base/admin/bodies/contact-form.html index 21b69fdcd..e1fd2054a 100644 --- a/templates/web/base/admin/bodies/contact-form.html +++ b/templates/web/base/admin/bodies/contact-form.html @@ -66,6 +66,7 @@ <p class="form-check"> <input type="checkbox" name="updates_disallowed" value="1" id="updates_disallowed" [% ' checked' IF contact.get_extra_metadata('updates_disallowed') %]> <label for="updates_disallowed">[% loc('Disable updates on reports in this category') %]</label> + [% TRY %][% INCLUDE admin/bodies/_updates_disallowed_hint.html %][% CATCH file %][% END %] </p> <p class="form-check"> diff --git a/templates/web/fixmystreet-uk-councils/admin/bodies/_updates_disallowed_hint.html b/templates/web/fixmystreet-uk-councils/admin/bodies/_updates_disallowed_hint.html new file mode 100644 index 000000000..fc9ef4867 --- /dev/null +++ b/templates/web/fixmystreet-uk-councils/admin/bodies/_updates_disallowed_hint.html @@ -0,0 +1,9 @@ +[% cfg = c.cobrand.feature('updates_allowed') ~%] +<span class="form-hint"> + This site’s configuration means even if this is unticked, only + [%~ IF cfg == 'staff' %] staff will be able to leave updates. + [%~ ELSIF cfg == 'reporter' %] the problem reporter will be able to leave updates. + [%~ ELSIF cfg == 'reporter-open' %] the problem reporter will be able to leave updates on open reports. + [%~ ELSIF cfg == 'open' %] open reports can have updates left on them. + [%~ END %] +</span> |