feat: integrate with htmx
This commit is contained in:
@@ -10,52 +10,46 @@
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
<div {{ stimulus_controller('form-partial', { 'url': path('app_admin_assignment_pickup_form') }) }}>
|
||||
{{ form_start(form, { 'attr': { 'data-form-partial-target': 'form' } }) }}
|
||||
<div class="flex flex-col space-y-4 pb-8">
|
||||
<div class="grid lg:grid-cols-6 gap-x-4 gap-y-4">
|
||||
<div class="lg:col-span-3">
|
||||
{{ form_row(form.destination) }}
|
||||
</div>
|
||||
{{ form_row(form.status) }}
|
||||
{{ form_row(form.availableDispositions) }}
|
||||
<div>
|
||||
<h4 class="font-bold pb-2">
|
||||
{{ form_label(form.showAvailableDispositions) }}
|
||||
</h4>
|
||||
{{ form_widget(form.showAvailableDispositions) }}
|
||||
</div>
|
||||
{{ form_start(form) }}
|
||||
<div class="flex flex-col space-y-4 pb-8">
|
||||
<div class="grid lg:grid-cols-6 gap-x-4 gap-y-4">
|
||||
<div class="lg:col-span-3">
|
||||
{{ form_row(form.destination) }}
|
||||
</div>
|
||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
||||
{{ form_row(form.jobProfile) }}
|
||||
{{ form_row(form.jobProfileInfo) }}
|
||||
{{ form_row(form.benefits) }}
|
||||
{{ form_row(form.contact) }}
|
||||
</div>
|
||||
<div class="relative">
|
||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4" {{ stimulus_target('form-partial', 'container') }}>
|
||||
{% block partial_form %}
|
||||
{{ form_row(form.pickup) }}
|
||||
{#{{ form_row(form.pickupDate) }}#}
|
||||
{% endblock %}
|
||||
</div>
|
||||
<div class="absolute top-0 left-0 inset-0 bg-white/90 flex items-center justify-center" {{ stimulus_target('form-partial', 'spinner') }}>
|
||||
{% include '_partials/_spinner.html.twig' with { 'class': 'w-8 h-8'} %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
||||
{{ form_row(form.fees) }}
|
||||
{{ form_row(form.remarks) }}
|
||||
{{ form_row(form.status) }}
|
||||
{{ form_row(form.availableDispositions) }}
|
||||
<div>
|
||||
<h4 class="font-bold pb-2">
|
||||
{{ form_label(form.showAvailableDispositions) }}
|
||||
</h4>
|
||||
{{ form_widget(form.showAvailableDispositions) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center space-x-2">
|
||||
<button type="submit" class="btn">
|
||||
Speichern
|
||||
</button>
|
||||
<a href="{{ path('app_admin_assignment_index') }}" class="btn btn--secondary">
|
||||
Abbrechen
|
||||
</a>
|
||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
||||
{{ form_row(form.jobProfile) }}
|
||||
{{ form_row(form.jobProfileInfo) }}
|
||||
{{ form_row(form.benefits) }}
|
||||
{{ form_row(form.contact) }}
|
||||
</div>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
<div class="relative">
|
||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4" id="pickup-form">
|
||||
{% block partial_form %}
|
||||
{{ form_row(form.pickup) }}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid lg:grid-cols-2 gap-x-8 gap-y-4">
|
||||
{{ form_row(form.fees) }}
|
||||
{{ form_row(form.remarks) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center space-x-2">
|
||||
<button type="submit" class="btn">
|
||||
Speichern
|
||||
</button>
|
||||
<a href="{{ path('app_admin_assignment_index') }}" class="btn btn--secondary">
|
||||
Abbrechen
|
||||
</a>
|
||||
</div>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
@@ -39,11 +39,10 @@
|
||||
<td>
|
||||
<button type="button"
|
||||
class="flex items-center space-x-1"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Teamer:inneninfo ' ~ application.teamer,
|
||||
'url': path('app_admin_application_info', { 'uuid': application.uuid })
|
||||
}) }}>
|
||||
title="Teamer:inneninfo {{ application.teamer }}"
|
||||
hx-get="{{ path('app_admin_application_info', { 'uuid': application.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
<span>{{ application.teamer }}</span>
|
||||
{{ icon('info', 'w-4 h-4') }}
|
||||
</button>
|
||||
@@ -63,34 +62,30 @@
|
||||
{% if is_granted('DISPOSE', application) %}
|
||||
<button type="button"
|
||||
class="text-green-500"
|
||||
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'confirmation', null, {
|
||||
'title': 'Bist du sicher?',
|
||||
'content': 'Möchtest du ' ~ application.teamer ~ ' wirklich einteilen?',
|
||||
'target-url': path('app_admin_application_dispose', { 'uuid': application.uuid })
|
||||
}) }}>
|
||||
title="einteilen"
|
||||
hx-get="{{ path('app_admin_application_dispose', { 'uuid': application.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('check') }}
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if is_granted('STATUS', application) %}
|
||||
<button type="button"
|
||||
class="text-primary"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Bewerbungsstatus bearbeiten',
|
||||
'url': path('app_admin_application_status', { 'uuid': application.uuid })
|
||||
}) }}>
|
||||
title="Bewerbungsstatus bearbeiten"
|
||||
hx-get="{{ path('app_admin_application_status', { 'uuid': application.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('power') }}
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if is_granted('DELETE', application) %}
|
||||
<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 die Bewerbung von ' ~ application.teamer ~ ' wirklich löschen?',
|
||||
'target-url': path('app_admin_application_delete', { 'uuid': application.uuid })
|
||||
}) }}>
|
||||
<button type="button"
|
||||
class="text-red-500"
|
||||
title="Bewerbung löschen"
|
||||
hx-get="{{ path('app_admin_application_delete', { 'uuid': application.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('delete') }}
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -134,11 +129,10 @@
|
||||
<td>
|
||||
<button type="button"
|
||||
class="flex items-center space-x-1"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Teamer:inneninfo ' ~ disposition.teamer,
|
||||
'url': path('app_admin_teamer_info', { 'uuid': disposition.teamer.uuid })
|
||||
}) }}>
|
||||
title="Teamer:inneninfo {{ disposition.teamer }}"
|
||||
hx-get="{{ path('app_admin_teamer_info', { 'uuid': disposition.teamer.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
<span>{{ disposition.teamer }}</span>
|
||||
{{ icon('info', 'w-4 h-4') }}
|
||||
</button>
|
||||
@@ -155,11 +149,10 @@
|
||||
{% if is_granted('DELETE', disposition) %}
|
||||
<button type="button"
|
||||
class="text-red-500"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Einteilung löschen',
|
||||
'url': path('app_admin_disposition_delete', { 'uuid': disposition.uuid })
|
||||
}) }}>
|
||||
title="Einteilung löschen"
|
||||
hx-get="{{ path('app_admin_disposition_delete', { 'uuid': disposition.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('delete') }}
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
@@ -10,19 +10,16 @@
|
||||
<div class="flex flex-col items-end space-y-2 md:flex-row md:items-center md:space-x-2 md:space-y-0">
|
||||
<button type="button"
|
||||
class="{{ html_classes('btn btn--small', { 'btn--secondary': filterDto.active }) }}"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Einsätze filtern',
|
||||
'url': path('app_common_assignment_filter', { 'r': return_url() })
|
||||
}) }}>
|
||||
<div class="flex items-center space-x-1">
|
||||
title="Filter"
|
||||
hx-get="{{ path('app_common_assignment_filter', { 'r': return_url() }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('filter', 'w-4 h-4 shrink-0') }}
|
||||
{% if filterDto.active %}
|
||||
<span class="whitespace-nowrap">{{ filterDto.activeFiltersCount }} Filter aktiv</span>
|
||||
{% else %}
|
||||
<span>Filter</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</button>
|
||||
{% if filterDto.active %}
|
||||
<a href="{{ path('app_common_assignment_filter_reset', { 'r': return_url() }) }}" class="btn btn--small btn--secondary">
|
||||
@@ -109,12 +106,9 @@
|
||||
<div class="flex items-center space-x-1 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 den Einsatz wirklich löschen?',
|
||||
'target-url': path('app_admin_assignment_delete', { 'uuid': assignment.uuid })
|
||||
}) }}>
|
||||
hx-get="{{ path('app_admin_assignment_delete', { 'uuid': assignment.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('delete') }}
|
||||
</button>
|
||||
<a href="{{ path('app_admin_assignment_duplicate', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends 'htmx_confirmation_modal.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
Möchtest du den Einsatz <em>{{ assignment.destination.product }}</em> wirklich löschen?
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user