aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorHakim Cassimally <hakim@mysociety.org>2015-03-17 17:58:44 +0000
committerDave Arter <davea@mysociety.org>2015-10-06 09:09:25 +0100
commit3ef919ee67fc34c8b06dd85b035ba9d0ef85804c (patch)
treea0e546df59d6519daaa37072de48140fe899cda1 /templates
parentd46284114fcd1b2038bc6da5b6477d6a293b1699 (diff)
[Zurich] additional closure statuses work
Requirements: ============= 1: DM to be able to mark a problem as Wish, Extern, Not contactable, Hidden, Jurisdiction unknown 2: SDM to be able to mark a problem as Not contactable. 3: DM to be able to add information to such a problem, and trigger emails to external agencies, and to user, closing the problem at the same time. 4: Closed reports must be categorized as Wish/Extern/NC/Hidden/JU for statistical reporting 5: Non-closed reports must appear as open, to allow DM to see them in the list, similar to what is currently done for Ruckmeldung Ausstehend (Feedback outstanding). 5b: however "Hidden" problems must be immediately hidden from public view. Proposal: ========= a) Requirement 1 will be carried out in exactly the same way by DM. e.g. Category dropdown select b) Requirement 2 will be carried out in exactly the same way by SDM. e.g. "Not contactable" button c) BUT, for a), c), the category will be diverted to "Ruckmeldung Ausstehend" (Feedback outstanding), and metadata will be saved with the appropriate closure type. d) NOTE: this means the report will still be visible to public as "In bearbeitung" (Except for Hidden reports, as per 5b) e) The extra fields will be presented on the "Ruckmeldung Ausstehend" page, just as defined in the PDF, depending on the metadata. e.g. - Wish: Zustaendige Stelle + Message - Extern: External body + Message2 - Not contactable: (no extra info) - Hidden: (no extra info) - Jurisdiction unknown: (no extra info) f) When the DM publishes the answer (e.g. "Antwort Veroeffentlichen" button), the state will normally change to Fixed. BUT in the new cases, the metadata saved in step c) will be checked, and the report will change state to Wish/Extern/Not contactable/Hidden/Jurisdiction unknown, as appropriate. The report will now be visible/hidden as previously discussed depending on the new state. g) If the report is edited again (in /admin/report_edit) it will be in the relevant state, and any extra fields will be visible as per e). Those fields may be updated. Alternatively, the state may be changed, possibly triggering a) again, and clearing any metadata. - Fix javascript interactions 690 - show new statuses in summary - fix photos on SDM page - fix Planned => Planned+metadata transition - stop "assignation .select" js affecting templates - fix redirection for Extern and generally See mysociety/FixMyStreet-Commercial#672, mysociety/FixMyStreet-Commercial#690
Diffstat (limited to 'templates')
-rw-r--r--templates/web/zurich/admin/header.html6
-rw-r--r--templates/web/zurich/admin/problem_row.html4
-rw-r--r--templates/web/zurich/admin/report_edit-sdm.html6
-rw-r--r--templates/web/zurich/admin/report_edit.html47
-rw-r--r--templates/web/zurich/admin/response_templates_select.html2
5 files changed, 40 insertions, 25 deletions
diff --git a/templates/web/zurich/admin/header.html b/templates/web/zurich/admin/header.html
index 1cbcfd233..929df8352 100644
--- a/templates/web/zurich/admin/header.html
+++ b/templates/web/zurich/admin/header.html
@@ -9,7 +9,11 @@
'planned' = loc('Planned'),
'fixed - council' = loc('Closed'),
'hidden' = loc('Hidden'),
- 'closed' = loc('Closed'),
+ 'closed' = loc('Extern'),
+ 'partial' = loc('Not contactable'),
+ 'investigating' = loc('Wish'),
+ 'unable to fix' = loc('Jurisdiction unknown'),
+ 'fixed - council' = loc('Closed'),
}
%]
<style type="text/css">
diff --git a/templates/web/zurich/admin/problem_row.html b/templates/web/zurich/admin/problem_row.html
index 123ff5469..baa8d3ac7 100644
--- a/templates/web/zurich/admin/problem_row.html
+++ b/templates/web/zurich/admin/problem_row.html
@@ -18,7 +18,9 @@
<td>[% PROCESS value_or_nbsp value=problem.category %]</td>
<td>[% PROCESS format_date this_date=problem.created %]</td>
<td>[% PROCESS format_date this_date=problem.lastupdate %]</td>
- <td>[% states.${problem.state} %]</td>
+ <td> [% states.${problem.state} %][% IF problem.state == 'planned';
+ SET cs=problem.get_extra_metadata('closure_status');
+ IF cs %] ([% states.$cs %]) [% END; END %]</td>
[% IF include_subdiv %]
<td>
diff --git a/templates/web/zurich/admin/report_edit-sdm.html b/templates/web/zurich/admin/report_edit-sdm.html
index e41fb6060..98092815c 100644
--- a/templates/web/zurich/admin/report_edit-sdm.html
+++ b/templates/web/zurich/admin/report_edit-sdm.html
@@ -67,7 +67,11 @@
</li>
[% IF problem.photo %]
-<li><img alt="" src="[% c.cobrand.base_url %]/photo/[% problem.photo %].temp.jpeg"></li>
+[% FOR photo IN problem.get_photoset(c).images %]
+<li>
+ <img alt="Photo of this report" src="[% c.cobrand.base_url %]/photo/[% photo.0 %].temp.jpeg">
+</li>
+[% END %]
[% END %]
</ul>
diff --git a/templates/web/zurich/admin/report_edit.html b/templates/web/zurich/admin/report_edit.html
index b788c139c..95aa5d311 100644
--- a/templates/web/zurich/admin/report_edit.html
+++ b/templates/web/zurich/admin/report_edit.html
@@ -10,6 +10,8 @@
[% map_html %]
</div>
+[% pstate = problem.get_extra_metadata('closure_status') || problem.state %]
+
[% status_message %]
<form method="post" action="[% c.uri_for( 'report_edit', problem.id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
@@ -23,7 +25,7 @@
<li class="report-edit-action">&raquo; <a href="http://webgis.intra.stzh.ch/AV_Online/Direct.asp?Map=AV&Search=Koord&West=[% problem.local_coords.0 %]&Nord=[% problem.local_coords.1 %]&B=300" target="_blank">Standort in AV-Online anzeigen</a></li>
-[% IF problem.state == 'fixed - council' OR problem.state == 'closed' %]
+[% IF problem_is_closed %]
<li><span class="mock-label">[% loc('Details:') %]</span> [% problem.detail | html %]
[% IF problem.extra.original_detail %]
<br>[%
@@ -134,19 +136,14 @@
<p><span class="mock-label">[% loc('State:') %]</span> <select name="state" id="state">
<option value="">--</option>
[% FOREACH s IN states %]
- <option [% 'selected ' IF s.state == problem.state %] value="[% s.state %]">[% s.trans %]</option>
+ <option [% 'selected ' IF s.state == pstate %] value="[% s.state %]">[% s.trans %]</option>
[% END %]
</select></p>
-<p id="automatic-reply" class="report-edit-action">
- <span class="mock-label">Automatische Antwort</span>
- <input type="checkbox" name="send_rejected_email" id="send_rejected_email" value="1" />
-</p>
-
<script type="text/javascript">
$(function(){
- $('.assignation select').change(function(){
+ $('.assignation__select').change(function(){
if (this.value == "") {
$('.assignation').css('color', '#000');
} else {
@@ -159,11 +156,6 @@ $(function(){
$('#state').change(function(){
// Show or hide the automatic reply field
var state = $(this).val();
- if (state === 'hidden') {
- $('#automatic-reply').show();
- } else {
- $('#automatic-reply').hide();
- }
// Show or hide the categories
if (state === 'confirmed') {
@@ -183,6 +175,19 @@ $(function(){
$('#assignation__external').hide();
}
+ // disable the templates, public_response, publish if we've selected a
+ // different state to the one we started on
+ if ((state === '[% pstate %]')) {
+ $('input[name=publish_response]').show();
+ $('.response_templates_select').show();
+ $('#status_update').show();
+ }
+ else {
+ $('input[name=publish_response]').hide();
+ $('.response_templates_select').hide();
+ $('#status_update').hide();
+ }
+
}).change();
});
</script>
@@ -196,7 +201,7 @@ $(function(){
<div id="assignation__category">
[% loc('Assign to different category:') %]</label>
- <select name="category" id="category">
+ <select name="category" id="category" class="assignation__select">
<option value="">--</option>
[% FOREACH cat IN categories %]
<option value="[% cat %]">[% cat %]</option>
@@ -212,7 +217,7 @@ $(function(){
[% IF admin_type != 'super' AND list %]
<li class="assignation report-edit-action" id="assignation__subdivision">
<label for="body_subdivision">[% loc('Assign to subdivision:') %]</label>
- <select name="body_subdivision" id="body_subdivision">
+ <select name="body_subdivision" id="body_subdivision" class="assignation__select">
<option value="">--</option>
[% list %]
</select>
@@ -222,12 +227,12 @@ $(function(){
[% END %]
[%# 3rd party messages sent for Extern/Wunsch states %]
-[% SWITCH problem.state %]
+[% SWITCH pstate %]
[% CASE ['closed','investigating'] %]
<ul class="no-bullets">
<li class="assignation report-edit-action" id="assignation__external">
<label for="body_external">
- [% IF problem.state == 'closed' %]
+ [% IF pstate == 'closed' %]
[% loc('Assign to external body:') %]
[% ELSE %]
[% loc('Assign to competent body:') %]
@@ -241,19 +246,19 @@ $(function(){
[% END %]
</select>
<br>
- [% IF problem.state == 'closed' %]
+ [% IF pstate == 'closed' %]
<input type="checkbox" name="third_personal" id="third_personal" value="1"[% ' checked' IF problem.extra.third_personal %]>
<label for="third_personal" class="inline">[% loc('Include reporter personal details') %]</label>
[% END %]
[% INCLUDE 'admin/response_templates_select.html' for='external_body' %]
- <textarea name='external_message' id='external_body' cols=60 rows=5></textarea>
+ <textarea name='external_message' id='external_body' cols=60 rows=5>[% problem.get_extra_metadata('external_message') | html %]</textarea>
</li>
</ul>
[% END %]
[%# Public response field shown for Ruckmeldung ausstehend/Extern/
# Zustandigkeit unbekannt/Wunsch/Nicht kontaktierbar/Unsichtbar %]
-[% SWITCH problem.state %]
+[% SWITCH pstate %]
[% CASE ['planned','closed','unable to fix','investigating','partial','hidden'] %]
<ul class="no-bullets report-edit-action">
<li><label for="status_update">[% loc('Public response:') %]</label>
@@ -266,7 +271,7 @@ $(function(){
[% END %]
<p align="right" class="report-edit-action">
-[% IF problem.state == 'planned' %]
+[% IF show_publish_response %]
<input type="submit" name="publish_response" value="[% loc('Publish the response') %]">
[% END %]
<input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" >
diff --git a/templates/web/zurich/admin/response_templates_select.html b/templates/web/zurich/admin/response_templates_select.html
index a16032790..4ae517578 100644
--- a/templates/web/zurich/admin/response_templates_select.html
+++ b/templates/web/zurich/admin/response_templates_select.html
@@ -8,7 +8,7 @@
<option value="[% t.id %]"> [% t.title | html %] </option>
[% END %]
</select>
-</p>
+</div>
<script>
$(function () {
var response_template_texts = {