26 lines
1.3 KiB
Twig
26 lines
1.3 KiB
Twig
{#
|
|
The car park. See board/plan/_desk.html.twig for how geometry and Resource.svgElementId
|
|
relate; found by convention from ResourceType::PARKING->value.
|
|
#}
|
|
{% import 'board/plan/_spot.html.twig' as plan %}
|
|
|
|
{% set geometry = {
|
|
'parking-01': { x: 40, y: 60 }, 'parking-02': { x: 40, y: 130 }, 'parking-03': { x: 40, y: 200 },
|
|
'parking-04': { x: 280, y: 60 }, 'parking-05': { x: 280, y: 130 }, 'parking-06': { x: 280, y: 200 }
|
|
} %}
|
|
{% set time_params = selected_time.allDay ? {} : { von: selected_time.start, bis: selected_time.end } %}
|
|
|
|
<svg viewBox="0 0 520 300" class="w-full h-auto" role="img" aria-label="Parkplatz">
|
|
<rect x="10" y="20" width="500" height="260" rx="8" class="fill-white stroke-gray-300" stroke-width="2"></rect>
|
|
<text x="20" y="14" class="fill-gray-400 text-xs font-semibold">Parkplatz</text>
|
|
{# The lane between the two rows. #}
|
|
<line x1="265" y1="40" x2="265" y2="260" class="stroke-gray-200" stroke-width="2" stroke-dasharray="6 6"></line>
|
|
|
|
{% for resource in resources %}
|
|
{% if resource.svgElementId and geometry[resource.svgElementId] is defined %}
|
|
{{ plan.spot(resource, geometry[resource.svgElementId], 200, 55,
|
|
bookings_by_resource[resource.id]|default([]), selected_date, is_past, time_params) }}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</svg>
|