aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-02-12 10:52:37 +0000
committerMatthew Somerville <matthew@mysociety.org>2020-02-13 14:31:10 +0000
commit3e00fa1c74c92bf902b1d41d524ad79a1554e835 (patch)
tree5123dd236962d1e29a6679fac1ff1a823ee4839c
parentcf4f4473a795d2e1dd213f31b3d3fb4ab2711b72 (diff)
Reword/hide things viewing unauthed private report
If you've e.g. come from an email link that lets you view a private report, hide reporting/getting updates/sharing, and replace the update form with a link saying you need to sign in.
-rw-r--r--t/app/controller/report_non_public.t2
-rw-r--r--templates/web/base/report/display_tools.html2
-rw-r--r--templates/web/base/report/update-form-wrapper.html9
3 files changed, 13 insertions, 0 deletions
diff --git a/t/app/controller/report_non_public.t b/t/app/controller/report_non_public.t
index 6d52647a8..d1aa1943c 100644
--- a/t/app/controller/report_non_public.t
+++ b/t/app/controller/report_non_public.t
@@ -80,6 +80,8 @@ subtest "Logged email working on private report" => sub {
my $url = $mech->get_link_from_email($email);
like $body, qr/Your report to Oxfordshire County Council has been logged/;
$mech->get_ok($url);
+ $mech->content_lacks('Get updates');
+ $mech->content_contains('To provide an update, please');
};
done_testing();
diff --git a/templates/web/base/report/display_tools.html b/templates/web/base/report/display_tools.html
index b65320394..e16ffcb2c 100644
--- a/templates/web/base/report/display_tools.html
+++ b/templates/web/base/report/display_tools.html
@@ -1,5 +1,6 @@
<div class="shadow-wrap">
<ul id="key-tools">
+ [% IF c.user_exists OR NOT problem.non_public %]
[% IF c.user_exists AND c.cobrand.users_can_hide AND c.user.belongs_to_body( problem.bodies_str ) %]
<li><form method="post" action="/report/[% problem.id %]/delete" id="remove-from-site-form">
<input type="hidden" name="token" value="[% csrf_token %]">
@@ -16,6 +17,7 @@
[% IF c.cobrand.moniker == 'fixmystreet' %]
<li><a rel="nofollow" id="key-tool-report-share" class="share" href="#report-share">[% loc('Share') %]</a></li>
[% END %]
+ [% END %]
[% IF c.cobrand.moniker == 'zurich' %]
<li><a class="chevron" id="key-tool-problems-nearby" href="[% c.uri_for( '/around', { lat => latitude, lon => longitude } ) %]">[% loc( 'Problems on the map' ) %]</a></li>
[% ELSE %]
diff --git a/templates/web/base/report/update-form-wrapper.html b/templates/web/base/report/update-form-wrapper.html
index 5347df3c3..a46207a3c 100644
--- a/templates/web/base/report/update-form-wrapper.html
+++ b/templates/web/base/report/update-form-wrapper.html
@@ -1,4 +1,10 @@
[% UNLESS c.cobrand.updates_disallowed(problem) %]
+
+ [% IF NOT c.user_exists AND problem.non_public # Came via other-reported token or similar %]
+ <p>[% tprintf(loc('To provide an update, please <a href="%s">sign in</a>.'), '/auth?r=report/' _ problem.id) %]</p>
+
+ [% ELSE %]
+
[% IF two_column_sidebar %]
<button type="button" class="btn btn--provide-update js-provide-update hidden-nojs">[% loc('Provide an update') %]</button>
<div class="hidden-js">
@@ -7,6 +13,9 @@
[% IF two_column_sidebar %]
</div>
[% END %]
+
+ [% END %]
+
[% ELSE %]
[% TRY %][% INCLUDE 'report/_updates_disallowed_message.html' %][% CATCH file %][% END %]
[% END %]