mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 17:45:32 -04:00
confirmation modal
This commit is contained in:
@@ -103,9 +103,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if edit_service_data %}
|
{% if edit_service_data %}
|
||||||
<div id="edit-service-form" class="bg-base-lightest padding-3 radius-md margin-bottom-3">
|
<div class="bg-base-lightest padding-3 radius-md margin-bottom-3">
|
||||||
<h3 class="margin-top-0">Edit Service</h3>
|
<h3 class="margin-top-0">Edit Service</h3>
|
||||||
<form method="post" action="{{ url_for('.organization_dashboard', org_id=current_org.id, action='edit-service', service_id=edit_service_data.id) }}">
|
<form id="edit-service-form" method="post" action="{{ url_for('.organization_dashboard', org_id=current_org.id, action='edit-service', service_id=edit_service_data.id) }}">
|
||||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||||
|
|
||||||
<div class="usa-form-group">
|
<div class="usa-form-group">
|
||||||
@@ -135,11 +135,46 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<div class="display-flex flex-gap-1 margin-top-3">
|
<div class="display-flex flex-gap-1 margin-top-3">
|
||||||
<button type="submit" class="usa-button">Save Changes</button>
|
<button type="button" class="usa-button" data-open-modal="confirmEditModal">Save Changes</button>
|
||||||
<a href="{{ url_for('.organization_dashboard', org_id=current_org.id) }}" class="usa-button usa-button--outline">Cancel</a>
|
<a href="{{ url_for('.organization_dashboard', org_id=current_org.id) }}" class="usa-button usa-button--outline">Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="usa-modal"
|
||||||
|
data-module="usa-modal"
|
||||||
|
id="confirmEditModal"
|
||||||
|
aria-hidden="true"
|
||||||
|
role="dialog"
|
||||||
|
aria-modal="true"
|
||||||
|
aria-labelledby="confirmEditModalHeading"
|
||||||
|
aria-describedby="confirmEditModalDesc"
|
||||||
|
>
|
||||||
|
<div class="usa-modal__content">
|
||||||
|
<div class="usa-modal__main">
|
||||||
|
<h2 class="usa-modal__heading font-body-lg" id="confirmEditModalHeading">Are you sure you want to save these changes?</h2>
|
||||||
|
<p id="confirmEditModalDesc">This will update the service name, primary contact, and/or status. If you're changing the status to Live, team members will be notified.</p>
|
||||||
|
<div class="usa-modal__footer">
|
||||||
|
<ul class="usa-button-group">
|
||||||
|
<li class="usa-button-group__item">
|
||||||
|
<button type="button" id="edit-service-confirm-btn" class="usa-button">Confirm changes</button>
|
||||||
|
</li>
|
||||||
|
<li class="usa-button-group__item">
|
||||||
|
<button class="usa-button usa-button--unstyled padding-105 text-center" data-close-modal type="button">
|
||||||
|
No, go back
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button class="usa-button usa-modal__close" aria-label="Close this window" data-close-modal type="button">
|
||||||
|
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img">
|
||||||
|
<use xlink:href="{{ asset_url('img/sprite.svg') }}#close"></use>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="usa-accordion margin-bottom-3">
|
<div class="usa-accordion margin-bottom-3">
|
||||||
@@ -286,6 +321,16 @@
|
|||||||
focusFirstInput(form, 150);
|
focusFirstInput(form, 150);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var confirmEditButton = document.getElementById('edit-service-confirm-btn');
|
||||||
|
if (confirmEditButton) {
|
||||||
|
confirmEditButton.addEventListener('click', function() {
|
||||||
|
var editForm = document.getElementById('edit-service-form');
|
||||||
|
if (editForm) {
|
||||||
|
editForm.submit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
|
|||||||
Reference in New Issue
Block a user