diff options
author | Jannik Schönartz | 2017-12-14 13:03:44 +0100 |
---|---|---|
committer | Jannik Schönartz | 2017-12-14 13:03:44 +0100 |
commit | 5d5c2f27bee5d4fbd3747555efbf2ac9f337805b (patch) | |
tree | c65898e1b3d6f0f46366a280bbbaf4c6ccbc477c /modules-available/permissionmanager/templates/rolestable.html | |
parent | [usb-lock-off] Design changes to fit the design_guidelines. TODO: lang_discar... (diff) | |
parent | [sysconfig] Update translations (diff) | |
download | slx-admin-5d5c2f27bee5d4fbd3747555efbf2ac9f337805b.tar.gz slx-admin-5d5c2f27bee5d4fbd3747555efbf2ac9f337805b.tar.xz slx-admin-5d5c2f27bee5d4fbd3747555efbf2ac9f337805b.zip |
Merge branch 'master' into usb-lock-off
Diffstat (limited to 'modules-available/permissionmanager/templates/rolestable.html')
-rw-r--r-- | modules-available/permissionmanager/templates/rolestable.html | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/modules-available/permissionmanager/templates/rolestable.html b/modules-available/permissionmanager/templates/rolestable.html new file mode 100644 index 00000000..99401624 --- /dev/null +++ b/modules-available/permissionmanager/templates/rolestable.html @@ -0,0 +1,91 @@ +<form method="post" action="?do=permissionmanager"> + <input type="hidden" name="token" value="{{token}}"> + + <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"> + <table id="rolesTable" class="table table-condensed table-hover stupidtable"> + <thead> + <tr> + <th data-sort="string">{{lang_Roles}}</th> + <th class="text-center">{{lang_Edit}}</th> + <th class="text-center">{{lang_Delete}}</th> + </tr> + </thead> + + <tbody> + {{#roles}} + <tr class="rolesRow"> + <td class="rolesData">{{rolename}}</td> + <td class="text-center"> + <a class="btn btn-xs btn-info" href="?do=permissionmanager&show=roleEditor&roleid={{roleid}}"><span class="glyphicon glyphicon-edit"></span></a> + </td> + <td class="text-center"> + <a class="btn btn-xs btn-danger" href="#deleteModal" data-toggle="modal" data-target="#deleteModal" onclick="deleteRole('{{roleid}}')"><span class="glyphicon glyphicon-trash"></span></a> + </td> + </tr> + {{/roles}} + </tbody> + </table> + </div> + </div> + + + <!-- Modals --> + <div class ="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> + <div class="modal-dialog" role="document"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> + <h4 class="modal-title" id="myModalLabel">{{lang_Delete}}</h4> + </div> + <div class="modal-body"> + {{lang_deleteCheck}} + </div> + <div class="modal-footer"> + <input type="hidden" id="deleteId" name="deleteId" value=""/> + <button type="button" class="btn btn-default" data-dismiss="modal">{{lang_cancel}}</button> + <button type="submit" name="action" value="deleteRole" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span> {{lang_Delete}}</button> + </div> + </div> + </div> + </div> + +</form> + +<script> + function openRoleEditor() { + window.location.href = "?do=permissionmanager&show=roleEditor" + } + + 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 |