mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-31 03:40:16 +01:00
Finished the invite removal button changes.
This commit is contained in:
@@ -31,12 +31,25 @@ define('admin/manage/registration', function() {
|
||||
var action = $(this).attr('data-action');
|
||||
var method = 'admin.user.deleteInvitation';
|
||||
|
||||
var removeRow = function () {
|
||||
var nextRow = parent.next(),
|
||||
thisRowinvitedBy = parent.find('.invited-by'),
|
||||
nextRowInvitedBy = nextRow.find('.invited-by');
|
||||
if (nextRowInvitedBy.html() !== undefined && nextRowInvitedBy.html().length < 2) {
|
||||
nextRowInvitedBy.html(thisRowinvitedBy.html());
|
||||
}
|
||||
parent.remove();
|
||||
};
|
||||
if (action === 'delete') {
|
||||
socket.emit(method, {email: email, invitedBy: invitedBy}, function(err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
bootbox.confirm('Are you sure you wish to delete this invitation?', function(confirm) {
|
||||
if (confirm) {
|
||||
socket.emit(method, {email: email, invitedBy: invitedBy}, function(err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
removeRow();
|
||||
});
|
||||
}
|
||||
parent.remove();
|
||||
});
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
<!-- BEGIN invites.invitations -->
|
||||
<tr data-invitation-mail="{invites.invitations.email}"
|
||||
data-invited-by="{invites.username}">
|
||||
<td><!-- IF @first -->{invites.username}<!-- ENDIF @first --></td>
|
||||
<td class ="invited-by"><!-- IF @first -->{invites.username}<!-- ENDIF @first --></td>
|
||||
<td>{invites.invitations.email}</td>
|
||||
<td>{invites.invitations.username}
|
||||
<div class="btn-group pull-right">
|
||||
|
||||
Reference in New Issue
Block a user