Move to component
This commit is contained in:
parent
4fe42ceebb
commit
c3e4f2c6fe
25
templates/components/delete_confirmation.html
Normal file
25
templates/components/delete_confirmation.html
Normal file
@ -0,0 +1,25 @@
|
||||
{% macro DeleteConfirmation(modal_id, delete_text, delete_action, form) %}
|
||||
<delete-confirmation inline-template>
|
||||
<div>
|
||||
<div class="usa-input">
|
||||
<label for="deleted-text">
|
||||
<span class="usa-input__help">
|
||||
{{ "common.delete_confirm" | translate }}
|
||||
</span>
|
||||
</label>
|
||||
<input id="deleted-text" v-model="deleteText">
|
||||
</div>
|
||||
<div class="action-group">
|
||||
<form method="POST" action="{{ delete_action }}">
|
||||
{{ form.csrf_token }}
|
||||
<button class="usa-button button-danger" v-bind:disabled="!valid">
|
||||
{{ delete_text }}
|
||||
</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>
|
||||
{% endmacro %}
|
@ -3,6 +3,7 @@
|
||||
{% from "components/text_input.html" import TextInput %}
|
||||
{% from "components/save_button.html" import SaveButton %}
|
||||
{% from "components/modal.html" import Modal %}
|
||||
{% from "components/delete_confirmation.html" import DeleteConfirmation %}
|
||||
|
||||
{% macro RolePanel(users=[], role='no_access') %}
|
||||
{% if role == 'no_access' %}
|
||||
@ -136,29 +137,14 @@
|
||||
)
|
||||
}}
|
||||
|
||||
<delete-confirmation inline-template>
|
||||
<div>
|
||||
<div class="usa-input">
|
||||
<label for="deleted-text">
|
||||
<span class="usa-input__help">
|
||||
{{ "common.delete_confirm" | translate }}
|
||||
</span>
|
||||
</label>
|
||||
<input id="deleted-text" v-model="deleteText">
|
||||
</div>
|
||||
<div class="action-group">
|
||||
<form method="POST" action="{{ url_for('applications.delete_environment', environment_id=env['id']) }}">
|
||||
{{ form.csrf_token }}
|
||||
<button class="usa-button button-danger" v-bind:disabled="!valid">
|
||||
{{ "portfolios.applications.delete.button" | translate }}
|
||||
</button>
|
||||
</form>
|
||||
<div class="action-group">
|
||||
<a v-on:click="deleteText = ''; $root.closeModal({{ delete_modal_environment_id }})" class="action-group__action icon-link icon-link--default">{{ "common.cancel" | translate }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</delete-confirmation>
|
||||
{{
|
||||
DeleteConfirmation(
|
||||
modal_id=delete_modal_environment_id,
|
||||
delete_text=('portfolios.applications.delete.button' | translate),
|
||||
delete_action= url_for('applications.delete_environment', environment_id=env['id']),
|
||||
form=form
|
||||
)
|
||||
}}
|
||||
{% endcall %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
Loading…
x
Reference in New Issue
Block a user