mirror of
https://github.com/hkalexling/Mango.git
synced 2026-04-04 00:00:51 -04:00
-
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<div id="alert"></div>
|
||||
<table class="uk-table uk-table-divider">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -27,8 +28,24 @@
|
||||
|
||||
<% content_for "script" do %>
|
||||
<script>
|
||||
function remove(username) {
|
||||
alert(username);
|
||||
}
|
||||
function alert(level, text) {
|
||||
hideAlert();
|
||||
var html = '<div class="uk-alert-' + level + '" uk-alert><a class="uk-alert-close" uk-close></a><p>' + text + '</p></div>';
|
||||
$('#alert').append(html);
|
||||
}
|
||||
function hideAlert() {
|
||||
$('#alert').empty();
|
||||
}
|
||||
function remove(username) {
|
||||
$.post('/api/admin/user/delete/' + username, function(data) {
|
||||
if (data.success) {
|
||||
location.reload();
|
||||
}
|
||||
else {
|
||||
error = data.error;
|
||||
alert('danger', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user