aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2017-01-30 16:32:52 +0000
committerDave Arter <davea@mysociety.org>2017-02-08 10:54:23 +0000
commit312df7e5b0224d9aff0767148879a854089e4ee1 (patch)
tree60e7e103855013f7b11eda4c5e65108b3618ae17 /templates
parent804506834e0ef7c1d6d9ab21dece21a18651295f (diff)
[Oxfordshire] Show simpler state list on inspect form
Limits the state dropdown to those states which will be useful to OCC inspectors, as well as removing a few from the base template on the inspect form. Some slight template refactoring has made it easier for other cobrands to override the list, as well as sharing the template with the admin report_edit form to allow all states to be selected. Fixes mysociety/fixmystreetforcouncils#129
Diffstat (limited to 'templates')
-rw-r--r--templates/web/base/admin/state_groups_select.html13
-rw-r--r--templates/web/base/report/_inspect.html2
-rw-r--r--templates/web/base/report/_state_select_field.html12
-rw-r--r--templates/web/base/report/inspect/state_groups_select.html24
-rw-r--r--templates/web/oxfordshire/report/inspect/state_groups_select.html21
5 files changed, 59 insertions, 13 deletions
diff --git a/templates/web/base/admin/state_groups_select.html b/templates/web/base/admin/state_groups_select.html
index 229d181ab..9a70cd2c9 100644
--- a/templates/web/base/admin/state_groups_select.html
+++ b/templates/web/base/admin/state_groups_select.html
@@ -1,14 +1,3 @@
[% PROCESS 'admin/report_blocks.html'; # For state_groups %]
[% DEFAULT current_state = problem.state %]
-<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>
+[% INCLUDE 'report/_state_select_field.html' %]
diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html
index 3118a49b6..5a7e99ef9 100644
--- a/templates/web/base/report/_inspect.html
+++ b/templates/web/base/report/_inspect.html
@@ -64,7 +64,7 @@
[% IF permissions.report_inspect %]
<p>
<label for="state">[% loc('State') %]</label>
- [% INCLUDE 'admin/state_groups_select.html' %]
+ [% 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 %]">
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/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/oxfordshire/report/inspect/state_groups_select.html b/templates/web/oxfordshire/report/inspect/state_groups_select.html
new file mode 100644
index 000000000..d9db3864a
--- /dev/null
+++ b/templates/web/oxfordshire/report/inspect/state_groups_select.html
@@ -0,0 +1,21 @@
+[%
+SET state_pretty = {
+ 'confirmed' = loc('Open')
+ 'investigating' = loc('Investigating')
+ 'action scheduled' = loc('Action Scheduled')
+ 'fixed - council' = loc('Fixed')
+ 'not responsible' = loc('Not Responsible')
+ 'duplicate' = loc('Duplicate')
+ 'unable to fix' = loc('No further action')
+};
+
+SET state_groups = [
+ [ loc('New'), [ 'confirmed', 'investigating' ] ],
+ [ loc('Scheduled'), [ 'action scheduled' ] ],
+ [ loc('Fixed'), [ 'fixed - council' ] ],
+ [ loc('Closed'), [ 'not responsible', 'duplicate', 'unable to fix' ] ]
+];
+
+%]
+[% DEFAULT current_state = problem.state %]
+[% INCLUDE 'report/_state_select_field.html' %]