blob: 012411b7ee9b443bee73e86584b5d0bc8e919bce (
plain)
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
|
[% 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">
[% INCLUDE 'errors.html' %]
<form id="report_inspect_form" method="post" action="[% c.uri_for( '/report', problem.id ) %]">
<div class="inspect-section">
<p>
<strong>[% loc('Report ID:') %]</strong>
[% problem.id %]
</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>
<input type="hidden" name="longitude" value="[% problem.longitude %]">
<input type="hidden" name="latitude" value="[% problem.latitude %]">
</p>
<p>
<a target="_blank" href="https://www.google.com/maps/dir/Current+Location/[% problem.latitude %],[% problem.longitude %]" class="btn btn--block btn--navigate">[% loc('Navigate to this problem') %]</a>
</p>
<p>
<a href="#" class="btn btn--block btn--geolocate" id="geolocate_link">[% loc('Set to my current location') %]</a>
</p>
</div>
[% IF permissions.report_edit_category OR permissions.report_inspect %]
<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>
</p>
[% FOREACH category IN categories %]
[% cat_prefix = category | lower | replace('[^a-z]', '') %]
[% cat_prefix = "category_" _ cat_prefix _ "_" %]
[% IF category == problem.category %]
<p data-category="[% category | html %]">
[% INCLUDE 'report/new/category_extras_fields.html' %]
</p>
[% ELSIF category_extras.$category.size %]
<p data-category="[% category | html %]" class="hidden">
[% INCLUDE 'report/new/category_extras_fields.html' report_meta='' %]
</p>
[% END %]
[% END %]
[% IF permissions.report_inspect %]
<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>
[% END %]
</select>
</p>
[% END %]
</div>
[% END %]
[% IF permissions.report_edit_priority OR permissions.report_inspect %]
<div class="inspect-section">
<p>
<label for="problem_priority">[% loc('Priority') %]</label>
<select name="priority" id="problem_priority" class="form-control">
<option value="" [% 'selected' UNLESS problem.response_priority_id %]>-</option>
[% FOREACH priority IN problem.response_priorities %]
<option value="[% priority.id %]" [% 'selected' IF problem.response_priority_id == priority.id %] [% 'disabled' IF priority.deleted %]>[% priority.name %]</option>
[% END %]
</select>
</p>
[% IF permissions.report_inspect %]
<p>
<label for="traffic_information">[% loc('Traffic management required?') %]</label>
[% 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>
</select>
</p>
<p>
<label for="detailed_information">[% loc('Extra details') %]</label>
<textarea rows="2" name="detailed_information" id="detailed_information" class="form-control">[% problem.get_extra_metadata('detailed_information') | html %]</textarea>
</p>
[% END %]
</div>
[% END %]
<div class="inspect-section">
[% 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 %]>
[% loc('Save with a public update') %]
</label>
</p>
<p>
<label for="public_update">[% loc('Public update:') %]</label>
[% INCLUDE 'admin/response_templates_select.html' for='public_update' %]
<textarea rows="2" name="public_update" id="public_update" class="form-control">[% public_update | html %]</textarea>
</p>
[% END %]
[% IF problem.get_extra_metadata('inspected') %]
[% IF problem.whensent %]
<p>[% loc("<strong>Note:</strong> This report has been sent onwards for action. Any changes made won't be passed on.") %]</p>
[% ELSE %]
<p>[% loc("<strong>Note:</strong> This report hasn't yet been sent onwards for action. Any changes made may not be passed on.") %]</p>
[% END %]
[% END %]
<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') %]" name="save" />
</p>
</div>
</form>
</div>
[%- END %]
|