summaryrefslogtreecommitdiffstats
path: root/modules-available/permissionmanager/templates/rolestable.html
blob: e50dffc743e67fb3405af50c747d05d1d11ecfd6 (plain) (blame)
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
<form method="post" action="?do=permissionmanager">
	<input type="hidden" name="token" value="{{token}}">
	<input type="hidden" name="action" value="deleteRole">

	<div>
		<input type="text" class="form-control" id="roleNameSearchField" onkeyup="searchFieldFunction()" placeholder="{{lang_searchPlaceholder}}">
	</div>

	<div class="row">
		<div class="col-md-12">
			<table class="table table-condensed table-hover stupidtable">
				<thead>
					<tr>
						<th data-sort="string">{{lang_roles}}</th>
						<th data-sort="string">{{lang_description}}</th>
						<th class="text-center slx-smallcol">
							{{#perms.roles.edit.disabled}}
							{{lang_view}}
							{{/perms.roles.edit.disabled}}
							{{^perms.roles.edit.disabled}}
							{{lang_edit}}
							{{/perms.roles.edit.disabled}}
						</th>
						<th class="text-center slx-smallcol">{{lang_delete}}</th>
					</tr>
				</thead>

				<tbody>
				{{#roles}}
					<tr>
						<td class="rolename">{{rolename}}</td>
						<td class="text-muted"><table class="slx-ellipsis"><tr><td>{{roledescription}}</td></tr></table></td>
						<td class="text-center">
							<a class="btn btn-xs btn-primary" href="?do=permissionmanager&amp;show=roleEditor&amp;roleid={{roleid}}"><span class="glyphicon glyphicon-edit"></span></a>
						</td>
						<td class="text-center">
							<button type="submit" name="deleteId" value="{{roleid}}" class="btn btn-xs btn-danger" {{perms.roles.edit.disabled}}
									data-confirm="#confirm-role-{{roleid}}" data-title="{{rolename}}">
								<span class="glyphicon glyphicon-trash"></span>
							</button>
							<div class="hidden" id="confirm-role-{{roleid}}">
								<p>{{lang_roleDeleteConfirm}}</p>
								{{lang_numAssignedUsers}}: {{users}}
							</div>
						</td>
					</tr>
				{{/roles}}
				</tbody>
			</table>
		</div>
	</div>
</form>

<div class="text-right">
	<a href="?do=permissionmanager&amp;show=roleEditor" class="btn btn-success {{perms.roles.edit.disabled}}"><span class="glyphicon glyphicon-plus"></span> {{lang_newRole}}</a>
</div>

<script>
	function searchFieldFunction() {
		var filter = $("#roleNameSearchField").val().toLowerCase();
		$(".rolename").each(function() {
			if ($(this).text().toLowerCase().indexOf(filter) >= 0) {
				$(this).closest("tr").show();
			} else {
				$(this).closest("tr").hide();
			}
		});
	}
</script>