WIP: Implement application handling

This commit is contained in:
Björn Fromme
2023-10-11 15:43:33 +02:00
parent b472dab6c8
commit 79e4fe0f33
7 changed files with 193 additions and 29 deletions
+91 -18
View File
@@ -6,27 +6,100 @@
<h1 class="text-2xl font-bold pb-8">
Einsatzübersicht
</h1>
<div class="grid grid-cols-2 gap-8 items-start">
<div class="grid grid-cols-3 gap-8 items-start">
<div class="bg-gray-100 rounded-md p-4">
{% include '_partials/_assignment_info.html.twig' %}
</div>
<div>
{% for application in applications %}
<a href="{{ path('app_admin_teamer_profile', { 'uuid': application.teamer.uuid, 'r': return_url() }) }}">
{{ application.teamer }}
</a>
{{ application.requests }}
<button type="button"
class="btn"
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
{{ stimulus_action('modal-button', 'confirmation', null, {
'title': 'Bist du sicher?',
'content': 'Möchtest du den Teamer ' ~ application.teamer ~ ' wirklich einteilen?',
'target-url': path('app_admin_disposition_create', { 'uuid': application.uuid })
}) }}>
einteilen
</button>
{% endfor %}
<div class="col-span-2">
<h2 class="font-bold text-lg">
Bewerbungen
</h2>
<div class="data-table-wrapper w-full">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th>
Name
</th>
<th>
Anmerkungen
</th>
<th>
Status
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for application in applications %}
<tr>
<td>
<a href="{{ path('app_admin_teamer_profile', { 'uuid': application.teamer.uuid, 'r': return_url() }) }}">
{{ application.teamer }}
</a>
</td>
<td>
{{ application.requests|nl2br }}
</td>
<td>
{{ ('label.application.status.' ~ application.status)|trans }}
</td>
<td>
<div class="flex items-center justify-end space-x-2">
{% if is_granted('DISPOSE', application) %}
<button type="button"
class="btn"
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
{{ stimulus_action('modal-button', 'confirmation', null, {
'title': 'Bist du sicher?',
'content': 'Möchtest du den Teamer ' ~ application.teamer ~ ' wirklich einteilen?',
'target-url': path('app_admin_application_dispose', { 'uuid': application.uuid })
}) }}>
einteilen
</button>
{% endif %}
{% if is_granted('REJECT', application) %}
<button type="button" class="btn btn--secondary"
{{ 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 ablehnen?',
'target-url': path('app_admin_application_reject', { 'uuid': application.uuid })
}) }}>
ablehnen
</button>
{% endif %}
{% if is_granted('DELETE', application) %}
<button type="button" class="btn btn--secondary"
{{ 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 })
}) }}>
löschen
</button>
{% endif %}
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="3">
<div class="text-center">
Bisher liegen keine Bewerbungen vor
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<a href="{{ returnUrl }}" class="underline">
zurück
</a>
</div>
</div>
{% endblock %}
+3 -3
View File
@@ -57,14 +57,14 @@
{{ assignment.pickupDate ? assignment.pickupDate|date('d.m.Y') : '' }}
</td>
<td>
{{ assignment.applications|length }}
{{ assignment.applications|length }}/{{ assignment.availableDispositions }}
</td>
<td>
<div class="flex items-center space-x-1 justify-end">
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid }) }}">
<a href="{{ path('app_admin_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
{{ icon('info', 'w-5 h-5') }}
</a>
<a href="{{ path('app_admin_assignment_edit', { 'uuid': assignment.uuid}) }}">
<a href="{{ path('app_admin_assignment_edit', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
{{ icon('edit', 'w-5 h-5') }}
</a>
</div>