X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=static%2Fsrc%2Frolehandler%2Frole_list.js;fp=static%2Fsrc%2Frolehandler%2Frole_list.js;h=fc19f5217db150aaa372c4483d9e202ec9e93bdf;hb=8da2313d9791c27c6e67511bb0e392aec73ec7c4;hp=0000000000000000000000000000000000000000;hpb=bcc7030f7984b22a7f6556685675b0cd0b68f259;p=osm%2FLW-UI.git diff --git a/static/src/rolehandler/role_list.js b/static/src/rolehandler/role_list.js new file mode 100644 index 0000000..fc19f52 --- /dev/null +++ b/static/src/rolehandler/role_list.js @@ -0,0 +1,58 @@ +/* + Copyright 2019 EveryUP srl + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +function openModalCreateRole(args) { + + + + $('#modal_new_role').modal('show'); +} + +function openModalEditRole(args) { + var url = '/admin/roles/' + args.role_id; + + $("#formEditRole").attr("action", url); + + + $('#modal_edit_role').modal('show'); +} + +function deleteRole(role_id, name) { + var delete_url = '/admin/roles/' + role_id + '/delete'; + bootbox.confirm("Are you sure want to delete " + name + "?", function (confirm) { + if (confirm) { + var dialog = bootbox.dialog({ + message: '
Loading...
', + closeButton: false + }); + $.ajax({ + url: delete_url, + dataType: "json", + contentType: "application/json;charset=utf-8", + success: function (result) { + //$('#modal_show_vim_body').empty(); + dialog.modal('hide'); + table.ajax.reload(); + }, + error: function (result) { + dialog.modal('hide'); + bootbox.alert("An error occurred."); + } + }); + } + }) + +} \ No newline at end of file