aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-06-18 15:59:41 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-06-21 12:29:58 +0100
commit896a117c2225e102b7c64c04b88c82cba282586c (patch)
treee5b8163d24bc818423a1a54eac3341e574e594ea
parente1853898c154356bf0af7ef021f9b1c519e8340b (diff)
Show message on reports closed to updates.
-rw-r--r--CHANGELOG.md1
-rw-r--r--t/script/inactive.t3
-rw-r--r--templates/web/base/report/display.html20
3 files changed, 16 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a2b4de887..84653653b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@
- Front end improvements:
- Simplify footer CSS. #2107
- Keep commas in geocode lookups.
+ - Show message on reports closed to updates.
- Bugfixes:
- Don't remove automated fields when editing contacts #2163
- Remove small border to left of Fixed banner. #2156
diff --git a/t/script/inactive.t b/t/script/inactive.t
index 4d78b385f..4667c989b 100644
--- a/t/script/inactive.t
+++ b/t/script/inactive.t
@@ -55,7 +55,8 @@ subtest 'Closing updates on inactive fixed/closed reports' => sub {
$in->reports;
$problems[2]->discard_changes;
is $problems[2]->get_extra_metadata('closed_updates'), 1, 'Closed to updates';
- # TODO Visit page, check closed for updates
+ $mech->get_ok("/report/" . $problems[2]->id);
+ $mech->content_contains('now closed to updates');
};
subtest 'Anonymization of inactive users' => sub {
diff --git a/templates/web/base/report/display.html b/templates/web/base/report/display.html
index 8c461dced..ebe969994 100644
--- a/templates/web/base/report/display.html
+++ b/templates/web/base/report/display.html
@@ -53,17 +53,23 @@
[% TRY %][% INCLUDE 'report/sharing.html' %][% CATCH file %][% END %]
[% INCLUDE 'report/updates.html' %]
-[% IF two_column_sidebar AND NOT problem.extra.closed_updates %]
-<button class="btn btn--provide-update js-provide-update hidden-nojs">[% loc('Provide an update') %]</button>
-<div class="hidden-js">
-[% END %]
[% IF problem.duplicate_of %]
[% INCLUDE 'report/duplicate-no-updates.html' %]
+[% ELSIF problem.extra.closed_updates %]
+ <p>[% loc('This report is now closed to updates.') %]
+ [% tprintf(loc('You can <a href="%s">make a new report in the same location</a>.'),
+ c.uri_for( '/report/new', { longitude => longitude, latitude => latitude } )
+ ) %]
+ </p>
[% ELSIF NOT shown_form %]
+ [% IF two_column_sidebar %]
+ <button class="btn btn--provide-update js-provide-update hidden-nojs">[% loc('Provide an update') %]</button>
+ <div class="hidden-js">
+ [% END %]
[% INCLUDE 'report/update-form.html' %]
-[% END %]
-[% IF two_column_sidebar AND NOT problem.extra.closed_updates %]
-</div>
+ [% IF two_column_sidebar %]
+ </div>
+ [% END %]
[% END %]
</div>