forked from Sylius/Stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete_modal.html.twig
More file actions
24 lines (19 loc) · 1.16 KB
/
delete_modal.html.twig
File metadata and controls
24 lines (19 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{% extends '@SyliusBootstrapAdminUi/shared/components/confirmation_modal.html.twig' %}
{% import '@SyliusBootstrapAdminUi/shared/helper/button.html.twig' as button %}
{% props id = null, path = null, label = 'sylius.ui.delete', icon = 'tabler:trash-x', disabled = false, form_attr = null, type = 'delete', modal_id = null %}
{% if modal_id is null %}
{% set modal_id = 'delete-modal-' ~ id %}
{% endif %}
{% block trigger %}
<div data-bs-toggle="tooltip" data-bs-title="{{ label|trans }}">
{{ button.default({icon: icon, icon_class: 'icon text-danger', icon_only: true, disabled: disabled, attr: 'data-bs-toggle=modal data-bs-target=#' ~ modal_id }) }}
</div>
{% endblock %}
{% block footer %}
<form action="{{ path }}" method="post" {{ form_attr }}>
<input type="hidden" name="_method" value="DELETE">
<input type="hidden" name="_csrf_token" value="{{ csrf_token(id) }}" />
{{ button.default({ text: 'sylius.ui.cancel'|trans, attr: 'data-bs-dismiss=modal' }) }}
{{ button.default({ text: label|trans, type: 'submit', class: 'btn-danger', attr: sylius_test_html_attribute('confirm-button') }) }}
</form>
{% endblock %}