aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--t/app/controller/admin/bodies.t27
-rw-r--r--t/cobrand/isleofwight.t13
-rw-r--r--templates/web/base/admin/bodies/contact-form.html1
-rw-r--r--templates/web/fixmystreet-uk-councils/admin/bodies/_updates_disallowed_hint.html9
-rw-r--r--templates/web/fixmystreet.com/report/_updates_disallowed_message.html2
-rw-r--r--templates/web/highwaysengland/report/new/inline-tips.html8
6 files changed, 57 insertions, 3 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/t/cobrand/isleofwight.t b/t/cobrand/isleofwight.t
index 3cac710da..303cdbc07 100644
--- a/t/cobrand/isleofwight.t
+++ b/t/cobrand/isleofwight.t
@@ -116,13 +116,24 @@ subtest "only original reporter can comment" => sub {
};
};
+subtest "only original reporter can comment" => sub {
+ FixMyStreet::override_config {
+ MAPIT_URL => 'http://mapit.uk/',
+ ALLOWED_COBRANDS => 'fixmystreet',
+ COBRAND_FEATURES => { updates_allowed => { fixmystreet => { 'Isle of Wight' => 'reporter' } } },
+ }, sub {
+ $mech->log_out_ok;
+ $mech->get_ok('/report/' . $reports[0]->id);
+ $mech->content_contains('Only the original reporter may leave updates');
+ };
+};
+
subtest "check moderation label uses correct name" => sub {
my $REPORT_URL = '/report/' . $reports[0]->id;
FixMyStreet::override_config {
MAPIT_URL => 'http://mapit.uk/',
ALLOWED_COBRANDS => ['isleofwight'],
}, sub {
- $mech->log_out_ok;
$mech->log_in_ok( $iow_user->email );
$mech->get_ok($REPORT_URL);
$mech->content_lacks('show-moderation');
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>
diff --git a/templates/web/fixmystreet.com/report/_updates_disallowed_message.html b/templates/web/fixmystreet.com/report/_updates_disallowed_message.html
index d2d9cf83b..d7b3d383a 100644
--- a/templates/web/fixmystreet.com/report/_updates_disallowed_message.html
+++ b/templates/web/fixmystreet.com/report/_updates_disallowed_message.html
@@ -1,4 +1,4 @@
-[% cfg = c.cobrand.updates_disallowed_config(problem).0 ~%]
+[% cfg = c.cobrand.per_body_config('updates_allowed', problem).0 ~%]
[% IF cfg.match('reporter') AND (NOT cfg.match('open') OR problem.is_open) %]
<p>
Only the original reporter may leave updates.
diff --git a/templates/web/highwaysengland/report/new/inline-tips.html b/templates/web/highwaysengland/report/new/inline-tips.html
index ff0ef42f8..730b482e5 100644
--- a/templates/web/highwaysengland/report/new/inline-tips.html
+++ b/templates/web/highwaysengland/report/new/inline-tips.html
@@ -1,3 +1,9 @@
+<div class="description_tips" >
+ <p>
+ Content of reports shall be monitored and any language that could be deemed to cause offense or be inappropriate shall be removed.
+ </p>
+</div>
+
<label for="where_hear">How did you hear about us?</label>
[%~ SET where_hear = report.get_extra_metadata('where_hear') %]
@@ -8,6 +14,6 @@
<option value="Highways England website"[% ' selected' IF 'Highways England website' == where_hear %]>Highways England website</option>
<option value="Twitter"[% ' selected' IF 'Twitter' == where_hear %]>Twitter</option>
<option value="Word of mouth"[% ' selected' IF 'Word of mouth' == where_hear %]>Word of mouth</option>
-<option value="Through the post"[% ' selected' IF 'Through the post' == where_hear %]>Through the post</option>
+<option value="Highways England correspondence"[% ' selected' IF 'Highways England correspondence' == where_hear %]>Highways England correspondence</option>
<option value="Other"[% ' selected' IF 'Other' == where_hear %]>Other</option>
</select>