blob: e573c10fe32f4e04979445a98daa33a16670ed99 (
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
|
[% INCLUDE 'admin/header.html' title=loc('Search Users') %]
[% PROCESS 'admin/report_blocks.html' %]
[% BLOCK role_select %]
<select name="[% label %]" id="[% label %]" class="form-control">
<option value="">---</option>
[% FOR role IN roles %]
[% IF c.user.is_superuser AND last_name != role.body.name %]
<optgroup label="[% role.body.name %]">
[% SET last_name = role.body.name %]
[% END %]
<option value="[% role.id %]"[% ' selected' IF role.id == role_selected %]>[% role.name | html %]</option>
[% END %]
</select>
[% END %]
[% INCLUDE status_message %]
<div class="fms-admin-info">
[% loc("User search finds matches in users' names and email addresses.") %]
</div>
<form method="get" action="[% c.uri_for_action('admin/users/index') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<div class="filters">
<p><label for="search">[% loc('Search:') %]</label>
<input class="form-control" type="text" name="search" size="30" id="search" value="[% searched | html %]">
[% IF roles %]
<p><label for="role">[% loc('Role:') %]</label>
[% INCLUDE role_select label='role' %]
[% END %]
<p class="no-label"><input type="submit" value="[% loc('Go') %]" class="btn">
</div>
</form>
[% IF users.size %]
<form method="post">
<table cellspacing="0" cellpadding="2" border="1">
<tr>
<th>*</th>
<th>[% loc('Name') %]</th>
<th>[% loc('Email') %]</th>
<th>[% loc('Body') %]</th>
[% IF c.cobrand.moniker != 'zurich' %]
<th>[% loc('Flagged') %]</th>
[% END %]
<th colspan="2">*</th>
</tr>
[%- FOREACH user IN users %]
<tr>
<td align="center">[% IF user.from_body %]
<input type="checkbox" name="uid" value="[% user.id %]" id="uid[% user.id %]">
[% END %]</td>
<td>[% IF user.from_body %]<label class="inline" for="uid[% user.id %]">[% END %]
[% PROCESS value_or_nbsp value=user.name %]
[% IF user.from_body %]</label>[% END %]
</td>
<td><a href="[% c.uri_for_action( 'admin/reports/index', search => user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td>
<td>[% PROCESS value_or_nbsp value=user.from_body.name %]
[% IF user.is_superuser %] * [% END %]
</td>
[% IF c.cobrand.moniker != 'zurich' %]
<td>[% user.flagged == 2 ? loc('User in abuse table') : user.flagged ? loc('Yes') : ' ' %]</td>
[% END %]
<td>[% IF user.id %]<a href="[% c.uri_for_action( 'admin/users/edit', [ user.id ] ) %]">[% loc('Edit') %]</a>[% END %]</td>
<td>[% IF user.id %]<a href="[% c.uri_for_action( 'admin/users/log', [ user.id ] ) %]">[% loc('Timeline') %]</a>[% END %]</td>
</tr>
[%- END -%]
</table>
<p><label for="roles">[% loc('Assign selected to role:') %]</label>
[% IF c.user.is_superuser %]
[% INCLUDE role_select label='roles' %]
[% ELSE %]
<select class="form-control js-multiple" id="roles" name="roles" multiple>
[% FOREACH role IN roles %]
<option value="[% role.id %]">[% role.name | html %]</option>
[% END %]
</select>
[% END %]
<p><input class="btn" type="submit" value="[% loc('Save changes') %]">
</form>
[% ELSIF searched || role_selected %]
<div class="fms-admin-warning">
[% loc("Searching found no users.") %]
</div>
[% END %]
[% IF NOT ( searched || role_selected )%]
<h2>[% loc('Add user') %]</h2>
[% INCLUDE 'admin/users/form.html', user = '' %]
[% ELSE %]
<a href="[% c.uri_for_action('admin/users/add') %]">[% loc('Add user') %]</a>
[% END %]
[% INCLUDE 'admin/footer.html' %]
|