blob: 495da8648cdec5c9468a4410ab1f74502a5fcbcf (
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
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
|
<form method="post" id="user_edit" action="[%
SET action_end = user.id || 'add';
c.uri_for_action( 'admin/users/edit', [ action_end ] )
%]" 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 %]'>
[% IF user %]
<input class="btn" type="submit" name="send_login_email" value="[% loc('Send login email') %]">
[% END %]
</li>
<li><label class="inline-text" for="email_verified">[% loc('Email verified:') %]</label>
<input type="checkbox" id="email_verified" name="email_verified" value="1" [% user.email_verified ? ' checked' : '' %]>
<li><label for="phone">[% loc('Phone:') %]</label>
<input type='text' class="form-control" id='phone' name='phone' value='[% user.phone | html %]'></li>
<li><label class="inline-text" for="phone_verified">[% loc('Phone verified:') %]</label>
<input type="checkbox" id="phone_verified" name="phone_verified" value="1" [% user.phone_verified ? ' checked' : '' %]>
[% IF username_in_abuse %]
<li>
<p class="error">[% loc('User in abuse table') %] <input name="unban" type="submit" value="[% loc('Unban') %]"></p>
</li>
[% END %]
[% 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>
<label for="body">[% loc('Body:') %]</label>
<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>
<label>
[% 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') %]>
</label>
</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>
<label for="area_ids">[% loc('Area:') %]</label>
<select class="form-control js-multiple" id="area_ids" name="area_ids"
multiple data-none="-- [% loc('Select an area') %] --"
[% 'disabled' UNLESS c.user.has_permission_to('user_assign_areas', user.from_body.id) %]>
[% FOREACH area IN areas %]
[% SET aid = area.id %]
<option value="[% aid %]"[% ' selected' IF user.in_area(aid) %]>[% area.name | html %]</option>
[% END %]
</select>
</li>
[% END %]
[% IF contacts AND c.cobrand.moniker != 'zurich'%]
<li class="js-user-categories">
[% INCLUDE 'admin/category-checkboxes.html' hint=loc("Authorised staff users can be associated with the categories in which they operate.") %]
</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_action( 'admin/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>
<label>
[% loc('Flagged:') %]
<input type="checkbox" id="flagged" name="flagged"[% user.flagged ? ' checked' : '' %]>
</label>
</li>
[% 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>
<label>
[% loc('Superuser:') %]
<input type="checkbox" id="is_superuser" name="is_superuser"[% user.is_superuser ? ' checked' : '' %]>
</label>
</li>
[% END %]
[% IF available_permissions AND NOT user.is_superuser %]
<li>
<div class="admin-hint">
<p>
[% loc("Users can be assigned one or more roles to give them all the permissions of those roles. Selecting a role or roles will disable manual permission selection.") %]
</p>
</div>
<label for="roles">[% loc('Role:') %]</label>
<select class="form-control js-multiple" id="roles" name="roles" multiple>
[% FOREACH role IN roles %]
<option data-permissions='["[% role.permissions.join('","') | html %]"]' value="[% role.id %]"[% ' selected' IF user.in_role(role.id) %]>[% role.name | html %]</option>
[% END %]
</select>
</li>
<li>
<fieldset>
<legend>
<div class="admin-hint">
<p>
[% loc("Users can perform the following actions within their assigned body or area.") %]
</p>
</div>
[% loc('Permissions:') %]
</legend>
<ul class="permissions-checkboxes">
[% FOREACH group IN available_permissions.pairs %]
<li>
[% group.key %]
<ul class="no-bullets no-margin">
<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>
</fieldset>
</li>
[% END %]
[% END %]
[% TRY %][% INCLUDE 'admin/users/form-extra-fields.html' %][% CATCH file %][% END %]
</ul>
<p>
<input type="submit" class="btn" name="Submit changes" value="[% loc('Submit changes') %]" >
</p>
[% IF user AND NOT user.from_body %]
<ul class="no-bullets danger-zone">
<li><input class="btn-danger" type="submit" name="logout_everywhere" value="[% loc('Log out of all sessions') %]">
<li><input class="btn-danger" type="submit" name="anon_everywhere" value="[% loc('Make anonymous on all reports and updates') %]">
<li><input class="btn-danger" type="submit" name="hide_everywhere" value="[% loc('Hide all reports and updates') %]">
<li><input class="btn-danger" type="submit" name="remove_account" value="[% loc('Remove account details') %]">
</ul>
[% END %]
</form>
|