{# The plan: heading, legend, span picker, then one section per room with a card per spot. Every ResourceType renders the same way, so a new one needs no template of its own. Colouring needs no JavaScript at all: the plan is re-rendered server side for the selected day and span, so free/taken/yours is decided in Twig. Note "free" is always relative to the span in the header -- a desk booked 09:00-13:00 is free for an afternoon board and taken for an all-day one. #}

{{ selected_date|format_datetime(pattern: 'EEEE, d. MMMM y') }}

frei teilweise frei belegt deine
{% include 'board/_timerange.html.twig' %} {% if is_past %}

Vergangener Tag — hier lässt sich nichts mehr buchen.

{% endif %} {% if resources is empty %}

Für diesen Bereich ist noch nichts eingerichtet.

{% else %} {% import 'board/_spot.html.twig' as plan %} {% set time_params = selected_time.allDay ? {} : { from: selected_time.start, to: selected_time.end } %}
{# Rooms in their configured order, then anything without one. Ungrouped spots get no heading: a kind of resource that is not split across rooms (the car park) has nothing to say there that the page heading has not already said. #} {% for spot_group in spot_groups %}
{% if spot_group.group %} {% set free = spot_group.freeCount %} {# Prominent on purpose: desk labels repeat from room to room, so the room is the only thing telling one "Schreibtisch 1" from the next. #}

{{- spot_group.group.label -}} {%- if free > 0 %} · {{ free }} frei {%- else %} · belegt{% endif -%}

{% endif %}
{% for spot in spot_group.spots %} {{ plan.spot(spot, selected_date, is_past, time_params) }} {% endfor %}
{% endfor %}
{% endif %}