1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
[%
PROCESS "report/photo-js.html" IF problem.photo;
PROCESS "maps/${map.type}.html" admin = 1;
SET bodyclass = 'mappage with-notes';
INCLUDE 'admin/header.html'
title = tprintf(loc('Editing problem %d'), problem.id );
PROCESS 'admin/report_blocks.html'
-%]
[% map_html %]
</div>
<div id="map_sidebar">
[% INCLUDE 'admin/navigation.html' title = tprintf(loc('Editing problem %d'), problem.id ) %]
<div id="side">
<form method="post" action="[% c.uri_for( 'report_edit', problem.id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<input type="hidden" name="token" value="[% csrf_token %]" >
<input type="hidden" name="submit" value="1" >
<div class="sidebar">
<p align="center"><input type="submit" class="btn" name="Submit changes" value="[% loc('Submit changes') %]"></p>
<ul>
[%- cobrand_data = problem.cobrand_data;
cobrand_data = c.data_for_generic_problem IF !problem.cobrand;
IF cobrand_data;
uri = c.uri_for_email( '/report', problem.id, cobrand_data );
ELSE;
uri = c.uri_for_email( '/report', problem.id );
END;
%]
<li><a href="[% uri %]" class="admin-offsite-link">[% loc('View report on site' )%]</a></li>
<li>[% loc('Co-ordinates:') %]
<a href="[% c.config.MAPIT_URL %][%
'/' UNLESS c.config.MAPIT_URL.search('/$')
%]point/4326/[% problem.longitude %],[% problem.latitude %].html"
class="admin-offsite-link">[% problem.latitude %], [% problem.longitude %]</a>
[% SET local_coords = problem.local_coords;
IF local_coords %]
([% local_coords.0 %], [% local_coords.1 %])
[% END %]
<small>([%
postcode_safe = problem.postcode | html;
tprintf( loc('originally entered: “%s”'), postcode_safe )
%],
[% IF problem.used_map %][% loc('used map') %][% ELSE %][% loc("didn't use map") %][% END %])</small>
</li>
<li>[% loc('Bodies') %]:
[% IF problem.bodies_str %]
[% FOREACH body IN problem.bodies.values %]
[% SET body_printed = 1 %]
<a href="[% c.uri_for('body', body.id) %]">[% body.name | html %]</a>
[%- ',' IF NOT loop.last %]
[% END %]
[% IF NOT body_printed %]
<em>[% problem.bodies_str %]</em>
[% END %]
[% ELSE %]
<em>[% loc('None' ) %]</em>
[% END %]
<small>([% loc('other areas:') %] [% problem.areas | remove('^,') | remove( ',$' ) | replace(',', ', ') %])</small>
</li>
[% IF problem.bodies_missing %]
<li>[% loc('Missing bodies:') %] [% problem.bodies_missing | html %]</li>
[% END %]
[% IF problem.extra.address %]
<li>[% loc('Property address:') %] [% problem.extra.address | html %]</li>
[% END %]
<li class="sm">[% loc('Created:') %] [% PROCESS format_time time=problem.created %]</li>
<li class="sm">[% loc('Confirmed:') %] [% PROCESS format_time time=problem.confirmed no_time='-' %]</li>
<li class="sm">[% loc('Sent:') %] [% PROCESS format_time time=problem.whensent %]
[% IF problem.send_method_used %]
([% problem.send_method_used %])
[% END %]
[% IF problem.state == 'confirmed' AND problem.whensent AND NOT c.cobrand.disable_resend %]
<input data-confirm="[% loc('Are you sure?') %]" class="btn" type="submit" name="resend" value="[% loc('Resend report') %]">
[% ELSIF NOT problem.whensent %]
<input type="submit" class="btn" name="mark_sent" value="[% loc('Mark as sent') %]">
[% END %]
</li>
[% IF c.user.is_superuser AND problem.send_fail_count > 0 %]
<li class="sm">[% loc('Send Fail Count:') %] [% problem.send_fail_count %]</li>
<li class="sm">[% loc('Last failure:') %] [% PROCESS format_time time=problem.send_fail_timestamp %]</li>
<li class="sm truncate_height">[% loc('Reason:') %] [% problem.send_fail_reason | html %]</li>
[% END %]
<li class="sm">[% loc('Last update:') %] [% PROCESS format_time time=problem.lastupdate %]</li>
<li>[% loc('Alerts:') %] [% alert_count %]</li>
<li>[% loc('Service:') %] [% problem.service OR '<em>' _ loc('None') _ '</em>' %]</li>
<li>[% loc('Cobrand:') %] [% problem.cobrand %]
<br><small>[% loc('Cobrand data:') %] [% cobrand_data OR '<em>' _ loc('None') _ '</em>' %]</small>
</li>
<li>[% loc('Going to send questionnaire?') %] [% IF problem.send_questionnaire %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</li>
<li><label for="external_id">[% loc('External ID') %]:</label>
<input type="text" class="form-control" name="external_id" id="external_id" value="[% problem.external_id | html %]">
<li><label for="external_body">[% loc('External body') %]:</label>
<input type="text" class="form-control" name="external_body" body="external_body" value="[% problem.external_body | html %]">
<li><label for="external_team">[% loc('External team') %]:</label>
<input type="text" class="form-control" name="external_team" team="external_team" value="[% problem.external_team | html %]">
[% IF problem.get_extra_metadata('external_status_code') %]
<li>
<label for="external_status_code">[% loc('External status code') %]:</label>
<span>[% problem.get_extra_metadata('external_status_code') %]</span>
</li>
[% END %]
</ul>
</div>
[% INCLUDE status_message %]
<ul class="plain-list">
<li><label for='title'>[% loc('Subject:') %]</label>
<input size=60 type='text' class="form-control" id='title' name='title' value='[% problem.title | html %]'></li>
<li><label for='detail'>[% loc('Details:') %]</label>
<textarea class="form-control" name='detail' id='detail' cols=60 rows=10>[% problem.detail | html %]</textarea></li>
<li>
<label class="inline-text" for="state">[% loc('State:') %]</label>
[% INCLUDE 'admin/state_groups_select.html' %]
</li>
<li><label class="inline-text" for="category">[% loc('Category:') %]</label>
[% INCLUDE 'admin/report-category.html' %]
</li>
<li>[% loc('Extra data:') %] [% IF extra_fields.size %]<ul>[% FOREACH field IN extra_fields %]<li><strong>[% field.name %]</strong>: [% field.val %]</li>[% END %]</ul>[% ELSE %]No[% END %]</li>
<li><label class="inline-text" for="anonymous">[% loc('Anonymous:') %]</label>
<select class="form-control" name="anonymous" id="anonymous">
<option [% 'selected ' IF problem.anonymous %]value="1">[% loc('Yes') %]</option>
<option [% 'selected ' IF !problem.anonymous %]value="0">[% loc('No') %]</option>
</select></li>
<li><label for="name">[% loc('Name:') %]</label>
<input type='text' class="form-control" name='name' id='name' value='[% problem.name | html %]'></li>
<li><label for="username">[% loc('User:') %]</label>
<input type='text' class="form-control" id='username' name='username' value='[% problem.user.username | html %]'>
[% PROCESS abuse_button %]
[% PROCESS flag_button user=problem.user %]
</li>
[% IF problem.user.phone_display != problem.user.username %]
<li>[% loc('Phone:') %] [% problem.user.phone_display | html %]</li>
[% END %]
[% IF problem.user.email != problem.user.username %]
<li>[% loc('Email:') %]
<a href="mailto:[% problem.user.email | html %]">[% problem.user.email | html %]</a>
</li>
[% END %]
<li><label class="inline-text" for="flagged">[% loc('Flagged:') %]</label>
<input type="checkbox" id="flagged" name="flagged"[% ' checked' IF problem.flagged %]></li>
<li><label class="inline-text" for="non_public">[% loc('Private') %]:</label>
<input type="checkbox" id="non_public" name="non_public"[% ' checked' IF problem.non_public %]></li>
[% IF problem.photo %]
<li>
<ul>
[% FOR photo IN problem.photos %]
<li>
<div class="update-img">
<a href="[% c.cobrand.base_url %][% photo.url_temp_full %]" rel="fancy">
<img alt="Photo of this report" src="[% c.cobrand.base_url %][% photo.url_temp %]">
<span>zoom</span>
</a>
</div>
<input type="submit" name="rotate_photo_[% loop.index %]" value="[% loc('Rotate Left') %]">
<input type="submit" name="rotate_photo_[% loop.index %]" value="[% loc('Rotate Right') %]">
<br><input type="checkbox" id="remove_photo_[% loop.index %]" name="remove_photo_[% loop.index %]" value="1">
<label class="inline" for="remove_photo_[% loop.index %]">[% loc("Remove photo (can't be undone!)") %]</label></li>
</li>
[% END %]
</ul>
</li>
[% END %]
<li><label class="inline-text" for="closed_updates">[% loc('Closed to updates') %]:</label>
<input type="checkbox" id="closed_updates" name="closed_updates"[% ' checked' IF problem.extra.closed_updates %]></li>
</ul>
<input type="submit" class="btn" name="Submit changes" value="[% loc('Submit changes') %]">
</form>
</div>
[% moderation_history = problem.moderation_history %]
[% IF moderation_history %]
<div class="full-width" style="margin-bottom:-2em; padding-bottom: 2em">
<h2>[% loc('Moderation history') %]</h2>
[% last_history = problem %]
<ul>
[% FOR history IN moderation_history %]
<li><i>[% INCLUDE 'report/update/moderation_meta.html' %]</i>
[% INCLUDE 'report/update/moderation_diff.html' diff=history.compare_with(last_history) %]
</li>
[% last_history = history %]
[% END %]
</ul>
</div>
[% END %]
<div class="full-width full-width--bottom">
[% INCLUDE 'admin/list_updates.html' %]
</div>
</div>
[% INCLUDE 'admin/footer.html' %]
|