diff options
Diffstat (limited to 'templates/web/base')
-rw-r--r-- | templates/web/base/report/_inspect.html | 49 | ||||
-rw-r--r-- | templates/web/base/report/_item.html | 2 | ||||
-rw-r--r-- | templates/web/base/report/display.html | 9 | ||||
-rw-r--r-- | templates/web/base/report/duplicate-no-updates.html | 7 | ||||
-rw-r--r-- | templates/web/base/report/updates.html | 2 |
5 files changed, 51 insertions, 18 deletions
diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html index 012411b7e..ccaa756c5 100644 --- a/templates/web/base/report/_inspect.html +++ b/templates/web/base/report/_inspect.html @@ -9,7 +9,7 @@ <div class="inspect-section"> <p> <strong>[% loc('Report ID:') %]</strong> - [% problem.id %] + <span class="js-report-id">[% problem.id %]</span> </p> <p> [% SET local_coords = problem.local_coords; %] @@ -63,19 +63,38 @@ [% END %] [% IF permissions.report_inspect %] - <p> - <label for="state">[% loc('State') %]</label> - [%# XXX this is duplicated from admin/report_edit.html, should be refactored %] - <select name="state" id="state" class="form-control"> - [% FOREACH group IN state_groups %] - <optgroup label="[% group.0 %]"> - [% FOREACH state IN group.1 %] - <option [% 'selected ' IF state == problem.state %] value="[% state %]">[% state_pretty.$state %]</option> - [% END %] - </optgroup> - [% END %] - </select> - </p> + <p> + <label for="state">[% loc('State') %]</label> + [%# XXX this is duplicated from admin/report_edit.html, should be refactored %] + <select name="state" id="state" class="form-control"> + [% FOREACH group IN state_groups %] + <optgroup label="[% group.0 %]"> + [% FOREACH state IN group.1 %] + <option [% 'selected ' IF state == problem.state %] value="[% state %]">[% state_pretty.$state %]</option> + [% END %] + </optgroup> + [% END %] + </select> + </p> + <div id="js-duplicate-reports" class="[% "hidden" UNLESS problem.duplicate_of %]"> + <input type="hidden" name="duplicate_of" value="[% problem.duplicate_of.id %]"> + <p class="[% "hidden" UNLESS problem.duplicate_of %]"><strong>[% loc('Duplicate of') %]</strong></p> + <p class="[% "hidden" IF problem.duplicate_of %]">[% loc('Which report is it a duplicate of?') %]</p> + <ul class="item-list"> + [% IF problem.duplicate_of %] + [% INCLUDE 'report/_item.html' item_extra_class = 'item-list--reports__item--selected' problem = problem.duplicate_of %] + <li class="item-list__item"><a class="btn" href="#" id="js-change-duplicate-report">[% loc('Choose another') %]</a></li> + [% END %] + </ul> + </div> + [% IF problem.duplicates.size %] + <p><strong>[% loc('Duplicates') %]</strong></p> + <ul class="item-list"> + [% FOR duplicate IN problem.duplicates %] + [% INCLUDE 'report/_item.html' problem = duplicate %] + [% END %] + </ul> + [% END %] [% END %] </div> @@ -139,7 +158,7 @@ <p> <input type="hidden" name="token" value="[% csrf_token %]"> <a class="btn" href="[% c.uri_for( '/report', problem.id ) %]">[% loc('Cancel') %]</a> - <input class="btn btn-primary" type="submit" value="[% loc('Save changes') %]" name="save" /> + <input class="btn btn-primary" type="submit" value="[% loc('Save changes') %]" data-value-original="[% loc('Save changes') %]" data-value-duplicate="[% loc('Save + close as duplicate') %]" name="save" /> </p> </div> diff --git a/templates/web/base/report/_item.html b/templates/web/base/report/_item.html index 5894c5d81..0f42b00ce 100644 --- a/templates/web/base/report/_item.html +++ b/templates/web/base/report/_item.html @@ -1,4 +1,4 @@ -<li class="item-list__item item-list--reports__item [% item_extra_class %]"> +<li class="item-list__item item-list--reports__item [% item_extra_class %]" data-report-id="[% problem.id | html %]"> <a href="[% c.cobrand.base_url_for_report( problem ) %][% problem.url %]"> [% IF problem.photo %] <img class="img" height="60" width="90" src="[% problem.photos.first.url_fp %]" alt=""> diff --git a/templates/web/base/report/display.html b/templates/web/base/report/display.html index 1ee5c4636..7c26c4938 100644 --- a/templates/web/base/report/display.html +++ b/templates/web/base/report/display.html @@ -40,12 +40,19 @@ [% INCLUDE 'report/banner.html' %] [% INCLUDE 'report/_main.html' %] + +[% IF problem.duplicate_of %] + [% INCLUDE 'report/duplicate-no-updates.html' hide_header = 1 %] +[% END %] + [% TRY %][% INCLUDE 'report/_message_manager.html' %][% CATCH file %][% END %] [% INCLUDE 'report/display_tools.html' %] [% TRY %][% INCLUDE 'report/sharing.html' %][% CATCH file %][% END %] [% INCLUDE 'report/updates.html' %] -[% IF NOT shown_form %] +[% IF problem.duplicate_of %] + [% INCLUDE 'report/duplicate-no-updates.html' %] +[% ELSIF NOT shown_form %] [% INCLUDE 'report/update-form.html' %] [% END %] diff --git a/templates/web/base/report/duplicate-no-updates.html b/templates/web/base/report/duplicate-no-updates.html new file mode 100644 index 000000000..eb9ded728 --- /dev/null +++ b/templates/web/base/report/duplicate-no-updates.html @@ -0,0 +1,7 @@ +<div> + [% UNLESS hide_header %]<h2>[% loc( 'Provide an update') %]</h2>[% END %] + <p>[% loc("This report is a duplicate. Please leave updates on the original report:") %]</p> + <ul class="item-list"> + [% INCLUDE 'report/_item.html' item_extra_class = 'item-list__item--with-pin item-list--reports__item--selected' problem = problem.duplicate_of %] + </ul> +</div> diff --git a/templates/web/base/report/updates.html b/templates/web/base/report/updates.html index fc2ac6c78..ff48ecbca 100644 --- a/templates/web/base/report/updates.html +++ b/templates/web/base/report/updates.html @@ -54,7 +54,7 @@ [%- ELSIF state == 'not responsible' %] [%- update_state = loc( "marked as not the council's responsibility" ) %] [%- ELSIF state == 'duplicate' %] - [%- update_state = loc( 'marked as a duplicate report' ) %] + [%- update_state = loc( 'closed as a duplicate report' ) %] [%- ELSIF state == 'internal referral' %] [%- update_state = loc( 'marked as an internal referral' ) %] [%- END %] |