removed admin and delete buttons from template

v1.18.x
Baris Usakli 12 years ago
parent 4207792ffd
commit 6a7a2301ee

@ -18,29 +18,6 @@
}
function updateUserButtons() {
jQuery('.admin-btn').each(function(index, element) {
var adminBtn = $(element);
var uid = getUID(adminBtn);
if (isUserAdmin(adminBtn))
adminBtn.addClass('btn-success');
else
adminBtn.removeClass('btn-success');
if (uid === yourid)
adminBtn.addClass('disabled');
});
jQuery('.delete-btn').each(function(index, element) {
var deleteBtn = $(element);
if (isUserAdmin(deleteBtn))
deleteBtn.addClass('disabled');
else
deleteBtn.show();
});
jQuery('.ban-btn').each(function(index, element) {
var banBtn = $(element);
@ -58,31 +35,6 @@
updateUserButtons();
$('#users-container').on('click', '.admin-btn', function() {
var adminBtn = $(this);
var isAdmin = isUserAdmin(adminBtn);
var parent = adminBtn.parents('.users-box');
var uid = getUID(adminBtn);
if (isAdmin && uid != yourid) {
socket.emit('api:admin.user.removeAdmin', uid);
adminBtn.removeClass('btn-success');
parent.find('.delete-btn').removeClass('disabled');
parent.attr('data-admin', 0);
} else if (uid != yourid) {
bootbox.confirm('Do you really want to make "' + parent.attr('data-username') + '" an admin?', function(confirm) {
if (confirm) {
socket.emit('api:admin.user.makeAdmin', uid);
adminBtn.addClass('btn-success');
parent.find('.delete-btn').addClass('disabled');
parent.attr('data-admin', 1);
}
});
}
return false;
});
$('#users-container').on('click', '.ban-btn', function() {
var banBtn = $(this);
var isAdmin = isUserAdmin(banBtn);

@ -31,12 +31,6 @@
<span id='postcount'>{users.postcount}</span>
<i class='icon-pencil'></i>
</div>
<div>
<a href="#" class="btn btn-default admin-btn">Admin</a>
</div>
<div>
<a href="#" class="btn delete-btn btn-danger">Delete</a>
</div>
<div>
<a href="#" class="btn btn-default ban-btn">Ban</a>
</div>

Loading…
Cancel
Save