Files
myep-team/templates/admin/assignment/detail.html.twig
T

184 lines
9.5 KiB
Twig

{% extends 'admin/layout.html.twig' %}
{% block title %}Einsatzübersicht{% endblock %}
{% block content %}
<h1 class="text-2xl font-bold pb-8">
Einsatzübersicht
</h1>
<div class="pb-8">
{% include '_partials/_assignment_info_compact.html.twig' %}
</div>
<div class="col-span-2">
<h2 class="font-bold text-lg pb-4">
Bewerbungen
</h2>
<div class="data-table-wrapper w-full">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th class="w-1/4">
Name
</th>
<th class="w-1/4">
Zustieg
</th>
<th>
Wünsche
</th>
<th>
Status
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for application in applications %}
<tr>
<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_teamer_info', { 'uuid': application.teamer.uuid })
}) }}>
<span>{{ application.teamer }}</span>
{{ icon('info', 'w-4 h-4') }}
</button>
{% include '_partials/_rating_stars.html.twig' with { 'teamer': application.teamer } %}
</td>
<td>
{{ application.pickup|bpn_pickup_label|default('-') }}
</td>
<td>
{{ application.requests|nl2br|default('-') }}
</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="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 })
}) }}>
{{ 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 })
}) }}>
{{ 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 })
}) }}>
{{ icon('delete') }}
</button>
{% endif %}
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">
Es liegen keine Bewerbungen vor...
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<h2 class="font-bold text-lg pb-4">
Einteilungen
</h2>
<div class="data-table-wrapper w-full">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th class="w-1/4">
Name
</th>
<th class="w-1/4">
Anmerkungen
</th>
<th>
Status
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for disposition in dispositions %}
<tr>
<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 })
}) }}>
<span>{{ disposition.teamer }}</span>
{{ icon('info', 'w-4 h-4') }}
</button>
{% include '_partials/_rating_stars.html.twig' with { 'teamer': disposition.teamer } %}
</td>
<td>
{{ disposition.remarks|nl2br|default('-') }}
</td>
<td>
{{ ('label.disposition.status.' ~ disposition.status)|trans }}
</td>
<td>
<div class="flex items-center justify-end space-x-2">
{% 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 })
}) }}>
{{ icon('delete') }}
</button>
{% endif %}
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">
Es gibt noch keine Einteilungen...
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<a href="{{ returnUrl }}" class="btn">
zurück
</a>
</div>
{% endblock %}