aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/report
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2017-05-28 21:31:42 +0200
committerMarius Halden <marius.h@lden.org>2017-05-28 21:31:42 +0200
commit987124b09a32248414faf4d0d6615d43b29ac6f6 (patch)
treea549db8af723c981d3b346e855f25d6fd5ff8aa7 /templates/web/base/report
parentdbf56159e44c1560a413022451bf1a1c4cb22a52 (diff)
parenta085b63ce09f87e83b75cda9b9cd08aadfe75d61 (diff)
Merge tag 'v2.0.4' into fiksgatami-dev
Diffstat (limited to 'templates/web/base/report')
-rw-r--r--templates/web/base/report/_inspect.html57
-rw-r--r--templates/web/base/report/_item.html116
-rw-r--r--templates/web/base/report/_main.html32
-rw-r--r--templates/web/base/report/_state_select_field.html12
-rw-r--r--templates/web/base/report/banner.html3
-rw-r--r--templates/web/base/report/inspect/state_groups_select.html24
-rw-r--r--templates/web/base/report/new/form_report.html2
-rw-r--r--templates/web/base/report/new/form_user.html2
-rw-r--r--templates/web/base/report/new/form_user_loggedout.html4
-rw-r--r--templates/web/base/report/photo-js.html6
-rw-r--r--templates/web/base/report/update.html20
-rw-r--r--templates/web/base/report/update/form_update.html12
-rw-r--r--templates/web/base/report/update/form_user_loggedout.html4
-rw-r--r--templates/web/base/report/updates.html50
14 files changed, 216 insertions, 128 deletions
diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html
index 06c3aab6c..b75394abd 100644
--- a/templates/web/base/report/_inspect.html
+++ b/templates/web/base/report/_inspect.html
@@ -1,4 +1,3 @@
-[% PROCESS 'admin/report_blocks.html'; # For the report state dropdown %]
[% permissions = c.user.permissions(c, problem.bodies_str) %]
[% second_column = BLOCK -%]
<div id="side-inspect">
@@ -13,9 +12,15 @@
</p>
<p>
[% SET local_coords = problem.local_coords; %]
- <strong>[% loc('Easting/Northing:') %]</strong>
- <span id="problem_easting">[% local_coords.0 IF local_coords %]</span>,
- <span id="problem_northing">[% local_coords.1 IF local_coords %]</span>
+ [% IF local_coords %]
+ <strong>[% loc('Easting/Northing:') %]</strong>
+ <span id="problem_easting">[% local_coords.0 %]</span>,
+ <span id="problem_northing">[% local_coords.1 %]</span>
+ [% ELSE %]
+ <strong>[% loc('Latitude/Longitude:') %]</strong>
+ <span id="problem_latitude">[% problem.latitude %]</span>
+ <span id="problem_longitude">[% problem.longitude %]</span>,
+ [% END %]
<input type="hidden" name="longitude" value="[% problem.longitude %]">
<input type="hidden" name="latitude" value="[% problem.latitude %]">
</p>
@@ -31,21 +36,7 @@
<div class="inspect-section">
<p>
<label for="category">[% loc('Category') %]</label>
- [%# XXX this is duplicated from admin/report_edit.html, should be refactored %]
- <select name="category" id="category" class="form-control">
- [% IF NOT problem.category OR NOT categories.grep(problem.category).size %]
- <optgroup label="[% loc('Existing category') %]">
- <option selected value="[% problem.category | html %]">[% (problem.category OR '-') | html %]</option>
- </optgroup>
- [% END %]
- [% IF categories.size %]
- <optgroup label="[% loc('Available categories') %]">
- [% FOREACH cat IN categories %]
- <option[% ' selected' IF problem.category == cat %]>[% cat | html %]</option>
- [% END %]
- </optgroup>
- [% END %]
- </select>
+ [% INCLUDE 'admin/report-category.html' %]
</p>
[% FOREACH category IN categories %]
@@ -63,19 +54,21 @@
[% END %]
[% IF permissions.report_inspect %]
+ [% PROCESS 'defect_type/format.html' %]
<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>
+ <label for="defect_type">[% loc('Defect type') %]</label>
+ <select id="defect_type" name="defect_type" class="form-control">
+ <option value=""[% ' selected' IF NOT problem.defect_type %]>-</option>
+ [% FOREACH defect_type IN problem.defect_types %]
+ <option[% ' selected' IF problem.defect_type_id == defect_type.id %] value="[% defect_type.id %]">[% defect_type_format() %]</option>
[% END %]
</select>
</p>
+
+ <p>
+ <label for="state">[% loc('State') %]</label>
+ [% INCLUDE 'report/inspect/state_groups_select.html' %]
+ </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>
@@ -118,8 +111,9 @@
[% traffic_info = problem.get_extra_metadata('traffic_information') %]
<select id="traffic_information" name="traffic_information" class="form-control">
<option value=""[% ' selected' IF NOT traffic_info %]>-</option>
- <option[% ' selected' IF traffic_info == "Yes" %]>Yes</option>
- <option[% ' selected' IF traffic_info == "No" %]>No</option>
+ [% FOREACH option IN problem.traffic_management_options %]
+ <option value='[% option %]'[% ' selected' IF traffic_info == option %]>[% option %]</option>
+ [% END %]
</select>
</p>
<p>
@@ -136,7 +130,7 @@
[% IF permissions.report_inspect %]
<p>
<label class="label-containing-checkbox">
- <input type="checkbox" name="save_inspected" value="1" class="js-toggle-public-update" [% 'checked' IF save_inspected %]>
+ <input type="checkbox" name="include_update" value="1" class="js-toggle-public-update" checked>
[% loc('Save with a public update') %]
</label>
</p>
@@ -157,7 +151,6 @@
<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') %]" 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 0f42b00ce..e627227d4 100644
--- a/templates/web/base/report/_item.html
+++ b/templates/web/base/report/_item.html
@@ -1,18 +1,65 @@
-<li class="item-list__item item-list--reports__item [% item_extra_class %]" data-report-id="[% problem.id | html %]">
+[% IF NOT report_blocks_included ~%]
+[% PROCESS 'admin/report_blocks.html' ~%]
+[% END ~%]
+
+[% IF c.user.has_permission_to('planned_reports', problem.bodies_str_ids) ~%]
+ [% item_extra_class = "item-list__item--indented" ~%]
+ [% item_action = BLOCK ~%]
+ <input type="submit" value="1"
+ data-label-remove="[% loc('Remove from shortlist') %]"
+ data-label-add="[% loc('Add to shortlist') %]"
+ [% IF c.user.is_planned_report(problem) ~%]
+ name="shortlist-remove" title="[% loc('Remove from shortlist') %]" class="item-list__item__shortlist-remove"
+ [%~ ELSE ~%]
+ name="shortlist-add" title="[% loc('Add to shortlist') %]" class="item-list__item__shortlist-[% IF problem.shortlisted_user %]take[% ELSE %]add[% END %]"
+ [%~ END ~%]
+ >
+ [%~ END %]
+[% END %]
+
+[% IF shortlist %]
+ [% item_extra_class = "item-list__item--indented item-list__item--act-and-sort" %]
+ [% item_action = BLOCK %]
+ [% item_action %]
+ <input type="submit" name="shortlist-up" value="[% loc('Up one') %]" title="[% loc('Up one') %]" class="item-list__item__shortlist-up" [% IF loop.first %]disabled[% END %]>
+ <input type="submit" name="shortlist-down" value="[% loc('Down one') %]" title="[% loc('Down one') %]" class="item-list__item__shortlist-down" [% IF loop.last %]disabled[% END %]>
+ [% END %]
+[% END %]
+
+<li class="item-list__item item-list--reports__item [% item_extra_class %]"
+ data-report-id="[% problem.id | html %]" data-lastupdate="[% problem.lastupdate %]">
<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="">
[% END %]
<h3 class="item-list__heading">[% problem.title | html %]</h3>
+ [% IF c.user.has_permission_to('report_inspect', problem.bodies_str_ids) %]
+ <div class="item-list__description">[% problem.detail | html %]</div>
+ [% END %]
<small>
+ [% IF NOT no_fixed AND problem.is_fixed %]
+ <span class="item-list__item__state">[% loc('Fixed') %]</span>
+ [% ELSIF NOT no_fixed AND problem.is_closed %]
+ <span class="item-list__item__state">[% loc('Closed') %]</span>
+ [% ELSIF problem.response_priority AND (c.user.has_permission_to('report_edit_priority', problem.bodies_str_ids) OR c.user.has_permission_to('report_inspect', problem.bodies_str_ids)) %]
+ <span class="item-list__item__state">[% problem.response_priority.name %]</span>
+ [% END %]
[%- IF c.cobrand.moniker != 'fixamingata' %] [%# Default: %]
- [%- prettify_dt( problem.confirmed, 1 ) %]
+ [%- IF problem.days_ago > 0 AND problem.days_ago <= c.cobrand.display_days_ago_threshold %]
+ [% tprintf( nget('Reported %d day ago', 'Reported %d days ago', problem.days_ago), problem.days_ago ) %]
+ [%- ELSE %]
+ [% prettify_dt( problem.confirmed, 1 ) %]
+ [%- END %]
[%- ELSE %] [%# Swedish cobrand fixamingata: %]
[%- prettify_dt( problem.confirmed) %]
[%- END %]
[%- IF dist %], [% dist %]km[% END %]
[%- IF problem.confirmed != problem.lastupdate AND problem.whensent != problem.lastupdate %],
- [% tprintf(loc('last updated %s'), prettify_dt( problem.lastupdate, 1 ) ) %]
+ [%- IF problem.days_ago('lastupdate') > 0 AND problem.days_ago('lastupdate') <= c.cobrand.display_days_ago_threshold %]
+ [% tprintf( nget('last updated %d day ago', 'last updated %d days ago', problem.days_ago('lastupdate') ), problem.days_ago('lastupdate') ) %]
+ [%- ELSE %]
+ [% tprintf(loc('last updated %s'), prettify_dt( problem.lastupdate, 1 ) ) %]
+ [%- END %]
[%- END %]
[% IF include_sentinfo %]
[% IF c.cobrand.is_council && !c.cobrand.owns_problem( problem ) %]
@@ -21,11 +68,64 @@
[% ELSIF problem.bodies_str_ids.size == 0 %] [% loc('(not sent to council)') %]
[% END %]
[% END %]
- [% IF NOT no_fixed AND problem.is_fixed %]
- [% loc('(fixed)') %]
- [% ELSIF NOT no_fixed AND problem.is_closed %]
- [% loc('(closed)') %]
- [% END %]
</small>
+
+ [% IF c.user.has_permission_to('report_inspect', problem.bodies_str_ids) %]
+ <div class="item-list__item__metadata">
+ <div>
+ <h4>[% loc('Report ID:') %]</h4>
+ <p>[% problem.id %]</p>
+ </div>
+ [% IF problem.local_coords %]
+ <div>
+ <h4>[% loc('Easting/Northing:') %]</h4>
+ <p>[% problem.local_coords.0 %], [% problem.local_coords.1 %]</p>
+ </div>
+ [% END %]
+ <div>
+ <h4>[% loc('Latitude/Longitude:') %]</h4>
+ <p>[% problem.latitude %], [% problem.longitude %]</p>
+ </div>
+ <div>
+ <h4>[% loc('Category') %]</h4>
+ <p>[% (problem.category OR '-') | html %]</p>
+ </div>
+ <div>
+ <h4>[% loc('State') %]</h4>
+ <p>[% state_pretty.${problem.state} %]</p>
+ </div>
+ <div>
+ <h4>[% loc('Priority') %]</h4>
+ <p>[% problem.response_priority.name OR '-' %]</p>
+ </div>
+ <div>
+ <h4>[% loc('Traffic management required?') %]</h4>
+ <p>[% problem.get_extra_metadata('traffic_information') %]</p>
+ </div>
+ <div>
+ <h4>[% loc('Extra details') %]</h4>
+ <p>[% problem.get_extra_metadata('detailed_information') | html %]</p>
+ </div>
+ [% SET fields = problem.get_extra_fields; IF fields.size %]
+ [% FOR f IN fields %]
+ <div>
+ <h4>[% f.name %]</h4>
+ <p>[% f.value %]</p>
+ </div>
+ [% END %]
+ [% END %]
+ </div>
+ [% END %]
+
+
</a>
+[% IF item_action AND page != 'around' %]
+ <form method="post" action="/my/planned/change">
+ <input type="hidden" name="id" value="[% problem.id %]">
+ <input type="hidden" name="token" value="[% csrf_token %]">
+ [% item_action %]
+ </form>
+[% ELSIF item_action ~%]
+ [% item_action.replace('("shortlist-[^"]*)', '$1-' _ problem.id) %]
+[% END ~%]
</li>
diff --git a/templates/web/base/report/_main.html b/templates/web/base/report/_main.html
index 4de26535c..83a3a1109 100644
--- a/templates/web/base/report/_main.html
+++ b/templates/web/base/report/_main.html
@@ -5,13 +5,13 @@
<a href="[% c.uri_for( '/around', { lat => latitude, lon => longitude } ) %]"
class="problem-back js-back-to-report-list">[% loc('Back to all reports') %]</a>
-<div class="problem-header clearfix" problem-id="[% problem.id %]">
+<div class="problem-header clearfix" data-lastupdate="[% problem.lastupdate %]">
[% IF c.user.has_permission_to('planned_reports', problem.bodies_str_ids) %]
<form method="post" action="/my/planned/change" id="planned_form" class="hidden-label-target">
<input type="hidden" name="id" value="[% problem.id %]">
<input type="hidden" name="token" value="[% csrf_token %]">
- <input type="hidden" name="change" value="[% IF c.user.is_planned_report(problem) %]remove[% ELSE %]add[% END %]">
+ <input type="hidden" name="[% IF c.user.is_planned_report(problem) %]shortlist-remove[% ELSE %]shortlist-add[% END %]" value="1">
<p><input
type="submit"
id="shortlist-report"
@@ -19,12 +19,16 @@
data-label-add="[% loc('Add to shortlist') %]"
data-value-remove="[% loc('Shortlisted') %]"
data-value-add="[% loc('Shortlist') %]"
+ data-class-remove="btn--shortlisted"
+ data-class-add="btn--shortlist"
[%~ IF c.user.is_planned_report(problem) ~%]
value="[% loc('Shortlisted') %]"
aria-label="[% loc('Remove from shortlist') %]"
+ class="btn--shortlisted"
[%~ ELSE ~%]
value="[% loc('Shortlist') %]"
aria-label="[% loc('Add to shortlist') %]"
+ class="btn--shortlist"
[%~ END ~%]
></p>
</form>
@@ -43,7 +47,7 @@
[% IF problem.title != original.title %]
<label>
<input type="checkbox" name="problem_revert_title" class="revert-title">
- Revert to original title
+ [% loc('Revert to original title') %]
</label>
[% END %]
<h1><input class="form-control" type="text" name="problem_title" value="[% problem.title | html %]" data-original-value="[% original.title | html %]"></h1>
@@ -53,7 +57,7 @@
<div class="moderate-edit">
<label>
<input type="checkbox" name="problem_show_name" [% 'checked' UNLESS problem.anonymous %]>
- Show reporter&rsquo;s name
+ [% loc('Show reporter&rsquo;s name') %]
</label>
</div>
<p class="report_meta_info">
@@ -62,7 +66,7 @@
[% INCLUDE 'report/_main_sent_info.html' %]
[% mlog = problem.latest_moderation_log_entry(); IF mlog %]
- <p>Moderated by [% mlog.user.from_body.name %] at [% prettify_dt(mlog.whenedited) %]</p>
+ <p>[% tprintf(loc('Moderated by %s at %s'), mlog.admin_user, prettify_dt(mlog.whenedited)) %]</p>
[% END %]
[% INCLUDE 'report/_support.html' %]
@@ -72,7 +76,7 @@
<p class="moderate-edit">
<label>
<input type="checkbox" name="problem_show_photo" [% problem.photo ? 'checked' : '' %]>
- Show photo
+ [% loc('Show photo') %]
</label>
</p>
[% END %]
@@ -88,7 +92,7 @@
[% IF problem.detail != original.detail %]
<label>
<input type="checkbox" name="problem_revert_detail" class="revert-textarea">
- Revert to original text
+ [% loc('Revert to original text') %]
</label>
[% END %]
<textarea class="form-control" name="problem_detail" data-original-value="[% original.detail | html %]">[% problem.detail | html %]</textarea>
@@ -98,16 +102,16 @@
<p>
<label>
<input type="checkbox" class="hide-document" name="problem_hide" [% problem.hidden ? 'checked' : '' %]>
- Hide entire report
+ [% loc('Hide entire report') %]
</label>
</p>
<p>
- <label for="moderation_reason">Moderation reason:</label>
- <input type="text" class="form-control" name="moderation_reason" placeholder="Describe why you are moderating this">
+ <label for="moderation_reason">[% loc('Moderation reason:') %]</label>
+ <input type="text" class="form-control" name="moderation_reason" placeholder="[% loc('Describe why you are moderating this') %]">
</p>
<p>
- <input type="submit" class="green-btn" value="Save changes">
- <input type="button" class="btn cancel" value="Discard changes">
+ <input type="submit" class="green-btn" value="[% loc('Save changes') %]">
+ <input type="button" class="btn cancel" value="[% loc('Discard changes') %]">
</p>
</div>
[% END %]
@@ -127,9 +131,9 @@
[% END %]
[% IF c.user.has_permission_to('planned_reports', problem.bodies_str_ids) %]
[%~ IF c.user.is_planned_report(problem) ~%]
- <label class="btn" for="shortlist-report" role="menuitem" aria-label="[% loc('Remove from shortlist') %]">[% loc('Shortlisted') %]</label>
+ <label class="btn btn--shortlisted" for="shortlist-report" role="menuitem" aria-label="[% loc('Remove from shortlist') %]">[% loc('Shortlisted') %]</label>
[%~ ELSE ~%]
- <label class="btn" for="shortlist-report" role="menuitem" aria-label="[% loc('Add to shortlist') %]">[% loc('Shortlist') %]</label>
+ <label class="btn btn--shortlist" for="shortlist-report" role="menuitem" aria-label="[% loc('Add to shortlist') %]">[% loc('Shortlist') %]</label>
[%~ END ~%]
[% END %]
</div>
diff --git a/templates/web/base/report/_state_select_field.html b/templates/web/base/report/_state_select_field.html
new file mode 100644
index 000000000..9b3ed18df
--- /dev/null
+++ b/templates/web/base/report/_state_select_field.html
@@ -0,0 +1,12 @@
+<select class="form-control" name="state" id="state">
+[% IF include_empty %]
+ <option value="">---</option>
+[% END %]
+[% FOREACH group IN state_groups %]
+ <optgroup label="[% group.0 %]">
+ [% FOREACH state IN group.1 %]
+ <option [% 'selected ' IF state == current_state %] value="[% state %]">[% state_pretty.$state %]</option>
+ [% END %]
+ </optgroup>
+[% END %]
+</select>
diff --git a/templates/web/base/report/banner.html b/templates/web/base/report/banner.html
index 188e96502..c80d129eb 100644
--- a/templates/web/base/report/banner.html
+++ b/templates/web/base/report/banner.html
@@ -14,7 +14,6 @@
[% IF problem.is_closed %]
[% INCLUDE banner, id = 'closed', text = loc('Closed') %]
[% END %]
-[% states = [ 'investigating', 'in progress', 'planned', 'action scheduled' ];
- IF states.grep(problem.state).size %]
+[% IF problem.is_in_progress %]
[% INCLUDE banner, id = 'progress', text = loc('In progress') %]
[% END %]
diff --git a/templates/web/base/report/inspect/state_groups_select.html b/templates/web/base/report/inspect/state_groups_select.html
new file mode 100644
index 000000000..c4043751b
--- /dev/null
+++ b/templates/web/base/report/inspect/state_groups_select.html
@@ -0,0 +1,24 @@
+[%
+SET state_pretty = {
+ 'confirmed' = loc('Open')
+ 'investigating' = loc('Investigating')
+ 'in progress' = loc('In progress')
+ 'action scheduled' = loc('Action Scheduled')
+ 'fixed - council' = loc('Fixed - Council')
+ 'unable to fix' = loc('No further action')
+ 'not responsible' = loc('Not Responsible')
+ 'duplicate' = loc('Duplicate')
+ 'internal referral' = loc('Internal referral')
+ 'hidden' = loc('Hidden')
+};
+
+SET state_groups = [
+ [ loc('Open'), [ 'confirmed', 'investigating', 'in progress', 'action scheduled' ] ],
+ [ loc('Fixed'), [ 'fixed - council' ] ],
+ [ loc('Closed'), [ 'unable to fix', 'not responsible', 'duplicate', 'internal referral' ] ],
+ [ loc('Hidden'), [ 'hidden' ] ]
+];
+
+%]
+[% DEFAULT current_state = problem.state %]
+[% INCLUDE 'report/_state_select_field.html' %]
diff --git a/templates/web/base/report/new/form_report.html b/templates/web/base/report/new/form_report.html
index 3c36bd0cc..e85d890c9 100644
--- a/templates/web/base/report/new/form_report.html
+++ b/templates/web/base/report/new/form_report.html
@@ -7,7 +7,7 @@
[% PROCESS "report/new/category_wrapper.html" %]
[% TRY %][% PROCESS 'report/new/after_category.html' %][% CATCH file %][% END %]
- <h2 class="form-section-heading">Public details</h2>
+ <h2 class="form-section-heading">[% loc( 'Public details' ) %]</h2>
<div class="form-section-description" id="js-councils_text">
[% IF js %]
[% PROCESS 'report/new/councils_text_all.html' list_of_names = [ loc('the local council') ] %]
diff --git a/templates/web/base/report/new/form_user.html b/templates/web/base/report/new/form_user.html
index 424660aa8..68a226693 100644
--- a/templates/web/base/report/new/form_user.html
+++ b/templates/web/base/report/new/form_user.html
@@ -1,4 +1,4 @@
-<h2 class="form-section-heading form-section-heading--private">Private details</h2>
+<h2 class="form-section-heading form-section-heading--private">[% loc('Private details') %]</h2>
<p class="form-section-description" id="js-councils_text_private">
[% IF js %]
[% loc('These will be sent to the council, but will never be shown online.') %]
diff --git a/templates/web/base/report/new/form_user_loggedout.html b/templates/web/base/report/new/form_user_loggedout.html
index c444ebce4..4142f4582 100644
--- a/templates/web/base/report/new/form_user_loggedout.html
+++ b/templates/web/base/report/new/form_user_loggedout.html
@@ -3,7 +3,7 @@
<div class="form-box">
<button name="facebook_sign_in" id="facebook_sign_in" value="facebook_sign_in" class="btn btn--block btn--social btn--facebook">
<img alt="" src="/i/facebook-icon-32.png" width="17" height="32">
- Log in with Facebook
+ [% loc('Log in with Facebook') %]
</button>
</div>
[% END %]
@@ -11,7 +11,7 @@
<div class="form-box">
<button name="twitter_sign_in" id="twitter_sign_in" value="twitter_sign_in" class="btn btn--block btn--social btn--twitter">
<img alt="" src="/i/twitter-icon-32.png" width="17" height="32">
- Log in with Twitter
+ [% loc('Log in with Twitter') %]
</button>
</div>
[% END %]
diff --git a/templates/web/base/report/photo-js.html b/templates/web/base/report/photo-js.html
index 05588d085..91b9930e7 100644
--- a/templates/web/base/report/photo-js.html
+++ b/templates/web/base/report/photo-js.html
@@ -1,6 +1,6 @@
[% extra_css = BLOCK %]
<link rel="stylesheet" href="[% version('/js/fancybox/jquery.fancybox-1.3.4.css') %]">
[% END %]
-[% extra_js = BLOCK %]
- <script src="[% version('/js/fancybox/jquery.fancybox-1.3.4.pack.js') %]" charset="utf-8"></script>
-[% END %]
+[% extra_js = [
+ version('/js/fancybox/jquery.fancybox-1.3.4.pack.js')
+] %]
diff --git a/templates/web/base/report/update.html b/templates/web/base/report/update.html
index d423a193d..51c1a9e4f 100644
--- a/templates/web/base/report/update.html
+++ b/templates/web/base/report/update.html
@@ -9,15 +9,15 @@
[% IF moderating; original_update = update.moderation_original_data %]
<form method="post" action="/moderate/report/[% problem.id %]/update/[% update.id %]">
<input type="hidden" name="token" value="[% csrf_token %]">
- <input type="button" class="btn js-moderate moderate-display" value="Moderate this update">
+ <input type="button" class="btn js-moderate moderate-display" value="[% loc('Moderate this update') %]">
<div class="moderate-edit">
<label><input type="checkbox" class="hide-document" name="update_hide">
- Hide update completely?</label>
+ [% loc('Hide update completely?') %]</label>
<label><input type="checkbox" name="update_show_name" [% update.anonymous ? '' : 'checked' %]>
- Show name publicly?</label>
+ [% loc('Show name publicly?') %]</label>
[% IF update.photo or original_update.photo %]
<label><input type="checkbox" name="update_show_photo" [% update.photo ? 'checked' : '' %]>
- Show Photo?</label>
+ [% loc('Show Photo?') %]</label>
[% END %]
</div>
[% END %]
@@ -37,7 +37,7 @@
<div class="moderate-edit">
[% IF update.text != original.detail %]
<label><input type="checkbox" name="update_revert_detail" class="revert-textarea">
- Revert to original</label>
+ [% loc('Revert to original') %]</label>
[% END %]
<textarea class="form-control" name="update_detail">[% update.text | add_links %]</textarea>
</div>
@@ -46,7 +46,7 @@
<p class="meta-2">
[% INCLUDE meta_line %]
[% mlog = update.latest_moderation_log_entry(); IF mlog %]
- <br /> Moderated by [% mlog.user.from_body.name %] at [% prettify_dt(mlog.whenedited) %]
+ <br />[% tprintf(loc('Moderated by %s at %s'), mlog.admin_user, prettify_dt(mlog.whenedited)) %]
[% END %]
</p>
</div>
@@ -54,11 +54,11 @@
</div>
[% IF moderating %]
<div class="moderate-edit">
- <label for="moderation_reason">Moderation reason:</label>
+ <label for="moderation_reason">[% loc('Moderation reason:') %]</label>
<input type="text" class="form-control" name="moderation_reason"
- placeholder="Describe why you are moderating this">
- <input type="submit" class="red-btn" value="Save changes">
- <input type="button" class="btn cancel" value="Discard changes">
+ placeholder="[% loc('Describe why you are moderating this') %]">
+ <input type="submit" class="red-btn" value="[% loc('Save changes') %]">
+ <input type="button" class="btn cancel" value="[% loc('Discard changes') %]">
</div>
</form>
[% END %]
diff --git a/templates/web/base/report/update/form_update.html b/templates/web/base/report/update/form_update.html
index a3d4615e1..f15a1f74b 100644
--- a/templates/web/base/report/update/form_update.html
+++ b/templates/web/base/report/update/form_update.html
@@ -41,16 +41,20 @@
[% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating',
loc('Investigating')], ['action scheduled', loc('Action Scheduled')],
['in progress', loc('In Progress')], ['duplicate', loc('Duplicate')],
- ['unable to fix', loc('Unable to fix')], ['not responsible', loc('Not Responsible')],
+ ['unable to fix', loc('No further action')], ['not responsible', loc('Not Responsible')],
['fixed', loc('Fixed')] ] %]
<option [% 'selected ' IF state.0 == problem.state_display %] value="[% state.0 %]">[% state.1 %]</option>
[% END %]
</select>
[% ELSE %]
- [% IF problem.is_fixed AND ((c.user_exists AND c.user.id == problem.user_id) OR alert_to_reporter) %]
+ [% IF (problem.is_fixed OR problem.state == 'closed') AND ((c.user_exists AND c.user.id == problem.user_id) OR alert_to_reporter) %]
- <input type="checkbox" name="reopen" id="form_reopen" value="1"[% ' checked' IF update.mark_open %]>
- <label class="inline" for="form_reopen">[% loc('This problem has not been fixed') %]</label>
+ <input type="checkbox" name="reopen" id="form_reopen" value="1"[% ' checked' IF (update.mark_open || c.req.params.reopen) %]>
+ [% IF problem.is_closed %]
+ <label class="inline" for="form_reopen">[% loc('This problem is still ongoing') %]</label>
+ [% ELSE %]
+ <label class="inline" for="form_reopen">[% loc('This problem has not been fixed') %]</label>
+ [% END %]
[% ELSIF !problem.is_fixed %]
diff --git a/templates/web/base/report/update/form_user_loggedout.html b/templates/web/base/report/update/form_user_loggedout.html
index fa26eb8f4..d9f67e06e 100644
--- a/templates/web/base/report/update/form_user_loggedout.html
+++ b/templates/web/base/report/update/form_user_loggedout.html
@@ -4,7 +4,7 @@
<div class="form-box">
<button name="facebook_sign_in" id="facebook_sign_in" value="facebook_sign_in" class="btn btn--block btn--social btn--facebook">
<img alt="" src="/i/facebook-icon-32.png" width="17" height="32">
- Log in with Facebook
+ [% loc('Log in with Facebook') %]
</button>
</div>
[% END %]
@@ -12,7 +12,7 @@
<div class="form-box">
<button name="twitter_sign_in" id="twitter_sign_in" value="twitter_sign_in" class="btn btn--block btn--social btn--twitter">
<img alt="" src="/i/twitter-icon-32.png" width="17" height="32">
- Log in with Twitter
+ [% loc('Log in with Twitter') %]
</button>
</div>
[% END %]
diff --git a/templates/web/base/report/updates.html b/templates/web/base/report/updates.html
index ff48ecbca..75e94b1d5 100644
--- a/templates/web/base/report/updates.html
+++ b/templates/web/base/report/updates.html
@@ -11,54 +11,6 @@
[% RETURN %]
[% END %]
- [% IF update.anonymous || update.name == '' %]
- [% tprintf( loc( 'Posted anonymously at %s' ), prettify_dt( update.confirmed ) ) -%]
- [%- ELSIF update.user.from_body;
- user_name = update.user.name | html;
- body = update.user.body;
- IF body == 'Bromley Council';
- body = "$body <img src='/cobrands/bromley/favicon.png' alt=''>";
- END %]
- [% tprintf( loc( 'Posted by %s (<strong>%s</strong>) at %s' ), user_name, body, prettify_dt( update.confirmed ) ) -%]
- [%- ELSE %]
- [% tprintf( loc( 'Posted by %s at %s' ), update.name, prettify_dt( update.confirmed ) ) | html -%]
- [%- END -%]
+ [% update.meta_line(c) %]
- [%- update_state = '' %]
- [%- IF update.mark_fixed %][% update_state = loc( 'marked as fixed' ) %][% END %]
- [%- IF update.mark_open %][% update_state = loc( 'reopened' ) %][% END %]
- [%- IF !update_state && update.problem_state %]
- [%- state = update.problem_state_display %]
- [%- IF c.cobrand.moniker == 'bromley' OR problem.bodies_str == '2482' %]
- [%- SET update_state = 'marked as no further action' IF state == 'unable to fix' %]
- [%- SET update_state = 'marked as third party responsibility' IF state == 'not responsible' %]
- [%- END %]
- [%- END %]
- [%- IF !update_state && update.problem_state %]
- [%- IF state == 'confirmed' AND global.last_state != '' %]
- [%- update_state = loc( 'reopened' ) %]
- [%- ELSIF state == 'investigating' %]
- [%- update_state = loc( 'marked as investigating' ) %]
- [%- ELSIF state == 'planned' %]
- [%- update_state = loc( 'marked as planned' ) %]
- [%- ELSIF state == 'in progress' %]
- [%- update_state = loc( 'marked as in progress' ) %]
- [%- ELSIF state == 'action scheduled' %]
- [%- update_state = loc( 'marked as action scheduled' ) %]
- [%- ELSIF state == 'closed' %]
- [%- update_state = loc( 'marked as closed' ) %]
- [%- ELSIF state == 'fixed' %]
- [%- update_state = loc( 'marked as fixed' ) %]
- [%- ELSIF state == 'unable to fix' %]
- [%- update_state = loc( 'marked as unable to fix' ) %]
- [%- ELSIF state == 'not responsible' %]
- [%- update_state = loc( "marked as not the council's responsibility" ) %]
- [%- ELSIF state == 'duplicate' %]
- [%- update_state = loc( 'closed as a duplicate report' ) %]
- [%- ELSIF state == 'internal referral' %]
- [%- update_state = loc( 'marked as an internal referral' ) %]
- [%- END %]
- [%- END %]
- [%- ", " _ update_state IF update_state != global.last_state %]
- [%- global.last_state = update_state %]
[% END %]