{# The office. Hand-authored geometry: `svgElementId` on each Resource is the key that ties a database row to a shape here, so a resource whose id is missing from the map is simply not drawn (and vice versa) -- app:seed and this map have to agree. Found by convention from ResourceType::DESK->value, see board/_floorplan.html.twig. #} {% import 'board/plan/_spot.html.twig' as plan %} {% set geometry = { 'desk-01': { x: 40, y: 60 }, 'desk-02': { x: 200, y: 60 }, 'desk-03': { x: 360, y: 60 }, 'desk-04': { x: 40, y: 160 }, 'desk-05': { x: 200, y: 160 }, 'desk-06': { x: 360, y: 160 }, 'desk-07': { x: 40, y: 260 }, 'desk-08': { x: 200, y: 260 }, 'desk-09': { x: 360, y: 260 }, 'desk-10': { x: 40, y: 360 }, 'desk-11': { x: 200, y: 360 }, 'desk-12': { x: 360, y: 360 } } %} {% set time_params = selected_time.allDay ? {} : { von: selected_time.start, bis: selected_time.end } %} Büro {% for resource in resources %} {% if resource.svgElementId and geometry[resource.svgElementId] is defined %} {{ plan.spot(resource, geometry[resource.svgElementId], 140, 70, bookings_by_resource[resource.id]|default([]), selected_date, is_past, time_params) }} {% endif %} {% endfor %}