blob: dbd554b1eb93a9a2794648b6dda335ade10b5a5b (
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
<form method="post" id="user_edit" action="[% c.uri_for( 'user_edit', user.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" >
[% INCLUDE 'errors.html' errors = field_errors.values %]
<ul class="no-bullets">
<li>
<div class="admin-hint">
<p>
[% loc(
"The user's <strong>name</strong> is displayed publicly on reports that have not been marked <em>anonymous</em>.
Names are not necessarily unique.")
%]
</p>
</div>
<label for="name">[% loc('Name:') %]</label>
<input type='text' class="form-control" name='name' id='name' value='[% user.name | html %]'>
</li>
<li><label for="email">[% loc('Email:') %]</label>
<input type='text' class="form-control" id='email' name='email' value='[% user.email | html %]'></li>
<li><label for="phone">[% loc('Phone:') %]</label>
<input type='text' class="form-control" id='phone' name='phone' value='[% user.phone | html %]'></li>
[% IF c.user.is_superuser || c.cobrand.moniker == 'zurich' %]
<li>
<div class="admin-hint">
<p>
[% loc(
"Normal (public) users should not be associated with any <strong>body</strong>.<br>
Authorised staff users can be associated with the body they represent.<br>
Depending on the implementation, staff users may have access to the dashboard (summary of
activity across their body), the ability to hide reports or set special report statuses.")
%]
</p>
</div>
[% loc('Body:') %] <select class="form-control" id='body' name='body'>
<option value=''>[% loc('No body') %]</option>
[% FOR body IN bodies %]
<option value="[% body.id %]"[% ' selected data-originally-selected' IF body.id == user.from_body.id %]>[% body.name %]</option>
[% END %]
</select>
</li>
[% ELSE %]
<li>
<div class="admin-hint">
<p>
[% loc("Staff users have permission to log in to the admin.") %]
</p>
</div>
[% loc('Staff:') %] <input type="checkbox" id="body" name="body" value="[% c.user.from_body.id %]" [% user.from_body.id == c.user.from_body.id ? ' checked' : '' %] [% 'disabled' UNLESS c.user.has_body_permission_to('user_assign_body') %]>
</li>
[% END %]
[% IF areas AND c.cobrand.moniker != 'zurich' %]
<li>
<div class="admin-hint">
<p>
[% loc(
"Normal (public) users should not be associated with any <strong>area</strong>.<br>
Authorised staff users can be associated with the area in which they operate.")
%]
</p>
</div>
[% loc('Area:') %]
<select class="form-control" id='area_id' name='area_id' [% 'disabled' UNLESS c.user.has_permission_to('user_assign_areas', user.from_body.id) %]>
<option value=''>[% loc('No area') %]</option>
[% FOREACH area IN areas %]
<option value="[% area.id %]"[% ' selected' IF area.id == user.area_id %]>[% area.name | html %]</option>
[% END %]
</select>
</li>
[% END %]
[% IF contacts AND c.cobrand.moniker != 'zurich'%]
<li class="js-user-categories">
<div class="admin-hint">
<p>
[% loc(
"Authorised staff users can be associated with the categories in which they operate.")
%]
</p>
</div>
[% INCLUDE 'admin/category-checkboxes.html' %]
</li>
[% END %]
[% IF c.cobrand.moniker != 'zurich' %]
<li>
<div class="admin-hint">
<p>
[% loc("Mark users whose behaviour you want to keep a check on as <strong>flagged</strong>.") %]
<br>
[% tprintf(loc("Flagged users are listed on the <a href='%s'>flagged</a> page."), c.uri_for( 'flagged' )) %]
<br>
[% loc("You can add an abusive user's email to the abuse list, which automatically hides (and never sends) reports they create.") %]
</p>
</div>
[% loc('Flagged:') %] <input type="checkbox" id="flagged" name="flagged"[% user.flagged ? ' checked' : '' %]>
</li>
[% UNLESS user.is_superuser %]
<li>
<div class="admin-hint">
<p>
[% loc("Reports made by trusted users will be sent to the responsible body without being inspected first.") %]
</p>
</div>
[% IF c.user.is_superuser %]
[% loc('Trusted by bodies:') %]<br />
<select class="form-control" id='body' name='trusted_bodies' multiple>
[% FOR body IN bodies %]
<option value="[% body.id %]"[% ' selected' IF user.has_permission_to('trusted', body.id) %]>[% body.name %]</option>
[% END %]
</select>
[% ELSE %]
<label>
[% loc('Trusted:') %]
<input type="checkbox" id="trusted_bodies" name="trusted_bodies" value="[% c.user.from_body.id %]" [% 'checked' IF user.has_permission_to('trusted', c.user.from_body.id) %]>
</label>
[% END %]
</li>
[% END %]
[% IF c.user.is_superuser %]
<li>
<div class="admin-hint">
<p>
[% loc("Superusers have permission to perform <strong>all actions</strong> within the admin.") %]
</p>
</div>
[% loc('Superuser:') %] <input type="checkbox" id="is_superuser" name="is_superuser"[% user.is_superuser ? ' checked' : '' %]>
</li>
[% END %]
[% IF available_permissions AND NOT user.is_superuser %]
<li>
<div class="admin-hint">
<p>
[% loc("Users can perform the following actions within their assigned body or area.") %]
</p>
</div>
<p>[% loc('Permissions:') %]</p>
<ul>
[% FOREACH group IN available_permissions.pairs %]
<li>
[% group.key %]
<ul class="no-bullets">
<li>
(<a href="#" data-select-all>[% loc('all') %]</a> /
<a href="#" data-select-none>[% loc('none') %]</a>)
</li>
[% FOREACH permission IN group.value %]
<li>
<label class="inline">
<input type="checkbox" id="perms_[% permission.key %]" name="permissions[[% permission.key %]]" [% "checked" IF NOT user.is_superuser AND user.has_body_permission_to(permission.key) %]>
[% permission.value %]
</label>
</li>
[% END %]
</ul>
</li>
[% END %]
</ul>
[% END %]
[% END %]
[% TRY %][% INCLUDE 'admin/user-form-extra-fields.html' %][% CATCH file %][% END %]
</ul>
<input type="submit" class="btn" name="Submit changes" value="[% loc('Submit changes') %]" >
</form>
|