feat: integrate with htmx
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
{{ form_start(form) }}
|
||||
{{ form_start(form, { 'attr': { 'hx-post': app.request.uri, 'hx-target': '#htmx-modal', 'hx-swap': 'outerHTML' } }) }}
|
||||
<div class="flex flex-col space-y-4 pb-8">
|
||||
{{ form_row(form.name) }}
|
||||
{{ form_row(form.nameInternal) }}
|
||||
@@ -39,28 +39,24 @@
|
||||
<div class="flex items-center space-x-2 justify-end">
|
||||
<button type="button"
|
||||
class="text-red-500"
|
||||
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'confirmation', null, {
|
||||
'title': 'Bist du sicher?',
|
||||
'content': 'Möchtest du das Honorar wirklich löschen?',
|
||||
'target-url': path('app_admin_system_fee_delete', { 'id': fee.id })
|
||||
}) }}>
|
||||
title="Honorar löschen"
|
||||
hx-get="{{ path('app_admin_system_fee_delete', { 'id': fee.id }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('delete') }}
|
||||
</button>
|
||||
<button type="button"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Honorar bearbeiten',
|
||||
'url': path('app_admin_system_fee_edit', { 'id': fee.id })
|
||||
}) }}>
|
||||
title="Honorar bearbeiten"
|
||||
hx-get="{{ path('app_admin_system_fee_edit', { 'id': fee.id }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('edit') }}
|
||||
</button>
|
||||
<button type="button"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Honorar duplizieren',
|
||||
'url': path('app_admin_system_fee_duplicate', { 'id': fee.id })
|
||||
}) }}>
|
||||
title="Honorar duplizieren"
|
||||
hx-get="{{ path('app_admin_system_fee_duplicate', { 'id': fee.id }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('copy') }}
|
||||
</button>
|
||||
</div>
|
||||
@@ -79,11 +75,10 @@
|
||||
</div>
|
||||
<button type="button"
|
||||
class="btn"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Honorar hinzufügen',
|
||||
'url': path('app_admin_system_fee_create')
|
||||
}) }}>
|
||||
title="Honorar hinzufügen"
|
||||
hx-get="{{ path('app_admin_system_fee_create') }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
Honorar hinzufügen
|
||||
</button>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends 'htmx_modal.html.twig' %}
|
||||
|
||||
{% block title %}Honorar hinzufügen{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'admin/system/fee/_form.html.twig' %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends 'htmx_confirmation_modal.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
Möchtest du das Honorar <em>{{ fee.name }}</em> wirklich löschen?
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends 'htmx_modal.html.twig' %}
|
||||
|
||||
{% block title %}Honorar duplizieren{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'admin/system/fee/_form.html.twig' %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends 'htmx_modal.html.twig' %}
|
||||
|
||||
{% block title %}Honorar bearbeiten{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'admin/system/fee/_form.html.twig' %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user