Better error message failed removing user
This commit is contained in:
+14
-2
@@ -157,6 +157,8 @@
|
||||
renderProfile(user);
|
||||
renderUserGroups(user);
|
||||
$('#username').text(user.uid);
|
||||
$('form[action="user/{{uid}}"]').attr('action', 'user/'+user.uid)
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
@@ -263,9 +265,19 @@
|
||||
<button type="button" onclick="editUser()" class="btn btn-warning btn-lg shadow ">
|
||||
<i class="fad fa-user-edit"></i>
|
||||
</button>
|
||||
<button type="button" onclick="app.user.remove({uid: currentUser.uid}, function(){app.util.actionMessage('username {{uid}} delete.', $(this), 'danger')})" class="shadow btn btn-danger btn-lg float-right">
|
||||
|
||||
<form action="user/{{uid}}" method="delete" onsubmit="formAJAX(this)" evalAJAX="window.location.href = '/users'" class="float-right">
|
||||
<button type="submit" class="btn btn-lg btn-danger">
|
||||
<i class="fad fa-user-slash"></i>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
|
||||
<!-- <button type="button" onclick="app.user.remove({uid: currentUser.uid}, function(){app.util.actionMessage('username {{uid}} delete.', $(this), 'danger')})" class="shadow btn btn-danger btn-lg float-right">
|
||||
<i class="fad fa-user-slash"></i>
|
||||
</button>
|
||||
</button> -->
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -20,15 +20,17 @@
|
||||
{{#sshPublicKey}}<i class="fad fa-check-square"></i>{{/sshPublicKey}}
|
||||
</td>
|
||||
<td>
|
||||
<button type="button" onclick="app.user.remove({uid: '{{uid}}'}, function(){renderUsers('username {{uid}} delete.')})" class="btn btn-sm btn-danger">
|
||||
<i class="fad fa-user-slash"></i>
|
||||
</button>
|
||||
<form action="user/{{uid}}" method="delete" onsubmit="formAJAX(this)" evalAJAX="renderUsers('Deleted {{uid}}', 'success')">
|
||||
<button type="submit" class="btn btn-sm btn-danger">
|
||||
<i class="fad fa-user-slash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function renderUsers(actionMessage){
|
||||
function renderUsers(actionMessage, type){
|
||||
var rowTemplate = $('#rowTemplate').html();
|
||||
var $target = $('#tableAJAX');
|
||||
|
||||
@@ -44,14 +46,14 @@
|
||||
|
||||
$target.fadeIn('slow');
|
||||
|
||||
app.util.actionMessage(actionMessage || '', $target, 'info');
|
||||
app.util.actionMessage(actionMessage || '', $target, type || 'info');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
renderUsers(); //populate the table
|
||||
$('form[action="user/"]').attr('evalAJAX', 'renderUsers()')
|
||||
$('form[action="user/"]').attr('evalAJAX', 'renderUsers("User added", "success")')
|
||||
});
|
||||
</script>
|
||||
<div class="row" style="display:none">
|
||||
|
||||
Reference in New Issue
Block a user