Organisation registration process implemented with configurable approval workflow

This commit is contained in:
2022-02-10 13:00:51 +00:00
parent fade1f8441
commit b64b4d72f9
23 changed files with 1453 additions and 7 deletions

View File

@@ -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();
});
};