blob: 4de26535c02a901d7208e10e253059214fcbecfb (
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
|
[% 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" problem-id="[% problem.id %]">
[% IF c.user.has_permission_to('planned_reports', problem.bodies_str_ids) %]
<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 %]">
<input type="hidden" name="change" value="[% IF c.user.is_planned_report(problem) %]remove[% ELSE %]add[% END %]">
<p><input
type="submit"
id="shortlist-report"
data-label-remove="[% loc('Remove from shortlist') %]"
data-label-add="[% loc('Add to shortlist') %]"
data-value-remove="[% loc('Shortlisted') %]"
data-value-add="[% loc('Shortlist') %]"
[%~ IF c.user.is_planned_report(problem) ~%]
value="[% loc('Shortlisted') %]"
aria-label="[% loc('Remove from shortlist') %]"
[%~ ELSE ~%]
value="[% loc('Shortlist') %]"
aria-label="[% loc('Add to shortlist') %]"
[%~ END ~%]
></p>
</form>
[% END %]
[% IF permissions.moderate %]
[% original = problem_original %]
<form method="post" action="/moderate/report/[% problem.id %]">
<input type="hidden" name="token" value="[% csrf_token %]">
[% END %]
<h1 class="moderate-display">[% problem.title | html %]</h1>
[% IF permissions.moderate %]
<div class="moderate-edit">
[% IF problem.title != original.title %]
<label>
<input type="checkbox" name="problem_revert_title" class="revert-title">
Revert to original title
</label>
[% END %]
<h1><input class="form-control" type="text" name="problem_title" value="[% problem.title | html %]" data-original-value="[% original.title | html %]"></h1>
</div>
[% END %]
<div class="moderate-edit">
<label>
<input type="checkbox" name="problem_show_name" [% 'checked' UNLESS problem.anonymous %]>
Show reporter’s name
</label>
</div>
<p class="report_meta_info">
[% INCLUDE 'report/_report_meta_info.html' %]
</p>
[% INCLUDE 'report/_main_sent_info.html' %]
[% mlog = problem.latest_moderation_log_entry(); IF mlog %]
<p>Moderated by [% mlog.user.from_body.name %] at [% prettify_dt(mlog.whenedited) %]</p>
[% END %]
[% INCLUDE 'report/_support.html' %]
[% IF permissions.moderate %]
[% IF problem.photo or original.photo %]
<p class="moderate-edit">
<label>
<input type="checkbox" name="problem_show_photo" [% problem.photo ? 'checked' : '' %]>
Show photo
</label>
</p>
[% END %]
[% END %]
[% INCLUDE 'report/photo.html' object=problem %]
<div class="moderate-display">
[% problem.detail | add_links | html_para %]
</div>
[% IF permissions.moderate %]
<p class="moderate-edit">
[% IF problem.detail != original.detail %]
<label>
<input type="checkbox" name="problem_revert_detail" class="revert-textarea">
Revert to original text
</label>
[% END %]
<textarea class="form-control" name="problem_detail" data-original-value="[% original.detail | html %]">[% problem.detail | html %]</textarea>
</p>
<div class="moderate-edit">
<p>
<label>
<input type="checkbox" class="hide-document" name="problem_hide" [% problem.hidden ? 'checked' : '' %]>
Hide entire report
</label>
</p>
<p>
<label for="moderation_reason">Moderation reason:</label>
<input type="text" class="form-control" name="moderation_reason" placeholder="Describe why you are moderating this">
</p>
<p>
<input type="submit" class="green-btn" value="Save changes">
<input type="button" class="btn cancel" value="Discard changes">
</p>
</div>
[% END %]
[% IF permissions.moderate %]
</form>
[% END %]
[% IF
(permissions.moderate)
OR
(c.user.has_permission_to('planned_reports', problem.bodies_str_ids))
%]
<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 c.user.is_planned_report(problem) ~%]
<label class="btn" for="shortlist-report" role="menuitem" aria-label="[% loc('Remove from shortlist') %]">[% loc('Shortlisted') %]</label>
[%~ ELSE ~%]
<label class="btn" for="shortlist-report" role="menuitem" aria-label="[% loc('Add to shortlist') %]">[% loc('Shortlist') %]</label>
[%~ END ~%]
[% END %]
</div>
[% END %]
[% IF permissions.planned_reports AND problem.shortlisted_user AND NOT c.user.is_planned_report(problem) %]
<div class="moderate-display shortlisted-status">
<h3>[% tprintf(loc('Shortlisted by %s'), problem.shortlisted_user.name) %]</h3>
<p>[% tprintf(loc('Adding this report to your shortlist will remove it from %s’s shortlist.'), problem.shortlisted_user.name) %]</p>
</div>
[% END %]
[% TRY %][% PROCESS 'report/_main_after.html' %][% CATCH file %][% END %]
</div>
|