feat: compressed timeline items
This commit is contained in:
@@ -2,6 +2,37 @@
|
||||
|
||||
{% 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 %}
|
||||
<div class="flex items-start justify-between pb-4">
|
||||
<h1 class="text-2xl font-bold">
|
||||
@@ -44,63 +75,13 @@
|
||||
{{ hotelCode }}
|
||||
</td>
|
||||
{% for day in filterDto.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 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 %}
|
||||
{{ _self.cell(rows[0], day) }}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% for row in rows[1:] %}
|
||||
<tr>
|
||||
{% for day in filterDto.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 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 %}
|
||||
{{ _self.cell(row, day) }}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user