Files
myep-team/templates/administrative/assignment/timeline.html.twig
T

90 lines
5.0 KiB
Twig

{% extends 'administrative/layout.html.twig' %}
{% block title %}Einsatzübersicht{% endblock %}
{% block content %}
<div class="overflow-scroll max-h-screen border border-gray-300 mb-16">
<table>
<tr class="[&_th]:sticky [&_th]:top-0 [&_th]:z-10">
<th></th>
{% for day in period %}
<th>
{{ day | date('d.m.Y') }}
</th>
{% endfor %}
</tr>
{% for hotelCode, rows in data %}
<tr class="border-t-2 border-gray-700">
<td class="border border-gray-700 bg-gray-200 align-middle font-bold sticky left-0 z-10" rowspan="{{ rows | length }}">
{{ hotelCode }}
</td>
{% for day in period %}
{% if colspan is defined and colspan > 1 %}
{% set colspan = colspan - 1 %}
{% elseif rows[0][day|date('Ymd')] is defined %}
{% set item = rows[0][day|date('Ymd')] %}
{% set colspan = item.numberOfDays %}
<td class="{{ html_classes('border border-gray-700', {
'bg-orange-300': item.type == 'assignment',
'bg-yellow-300': item.type == 'disposition' and item.status != 'confirmed',
'bg-green-300': item.type == 'disposition' and item.status == 'confirmed',
}) }}" colspan="{{ colspan }}">
{% if item.type == 'disposition' %}
<button type="button"
class="flex items-center space-x-1"
title="Teamer:inneninfo {{ item.teamerName }}"
hx-get="{{ path('app_administrative_teamer_info', { 'uuid': item.teamerUuid }) }}"
hx-target="body"
hx-swap="beforeend">
<span>{{ item.teamerName | raw }}</span>
{{ icon('info', 'w-4 h-4') }}
</button>
{{ item.jobProfile }}<br>{{ item.dateRange }}
{% else %}
{{ item.jobProfile }}<br>{{ item.dateRange }}
{% endif %}
</td>
{% else %}
<td class="border border-gray-700"></td>
{% endif %}
{% endfor %}
</tr>
{% for row in rows[1:] %}
<tr>
{% for day in period %}
{% if colspan is defined and colspan > 1 %}
{% set colspan = colspan - 1 %}
{% elseif row[day|date('Ymd')] is defined %}
{% set item = row[day|date('Ymd')] %}
{% set colspan = item.numberOfDays %}
<td class="{{ html_classes('border border-gray-700', {
'bg-orange-300': item.type == 'assignment',
'bg-yellow-300': item.type == 'disposition' and item.status != 'confirmed',
'bg-green-300': item.type == 'disposition' and item.status == 'confirmed',
}) }}" colspan="{{ colspan }}">
{% if item.type == 'disposition' %}
<button type="button"
class="flex items-center space-x-1"
title="Teamer:inneninfo {{ item.teamerName }}"
hx-get="{{ path('app_administrative_teamer_info', { 'uuid': item.teamerUuid }) }}"
hx-target="body"
hx-swap="beforeend">
<span>{{ item.teamerName | raw }}</span>
{{ icon('info', 'w-4 h-4') }}
</button>
{{ item.jobProfile }}<br>{{ item.dateRange }}
{% else %}
{{ item.jobProfile }}<br>{{ item.dateRange }}
{% endif %}
</td>
{% else %}
<td class="border border-gray-700"></td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
{% endfor %}
</table>
</div>
{% endblock %}