summaryrefslogtreecommitdiffstats
path: root/modules-available/permissionmanager/templates/rolestable.html
diff options
context:
space:
mode:
authorChristian Hofmaier2017-04-10 18:58:26 +0200
committerChristian Hofmaier2017-04-10 18:58:26 +0200
commitf017c089f5ea740f3e4e458ff976e987ad2426ee (patch)
tree7bff0cecfcdebf7af38d703e98cd65dfbad9c1ed /modules-available/permissionmanager/templates/rolestable.html
parent[permission-manager] added permission check functionality + bugfixes (diff)
downloadslx-admin-f017c089f5ea740f3e4e458ff976e987ad2426ee.tar.gz
slx-admin-f017c089f5ea740f3e4e458ff976e987ad2426ee.tar.xz
slx-admin-f017c089f5ea740f3e4e458ff976e987ad2426ee.zip
[permission-manager] moved multiple code, added text-search to rolesTable
Diffstat (limited to 'modules-available/permissionmanager/templates/rolestable.html')
-rw-r--r--modules-available/permissionmanager/templates/rolestable.html32
1 files changed, 29 insertions, 3 deletions
diff --git a/modules-available/permissionmanager/templates/rolestable.html b/modules-available/permissionmanager/templates/rolestable.html
index 40cdda96..a455d346 100644
--- a/modules-available/permissionmanager/templates/rolestable.html
+++ b/modules-available/permissionmanager/templates/rolestable.html
@@ -1,7 +1,14 @@
<form method="post" action="?do=permissionmanager">
<input type="hidden" name="token" value="{{token}}">
- <button class="btn btn-success" type="button" onclick="openRoleEditor()"><span class="glyphicon glyphicon-plus"></span> {{lang_newRole}}</button>
+ <div class="row">
+ <div class="col-md-4">
+ <button class="btn btn-success" type="button" onclick="openRoleEditor()"><span class="glyphicon glyphicon-plus"></span> {{lang_newRole}}</button>
+ </div>
+ <div class="col-md-4">
+ <input type="text" class="form-control" id="roleNameSearchField" onkeyup="searchFieldFunction()" placeholder="{{lang_searchPlaceholder}}">
+ </div>
+ </div>
<div class="row">
<div class="col-md-12">
@@ -16,8 +23,8 @@
<tbody>
{{#roles}}
- <tr>
- <td>{{roleName}}</td>
+ <tr class="rolesRow">
+ <td class="rolesData">{{roleName}}</td>
<td>
<a href="?do=permissionmanager&show=roleEditor&roleid={{roleId}}">{{lang_Edit}}</a>
</td>
@@ -62,4 +69,23 @@
function deleteRole($roleId) {
$(".modal-footer #deleteId").val($roleId);
}
+
+ function searchFieldFunction() {
+ // Declare variables
+ var input, filter, table, trs, a, i;
+ input = document.getElementById('roleNameSearchField');
+ filter = input.value.toUpperCase();
+ table = document.getElementById("rolesTable");
+ trs = table.getElementsByClassName('rolesRow');
+
+ // Loop through all list items, and hide those who don't match the search query
+ for (i = 0; i < trs.length; i++) {
+ a = trs[i].getElementsByClassName("rolesData")[0];
+ if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {
+ trs[i].style.display = "";
+ } else {
+ trs[i].style.display = "none";
+ }
+ }
+ }
</script> \ No newline at end of file