Use DeleteConfirmation macro
This commit is contained in:
@@ -53,7 +53,6 @@
|
|||||||
{% if user_can(permissions.DELETE_CCPO_USER) %}
|
{% if user_can(permissions.DELETE_CCPO_USER) %}
|
||||||
{% for user, form in data.items() %}
|
{% for user, form in data.items() %}
|
||||||
{% set modal_id = "disable_ccpo_user_{}".format(user.dod_id) %}
|
{% set modal_id = "disable_ccpo_user_{}".format(user.dod_id) %}
|
||||||
{% set confirmation_text = 'remove' %}
|
|
||||||
{% call Modal(name=modal_id) %}
|
{% call Modal(name=modal_id) %}
|
||||||
{{
|
{{
|
||||||
Alert(
|
Alert(
|
||||||
@@ -62,30 +61,15 @@
|
|||||||
level="warning"
|
level="warning"
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
{{
|
||||||
<delete-confirmation inline-template name="{{ modal_id }}" key="{{ modal_id }}" confirmation-text="{{ confirmation_text }}">
|
DeleteConfirmation(
|
||||||
<div>
|
modal_id=modal_id,
|
||||||
<div class="usa-input">
|
delete_text='Remove Access',
|
||||||
<label for="{{ modal_id }}-deleted-text">
|
delete_action=(url_for('ccpo.remove_access', user_id=user.id)),
|
||||||
<span class="usa-input__help">
|
form=form,
|
||||||
{{ "common.delete_confirm" | translate({"word": confirmation_text.upper()}) }}
|
confirmation_text='remove'
|
||||||
</span>
|
)
|
||||||
</label>
|
}}
|
||||||
<input id="{{ modal_id }}-deleted-text" v-model="deleteText">
|
|
||||||
</div>
|
|
||||||
<div class="action-group">
|
|
||||||
<form method="POST" action="{{ url_for('ccpo.remove_ccpo_access', user_id=user.id)}}">
|
|
||||||
{{ form.csrf_token }}
|
|
||||||
<button class="usa-button button-danger" v-bind:disabled="!valid">
|
|
||||||
{{ 'ccpo.disable_user.remove_button' | translate }}
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
<div class="action-group">
|
|
||||||
<a v-on:click="deleteText = ''; $root.closeModal('{{ modal_id }}')" class="action-group__action icon-link icon-link--default">{{ "common.cancel" | translate }}</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</delete-confirmation>
|
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Reference in New Issue
Block a user