feat: integrate with htmx
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{% extends 'htmx_confirmation_modal.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div>Möchtest du die Bewerbung wirklich zurückziehen?</div>
|
||||
{% endblock %}
|
||||
@@ -40,12 +40,9 @@
|
||||
<button type="button"
|
||||
class="btn btn--secondary"
|
||||
title="Bewerbung zurückziehen"
|
||||
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'confirmation', null, {
|
||||
'title': 'Bist du sicher?',
|
||||
'content': 'Möchtest du die Bewerbing wirklich zurückziehen?',
|
||||
'target-url': path('app_teamer_application_withdraw', { 'uuid': application.uuid })
|
||||
}) }}>
|
||||
hx-get="{{ path('app_teamer_application_withdraw', { 'uuid': application.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
Bewerbung zurückziehen
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
@@ -10,19 +10,15 @@
|
||||
<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">
|
||||
{{ 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>
|
||||
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 %}
|
||||
</button>
|
||||
{% if filterDto.active %}
|
||||
<a href="{{ path('app_common_assignment_filter_reset', { 'r': return_url() }) }}" class="btn btn--small btn--secondary">
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<h2 class=" font-bold text-lg pb-2">
|
||||
Durchschnittsnote: {{ feedback.averageRating|format_rating }}
|
||||
</h2>
|
||||
<ul class="divide-y divide-gray-200 pb-4">
|
||||
{% for item in feedback.ratings %}
|
||||
<li class="py-2 first:pt-0 last:pb-0 flex items-start">
|
||||
<span class="flex-1">{{ item.rating }}</span>
|
||||
<strong>Note {{ item.mark }}</strong>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p>
|
||||
abgegeben von {{ feedback.author }} (<a href="mailto:{{ feedback.createdBy }}" class="underline">{{ feedback.createdBy }}</a>)
|
||||
</p>
|
||||
@@ -0,0 +1,20 @@
|
||||
{% extends 'htmx_modal.html.twig' %}
|
||||
|
||||
{% block title %}{{ feedback.destinationName ~ ' ' ~ feedback.assignmentDate|date('m.Y') }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2 class=" font-bold text-lg pb-2">
|
||||
Durchschnittsnote: {{ feedback.averageRating|format_rating }}
|
||||
</h2>
|
||||
<ul class="divide-y divide-gray-200 pb-4">
|
||||
{% for item in feedback.ratings %}
|
||||
<li class="py-2 first:pt-0 last:pb-0 flex items-start">
|
||||
<span class="flex-1">{{ item.rating }}</span>
|
||||
<strong>Note {{ item.mark }}</strong>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p>
|
||||
abgegeben von {{ feedback.author }} (<a href="mailto:{{ feedback.createdBy }}" class="underline">{{ feedback.createdBy }}</a>)
|
||||
</p>
|
||||
{% endblock %}
|
||||
@@ -81,22 +81,21 @@
|
||||
{% for feedback in recentFeedback %}
|
||||
<li class="py-2 first:pt-0 last:pb-0">
|
||||
<button type="button"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': feedback.destinationName ~ ' ' ~ feedback.assignmentDate|date('m.Y'),
|
||||
'url': path('app_teamer_feedback', { 'uuid': feedback.uuid })
|
||||
}) }}>
|
||||
<div class="flex items-center space-x-1">
|
||||
title="Feedback {{ feedback.destinationName ~ ' ' ~ feedback.assignmentDate|date('m.Y') }}"
|
||||
hx-get="{{ path('app_teamer_feedback', { 'uuid': feedback.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
<span class="flex items-center space-x-1">
|
||||
{{ icon('feedback', 'w-4 h-4 shrink-0') }}
|
||||
<div class="flex items-center space-x-1 truncate">
|
||||
<span class="flex items-center space-x-1 truncate">
|
||||
<span class="whitespace-nowrap">{{ feedback.createdAt|date('d.m.y') }}</span>
|
||||
{% include '_partials/_dot.html.twig' %}
|
||||
<span class="whitespace-nowrap">{{ feedback.author }}</span>
|
||||
{% include '_partials/_dot.html.twig' %}
|
||||
<span class="whitespace-nowrap">{{ feedback.averageRating|format_rating }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pl-5">{{ feedback.comment }}</div>
|
||||
</span>
|
||||
</span>
|
||||
<span class="block pl-5">{{ feedback.comment }}</span>
|
||||
</button>
|
||||
</li>
|
||||
{% else %}
|
||||
|
||||
@@ -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 %}
|
||||
@@ -1,25 +0,0 @@
|
||||
{{ form_start(form) }}
|
||||
{% if not form.vars.valid %}
|
||||
<div class="border border-red-500 rounded-md p-4 text-red-500 mb-4">
|
||||
{% include '_partials/_form_errors.html.twig' with { 'form': form } %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="flex flex-col space-y-4 pb-8">
|
||||
{{ form_row(form.type) }}
|
||||
{{ form_row(form.date) }}
|
||||
<div>
|
||||
<label class="block font-bold pb-2">
|
||||
Nachweis hochladen (PDF)
|
||||
</label>
|
||||
{% include '_partials/_upload_collection_form.html.twig' with {
|
||||
'endpoint_upload': path('_uploader_upload_certificate'),
|
||||
'upload_session_params': form.vars.upload_session_params,
|
||||
'accepted_files': 'application/pdf',
|
||||
} %}
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn">
|
||||
Speichern
|
||||
</button>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
@@ -0,0 +1,31 @@
|
||||
{% extends 'htmx_modal.html.twig' %}
|
||||
|
||||
{% block title %}Lizenz hinzufügen{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{{ form_start(form, { 'attr': { 'hx-post': app.request.uri, 'hx-target': '#htmx-modal', 'hx-swap': 'outerHTML' } }) }}
|
||||
{% if not form.vars.valid %}
|
||||
<div class="border border-red-500 rounded-md p-4 text-red-500 mb-4">
|
||||
{% include '_partials/_form_errors.html.twig' with { 'form': form } %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="flex flex-col space-y-4 pb-8">
|
||||
{{ form_row(form.type) }}
|
||||
{{ form_row(form.date) }}
|
||||
<div>
|
||||
<label class="block font-bold pb-2">
|
||||
Nachweis hochladen (PDF)
|
||||
</label>
|
||||
{% include '_partials/_upload_collection_form.html.twig' with {
|
||||
'endpoint_upload': path('_uploader_upload_certificate'),
|
||||
'upload_session_params': form.vars.upload_session_params,
|
||||
'accepted_files': 'application/pdf',
|
||||
} %}
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn">
|
||||
Speichern
|
||||
</button>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends 'htmx_confirmation_modal.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
Möchtest du die Lizenz <em>{{ license.type|license_label }}</em> wirklich löschen?
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -42,12 +42,9 @@
|
||||
<button type="button"
|
||||
class="text-red-500"
|
||||
title="Lizenz löschen"
|
||||
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'confirmation', null, {
|
||||
'title': 'Bist du sicher?',
|
||||
'content': 'Möchtest du die Lizenz wirklich löschen?',
|
||||
'target-url': path('app_teamer_profile_license_delete', { 'uuid': license.uuid })
|
||||
}) }}>
|
||||
hx-get="{{ path('app_teamer_profile_license_delete', { 'uuid': license.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('delete') }}
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -61,11 +58,10 @@
|
||||
</ul>
|
||||
<button type="button"
|
||||
class="btn"
|
||||
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
|
||||
{{ stimulus_action('modal-button', 'ajax', null, {
|
||||
'title': 'Lizenz hinzufügen',
|
||||
'url': path('app_teamer_profile_license_add')
|
||||
}) }}>
|
||||
title="Lizenz hinzufügen"
|
||||
hx-get="{{ path('app_teamer_profile_license_add') }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
Lizenz hinzufügen
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user