aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/web/base/report/_main.html14
-rw-r--r--templates/web/base/report/display.html3
-rw-r--r--templates/web/base/report/update.html8
-rw-r--r--templates/web/base/reports/_list-filters.html16
-rw-r--r--templates/web/base/reports/_status_filter_options.html3
-rw-r--r--templates/web/bromley/report/display.html67
-rw-r--r--templates/web/bromley/report/update-form.html4
-rw-r--r--templates/web/bromley/report/update/form_name.html29
-rw-r--r--templates/web/oxfordshire/reports/_status_filter_options.html7
9 files changed, 62 insertions, 89 deletions
diff --git a/templates/web/base/report/_main.html b/templates/web/base/report/_main.html
index 405cb2118..25bbd4c33 100644
--- a/templates/web/base/report/_main.html
+++ b/templates/web/base/report/_main.html
@@ -1,13 +1,9 @@
-[% IF c.user_exists %]
- [% DEFAULT permissions = c.user.permissions(c, problem.bodies_str) %]
-[%- END %]
-
<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" data-lastupdate="[% problem.lastupdate %]">
-[% IF c.user.has_permission_to('planned_reports', problem.bodies_str_ids) %]
+[% IF permissions.planned_reports %]
<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 %]">
@@ -124,16 +120,12 @@
</form>
[% END %]
- [% IF
- (permissions.moderate)
- OR
- (c.user.has_permission_to('planned_reports', problem.bodies_str_ids))
- %]
+ [% IF permissions.moderate OR permissions.planned_reports %]
<div class="moderate-display segmented-control" role="menu">
[% IF permissions.moderate %]
<a class="js-moderate btn" role="menuitem" aria-label="[% loc('Moderate this report') %]">[% loc('Moderate') %]</a>
[% END %]
- [% IF c.user.has_permission_to('planned_reports', problem.bodies_str_ids) %]
+ [% IF permissions.planned_reports %]
[%~ IF c.user.is_planned_report(problem) ~%]
<label class="btn btn--shortlisted" for="shortlist-report" role="menuitem" aria-label="[% loc('Remove from shortlist') %]">[% loc('Shortlisted') %]</label>
[%~ ELSE ~%]
diff --git a/templates/web/base/report/display.html b/templates/web/base/report/display.html
index 7c26c4938..d5e3bdcfa 100644
--- a/templates/web/base/report/display.html
+++ b/templates/web/base/report/display.html
@@ -39,6 +39,9 @@
[% END %]
[% INCLUDE 'report/banner.html' %]
+[% IF c.user_exists %]
+ [% DEFAULT permissions = c.user.permissions(c, problem.bodies_str) %]
+[%- END %]
[% INCLUDE 'report/_main.html' %]
[% IF problem.duplicate_of %]
diff --git a/templates/web/base/report/update.html b/templates/web/base/report/update.html
index 5691376e6..6dca226fe 100644
--- a/templates/web/base/report/update.html
+++ b/templates/web/base/report/update.html
@@ -1,12 +1,10 @@
-[% moderating = c.user && c.user.has_permission_to('moderate', problem.bodies_str_ids) %]
-
[% IF loop.first %]
<section class="full-width">
<h4 class="static-with-rule">[% loc('Updates') %]</h4>
<ul class="item-list item-list--updates">
[% END %]
<li class="item-list__item item-list__item--updates">
- [% IF moderating; original_update = update.moderation_original_data %]
+ [% IF permissions.moderate; 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="[% loc('Moderate this update') %]">
@@ -33,7 +31,7 @@
<div class="moderate-display">
[% update.text | add_links | markup(update.user) | html_para %]
</div>
- [% IF moderating %]
+ [% IF permissions.moderate %]
<div class="moderate-edit">
[% IF update.text != original.detail %]
<label><input type="checkbox" name="update_revert_detail" class="revert-textarea">
@@ -66,7 +64,7 @@
</div>
[% END %]
</div>
- [% IF moderating %]
+ [% IF permissions.moderate %]
<div class="moderate-edit">
<label for="moderation_reason">[% loc('Moderation reason:') %]</label>
<input type="text" class="form-control" name="moderation_reason"
diff --git a/templates/web/base/reports/_list-filters.html b/templates/web/base/reports/_list-filters.html
index 50e88857d..ab8ac06f7 100644
--- a/templates/web/base/reports/_list-filters.html
+++ b/templates/web/base/reports/_list-filters.html
@@ -1,10 +1,18 @@
[% select_status = BLOCK %]
<select class="form-control js-multiple" name="status" id="statuses" multiple
- data-all="[% loc('All') %]" data-all-options='["open","closed","fixed"]'
- [%~ IF c.cobrand.on_map_default_status == 'open' %]
- data-none="[% loc('Unfixed reports') %]"
+ data-all="[% loc('All') %]"
+ [% IF c.user_exists AND c.user.is_superuser OR c.user.belongs_to_body(body.id) %]
+ [% options = []; FOR group IN filter_states; FOR state IN group.1; NEXT IF state == 'hidden'; options.push(state); END; END %]
+ data-all-options='["[% options.join('", "') %]"]'
+ [%~ ELSE ~%]
+ [%~ IF has_fixed_state ~%]
+ data-all-options='["open","closed","fixed"]'
+ [%~ ELSE ~%]
+ data-all-options='["open","closed"]'
+ [%~ END ~%]
[%~ END ~%]
- >
+ [% INCLUDE 'reports/_status_filter_options.html' %]
+ >
[% IF c.user_exists AND c.user.has_body_permission_to('planned_reports') AND !shortlist %]
<option value="shortlisted"[% ' selected' IF filter_status.shortlisted %]>[% loc('Shortlisted') %]</option>
<option value="unshortlisted"[% ' selected' IF filter_status.unshortlisted %]>[% loc('Unshortlisted') %]</option>
diff --git a/templates/web/base/reports/_status_filter_options.html b/templates/web/base/reports/_status_filter_options.html
new file mode 100644
index 000000000..b761222e0
--- /dev/null
+++ b/templates/web/base/reports/_status_filter_options.html
@@ -0,0 +1,3 @@
+ [%~ IF c.cobrand.on_map_default_status == 'open' %]
+ data-none="[% prettify_state('confirmed') %]"
+ [%~ END ~%]
diff --git a/templates/web/bromley/report/display.html b/templates/web/bromley/report/display.html
deleted file mode 100644
index 4c1a69bca..000000000
--- a/templates/web/bromley/report/display.html
+++ /dev/null
@@ -1,67 +0,0 @@
-[%
- PROCESS "report/photo-js.html";
- PROCESS "maps/${map.type}.html";
-
- problem_title = problem.title_safe _ ' - ' _ loc('Viewing a problem');
- INCLUDE 'header.html'
- title = problem_title
- rss = [ loc('Updates to this problem, FixMyStreet'), "/rss/$problem.id" ]
- robots = 'index, nofollow'
- bodyclass = 'mappage'
-%]
-
-[% map_html %]
-</div>
-
-<div id="map_sidebar">
-
-[% IF login_success %]
- <p class='form-success'>[% loc('You have successfully signed in; please check and confirm your details are accurate:') %]</p>
-[% END %]
-
-[% INCLUDE 'report/banner.html' %]
-[% INCLUDE 'report/_main.html' %]
-
-[% IF problem.duplicate_of %]
- [% INCLUDE 'report/duplicate-no-updates.html' hide_header = 1 %]
-[% END %]
-
-[% INCLUDE 'report/display_tools.html' %]
-[% INCLUDE 'report/updates.html' %]
-
-[% IF problem.duplicate_of %]
- [% INCLUDE 'report/duplicate-no-updates.html' %]
-[% ELSE %]
- [% INCLUDE 'report/update-form.html' %]
-[% END %]
-</div>
-
-[% INCLUDE 'footer.html' %]
-
-[% BLOCK name %]
- [% INCLUDE 'report/new/extra_name.html' %]
-
- [% IF c.user_exists %]
- [% names = c.user.split_name %]
- [% END %]
- <label for="form_first_name">[% loc('First Name') %]</label>
- [% IF field_errors.first_name %]
- <p class='form-error'>[% field_errors.first_name %]</p>
- [% END %]
- <input class="js-form-name form-control" type="text" value="[% names.first || first_name | html %]" name="first_name" id="form_first_name" placeholder="[% loc('Your first name') %]">
-
- <label for="form_last_name">[% loc('Last Name') %]</label>
- [% IF field_errors.last_name %]
- <p class='form-error'>[% field_errors.last_name %]</p>
- [% END %]
- <input class="js-form-name form-control" type="text" value="[% names.last || last_name | html %]" name="last_name" id="form_last_name" placeholder="[% loc('Your last name') %]">
-
- <div class="checkbox-group">
- <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF update AND NOT update.anonymous %]>
- <label class="inline" for="form_may_show_name">[% loc('Show my name publicly') %]</label>
- </div>
- <div class="checkbox-group">
- <input type="checkbox" name="add_alert" id="form_add_alert" value="1"[% ' checked' IF add_alert %]>
- <label class="inline" for="form_add_alert">[% loc( 'Alert me to future updates' ) %]</label>
- </div>
-[% END %]
diff --git a/templates/web/bromley/report/update-form.html b/templates/web/bromley/report/update-form.html
index 22dfb1c08..e6d0e1bc0 100644
--- a/templates/web/bromley/report/update-form.html
+++ b/templates/web/bromley/report/update-form.html
@@ -71,7 +71,7 @@
[% IF c.user_exists %]
- [% INCLUDE name %]
+ [% INCLUDE 'report/update/form_name.html' %]
<input class="final-submit green-btn js-submit_register" type="submit" name="submit_register" value="[% loc('Post') %]">
@@ -93,7 +93,7 @@
<div id="form_sign_in_no" class="form-box">
<h5>Confirm my report by email</h5>
- [% INCLUDE name %]
+ [% INCLUDE 'report/update/form_name.html' %]
<label for="password_register">[% loc('Password (optional)') %]</label>
diff --git a/templates/web/bromley/report/update/form_name.html b/templates/web/bromley/report/update/form_name.html
new file mode 100644
index 000000000..a33d144bd
--- /dev/null
+++ b/templates/web/bromley/report/update/form_name.html
@@ -0,0 +1,29 @@
+[% INCLUDE 'report/new/extra_name.html' %]
+
+[% PROCESS 'user/_anonymity.html' anonymous = update.anonymous %]
+
+[% IF c.user_exists %]
+ [% names = c.user.split_name %]
+[% END %]
+
+<label for="form_first_name">[% loc('First Name') %]</label>
+[% IF field_errors.first_name %]
+ <p class='form-error'>[% field_errors.first_name %]</p>
+[% END %]
+<input class="js-form-name form-control" type="text" value="[% names.first || first_name | html %]" name="first_name" id="form_first_name" placeholder="[% loc('Your first name') %]">
+
+<label for="form_last_name">[% loc('Last Name') %]</label>
+[% IF field_errors.last_name %]
+ <p class='form-error'>[% field_errors.last_name %]</p>
+[% END %]
+<input class="js-form-name form-control" type="text" value="[% names.last || last_name | html %]" name="last_name" id="form_last_name" placeholder="[% loc('Your last name') %]">
+
+<div class="checkbox-group">
+ <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF name_public %]>
+ <label class="inline" for="form_may_show_name">[% loc('Show my name publicly') %]</label>
+</div>
+
+<div class="checkbox-group">
+ <input type="checkbox" name="add_alert" id="form_add_alert" value="1"[% ' checked' IF add_alert %]>
+ <label class="inline" for="form_add_alert">[% loc( 'Alert me to future updates' ) %]</label>
+</div>
diff --git a/templates/web/oxfordshire/reports/_status_filter_options.html b/templates/web/oxfordshire/reports/_status_filter_options.html
new file mode 100644
index 000000000..7f4fd5ace
--- /dev/null
+++ b/templates/web/oxfordshire/reports/_status_filter_options.html
@@ -0,0 +1,7 @@
+ [% IF c.user_exists AND c.user.is_superuser OR c.user.belongs_to_body(body.id) %]
+ data-none="All unresolved"
+ data-extra="All unresolved"
+ data-extra-options='["confirmed","investigating","action scheduled"]'
+ [% ELSE %]
+ data-none="Open"
+ [%~ END ~%]