67 lines
2.4 KiB
HTML
67 lines
2.4 KiB
HTML
|
|
<div id="users" class="page">
|
||
|
|
<div class="col-sm-12 col-sm-offset-0">
|
||
|
|
<h1><span class="fa fa-users"></span> Manage Users</h1>
|
||
|
|
|
||
|
|
<div class="col-sm-6">
|
||
|
|
<div class="dt-buttons btn-group">
|
||
|
|
<a id="createButton" class="btn btn-default buttons-create" tabindex="0" href="javaScript:void(0);"><span>New</span></a>
|
||
|
|
<a class="btn btn-default buttons-selected buttons-edit" tabindex="0" href="javaScript:void(0);"><span>Edit</span></a>
|
||
|
|
<a class="btn btn-default buttons-selected buttons-remove" tabindex="0" href="javaScript:void(0);"><span>Delete</span></a>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<table id="user-table" class="table table-striped table-hover">
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
<th data-key-name="login">Name</th>
|
||
|
|
<th data-key-name="admin">Admin</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
</table>
|
||
|
|
|
||
|
|
<div id="createUserDialog" class="modal fade" role="dialog">
|
||
|
|
<div class="modal-dialog">
|
||
|
|
<!--<form action="/admin/createUser" method="post">-->
|
||
|
|
<div class="modal-header">
|
||
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||
|
|
<h4 class="modal-title">Create User</h4>
|
||
|
|
</div>
|
||
|
|
<div class="modal-body">
|
||
|
|
<div class="form-group">
|
||
|
|
<label>Login</label>
|
||
|
|
<input type="text" class="form-control" name="login" id="loginDialogLogin">
|
||
|
|
</div>
|
||
|
|
<div class="form-group">
|
||
|
|
<label>Password</label>
|
||
|
|
<input type="password" class="form-control" name="password" id="loginDialogPassword">
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="modal-footer">
|
||
|
|
<button type="button" class="btn btn-warning btn-md" id="createUserDialogButton">Create</button>
|
||
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
||
|
|
</div>
|
||
|
|
<!--</form>-->
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<script language="JavaScript" type="text/javascript">
|
||
|
|
var userTable = new LinkedTable($('#user-table'), {url: "user-data", attr: "data-key-name", selection: "row"});
|
||
|
|
|
||
|
|
//Call the refresh user table function once initially.
|
||
|
|
userTable.refresh();
|
||
|
|
$("#createButton").on("click", function(event) {
|
||
|
|
$("#createUserDialog").modal();
|
||
|
|
});
|
||
|
|
|
||
|
|
$("#createUserDialogButton").on("click", function(event) {
|
||
|
|
$.post("createUser", {login: $("#loginDialogLogin"), password: $("#loginDialogPassword")}, function(data) {
|
||
|
|
if(data.result == "success") {
|
||
|
|
|
||
|
|
}
|
||
|
|
else {
|
||
|
|
alert(data.result);
|
||
|
|
}
|
||
|
|
}, "json");
|
||
|
|
})
|
||
|
|
</script>
|
||
|
|
</div>
|
||
|
|
</div>
|