feat: integrate with htmx
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
{{ form_start(form) }}
|
||||
<div class="flex flex-col space-y-4 pb-8">
|
||||
{{ form_row(form.dateFrom) }}
|
||||
{{ form_row(form.dateTo) }}
|
||||
{{ form_row(form.description) }}
|
||||
</div>
|
||||
<button type="submit" class="btn">
|
||||
Speichern
|
||||
</button>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
@@ -32,12 +32,9 @@
|
||||
{% if is_granted('DELETE', availability) %}
|
||||
<button type="button"
|
||||
title="Zeitraum entfernen/löschen"
|
||||
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'confirmation', null, {
|
||||
'title': 'Bist du sicher?',
|
||||
'content': 'Möchtest du den Zeitraum wirklich löschen?',
|
||||
'target-url': path('app_teamer_profile_availability_delete', { 'id': availability.id })
|
||||
}) }}>
|
||||
hx-get="{{ path('app_teamer_profile_availability_delete', { 'id': availability.id }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('delete', 'w-5 h-5') }}
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -89,11 +86,10 @@
|
||||
</div>
|
||||
<button type="button"
|
||||
class="btn"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Zeitraum hinzufügen',
|
||||
'url': path('app_teamer_profile_availability_create')
|
||||
}) }}>
|
||||
title="Eigenen Zeitraum hinzufügen"
|
||||
hx-get="{{ path('app_teamer_profile_availability_create') }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
Eigenen Zeitraum hinzufügen
|
||||
</button>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,17 @@
|
||||
{% extends 'htmx_modal.html.twig' %}
|
||||
|
||||
{% block title %}Eigenen Zeitraum hinzufügen{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ 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.dateFrom) }}
|
||||
{{ form_row(form.dateTo) }}
|
||||
{{ form_row(form.description) }}
|
||||
</div>
|
||||
<button type="submit" class="btn">
|
||||
Speichern
|
||||
</button>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,8 @@
|
||||
{% extends 'htmx_confirmation_modal.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
Möchtest du die Verfügbarkeit <em>{{ availability }}{% if availability.description %} ({{ availability.description }}){% endif %}</em>
|
||||
wirklich löschen?
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user