feat: compressed timeline items
This commit is contained in:
@@ -2,6 +2,37 @@
|
|||||||
|
|
||||||
{% block title %}Timeline{% endblock %}
|
{% block title %}Timeline{% endblock %}
|
||||||
|
|
||||||
|
{% macro cell(row, day) %}
|
||||||
|
{% 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-2"
|
||||||
|
title="Teamer:inneninfo {{ item.teamerName }}"
|
||||||
|
hx-get="{{ path('app_administrative_teamer_info', { 'uuid': item.teamerUuid }) }}"
|
||||||
|
hx-target="body"
|
||||||
|
hx-swap="beforeend">
|
||||||
|
<span class="text-xs font-semibold">{{ item.jobProfile }}</span>
|
||||||
|
<span class="text-xs">{{ item.teamerName | raw }}</span>
|
||||||
|
{{ icon('info', 'w-4 h-4') }}
|
||||||
|
</button>
|
||||||
|
{% else %}
|
||||||
|
<span class="text-xs font-semibold">{{ item.jobProfile }}</span>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
{% else %}
|
||||||
|
<td class="border border-gray-700"></td>
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="flex items-start justify-between pb-4">
|
<div class="flex items-start justify-between pb-4">
|
||||||
<h1 class="text-2xl font-bold">
|
<h1 class="text-2xl font-bold">
|
||||||
@@ -44,63 +75,13 @@
|
|||||||
{{ hotelCode }}
|
{{ hotelCode }}
|
||||||
</td>
|
</td>
|
||||||
{% for day in filterDto.period %}
|
{% for day in filterDto.period %}
|
||||||
{% if colspan is defined and colspan > 1 %}
|
{{ _self.cell(rows[0], day) }}
|
||||||
{% 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 class="text-xs">{{ item.teamerName | raw }}</span>
|
|
||||||
{{ icon('info', 'w-4 h-4') }}
|
|
||||||
</button>
|
|
||||||
{% endif %}
|
|
||||||
<span class="text-xs">{{ item.jobProfile }}</span>
|
|
||||||
</td>
|
|
||||||
{% else %}
|
|
||||||
<td class="border border-gray-700"></td>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
{% for row in rows[1:] %}
|
{% for row in rows[1:] %}
|
||||||
<tr>
|
<tr>
|
||||||
{% for day in filterDto.period %}
|
{% for day in filterDto.period %}
|
||||||
{% if colspan is defined and colspan > 1 %}
|
{{ _self.cell(row, day) }}
|
||||||
{% 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 class="text-xs">{{ item.teamerName | raw }}</span>
|
|
||||||
{{ icon('info', 'w-4 h-4') }}
|
|
||||||
</button>
|
|
||||||
{% endif %}
|
|
||||||
<span class="text-xs">{{ item.jobProfile }}</span>
|
|
||||||
</td>
|
|
||||||
{% else %}
|
|
||||||
<td class="border border-gray-700"></td>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user