Files
myep-team/templates/teamer/index.html.twig
T

96 lines
4.1 KiB
Twig

{% extends 'teamer/layout.html.twig' %}
{% block title %}Einsatzübersicht{% endblock %}
{% block content %}
<h1 class="text-2xl font-bold pb-8">
Einsatzübersicht
</h1>
{% if errors|length %}
<div class="border border-red-500 rounded-md p-4 text-red-500 mb-8">
<ul>
{% for error in errors %}
<li>
{{ error.message }}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th>
{{ knp_pagination_sortable(pagination, 'Einsatz&shy;zeitraum', 'assignment.dateFrom') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Destination', 'destination.dateFrom') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Bus', 'assignment.pickup') }}
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for assignment in pagination %}
<tr>
<td>
{{ assignment.effectivePeriod.start|date('d.m.Y') }} -
<br>
{{ assignment.effectivePeriod.end|date('d.m.Y') }}
</td>
<td>
{{ assignment.jobProfile.name }}
</td>
<td>
{{ assignment.destination.product }}
<br>
{{ assignment.destination.hotel }}
</td>
<td>
{{ assignment.pickup ? assignment.pickup|bpn_pickup_label|default('-') : '-' }}
<br>
{{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }}
</td>
<td>
{% if assignment.applications|length %}
{% set icon = 'hourglass' %}
{% set class = 'bg-yellow-100 text-yellow-800 hover:bg-yellow-50' %}
{% set url = path('app_teamer_assignment', { 'uuid': assignment.uuid, 'r': return_url() }) %}
{% elseif assignment.dispositions|length %}
{% set icon = 'check' %}
{% set class = 'bg-green-100 text-green-700 hover:bg-green-50' %}
{% set url = path('app_teamer_disposition_detail', { 'uuid': assignment.dispositions[0].uuid }) %}
{% else %}
{% set icon = 'info' %}
{% set class = 'btn--info' %}
{% set url = path('app_teamer_assignment', { 'uuid': assignment.uuid, 'r': return_url() }) %}
{% endif %}
<a href="{{ url }}"
class="btn btn--small {{ class }}">
{{ icon(icon, 'w-4 h-4') }}
</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="6">
Keine Daten...
</td>
</tr>
{% endfor %}
</tbody>
</table>
{{ knp_pagination_render(pagination) }}
</div>
</div>
<a href="{{ path('app_admin_assignment_create') }}" class="btn">
Neu
</a>
{% endblock %}