Organisation registration process implemented with configurable approval workflow
This commit is contained in:
@@ -158,6 +158,31 @@ function bindOrganisationButtons(el, options) {
|
||||
});
|
||||
});
|
||||
|
||||
// Cancel a registration request
|
||||
el.find('.js-organisation-cancelRegistration').click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$("body").ufModal({
|
||||
sourceUrl: site.uri.public + "/modals/organisations/confirm-cancel-registration",
|
||||
ajaxParams: {
|
||||
slug: $(this).data('slug')
|
||||
},
|
||||
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
|
||||
if (options.delete_redirect) window.location.href = options.delete_redirect;
|
||||
else window.location.reload();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Delete organisation button
|
||||
el.find('.js-organisation-delete').click(function(e) {
|
||||
e.preventDefault();
|
||||
@@ -197,3 +222,17 @@ function bindOrganisationCreationButton(el) {
|
||||
attachOrganisationForm();
|
||||
});
|
||||
};
|
||||
|
||||
function bindOrganisationRegistrationButton(el) {
|
||||
// Link create button
|
||||
el.find('.js-organisation-register').click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$("body").ufModal({
|
||||
sourceUrl: site.uri.public + "/modals/organisations/register",
|
||||
msgTarget: $("#alerts-page")
|
||||
});
|
||||
|
||||
attachOrganisationForm();
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user