Organisation admins can now promote/demote members/admins
This commit is contained in:
@@ -12,6 +12,56 @@
|
||||
function bindMemberButtons(el, options) {
|
||||
if (!options) options = {};
|
||||
|
||||
// Remove user button
|
||||
el.find('.js-member-promote').click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$("body").ufModal({
|
||||
sourceUrl: site.uri.public + '/modals/organisations/o/' + $(this).data('slug') + '/members/confirm-promote',
|
||||
ajaxParams: {
|
||||
slug: $(this).data('slug'),
|
||||
user_name: $(this).data('user_name')
|
||||
},
|
||||
msgTarget: $("#alerts-page")
|
||||
});
|
||||
|
||||
$("body").on('renderSuccess.ufModal', function() {
|
||||
var modal = $(this).ufModal('getModal');
|
||||
var form = modal.find('.js-form');
|
||||
|
||||
form.ufForm()
|
||||
.on("submitSuccess.ufForm", function() {
|
||||
// Navigate or reload page on success
|
||||
window.location.reload();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Remove user button
|
||||
el.find('.js-member-demote').click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$("body").ufModal({
|
||||
sourceUrl: site.uri.public + '/modals/organisations/o/' + $(this).data('slug') + '/members/confirm-demote',
|
||||
ajaxParams: {
|
||||
slug: $(this).data('slug'),
|
||||
user_name: $(this).data('user_name')
|
||||
},
|
||||
msgTarget: $("#alerts-page")
|
||||
});
|
||||
|
||||
$("body").on('renderSuccess.ufModal', function() {
|
||||
var modal = $(this).ufModal('getModal');
|
||||
var form = modal.find('.js-form');
|
||||
|
||||
form.ufForm()
|
||||
.on("submitSuccess.ufForm", function() {
|
||||
// Navigate or reload page on success
|
||||
window.location.reload();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Remove user button
|
||||
el.find('.js-member-remove').click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user