Skip to content

Commit

Permalink
Show message on reports closed to updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Jun 19, 2018
1 parent 75a07fb commit aacacb7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@
* Unreleased
- Front end improvements:
- Simplify footer CSS. #2107
- 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
Expand Down
3 changes: 2 additions & 1 deletion t/script/inactive.t
Expand Up @@ -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 {
Expand Down
20 changes: 13 additions & 7 deletions templates/web/base/report/display.html
Expand Up @@ -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>[% tprintf(
loc('This report is now closed to updates – <a href="%s">make a new report in the same location</a>.'),
c.uri_for( '/around', { lat => latitude, lon => longitude } )
) %]
</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>
Expand Down

0 comments on commit aacacb7

Please sign in to comment.