feat: group resources into rooms on the floor plan

This commit is contained in:
fromme committed 2026-09-14 08:25:05 +02:00
1 parent faef4d70a8
commit 8caf618950
14 files changed
+653 -34

No files matched your search

+21
View File
@@ -15,8 +15,29 @@
Clicking always opens a modal: the create modal when anything is still free, the edit modal
when it is yours (which is where changing the times and releasing live). Nothing else is
clickable, so the SVG carries no confirm dialogs or inline CSRF tokens.
room() lives here for the same reason spot() does: a plan that frames its shapes into rooms
and one that does not must otherwise draw their borders in two places and drift apart.
#}
{#
The frame around one room, captioned with its name and how many of its spots are still free
for the whole of the board's span.
The caption sits above the rect rather than inside it, so it never collides with a spot box,
and the geometry only has to say where the room is.
#}
{% macro room(label, geometry, free) %}
<rect x="{{ geometry.x }}" y="{{ geometry.y }}"
width="{{ geometry.width }}" height="{{ geometry.height }}" rx="8"
class="fill-white stroke-gray-300" stroke-width="2"></rect>
<text x="{{ geometry.x + 10 }}" y="{{ geometry.y - 6 }}" class="fill-gray-400 text-xs font-semibold">
{{- label -}}
{%- if free > 0 %} <tspan class="fill-emerald-600">· {{ free }} frei</tspan>
{%- else %} <tspan class="fill-gray-400">· belegt</tspan>{% endif -%}
</text>
{% endmacro %}
{% macro spot(spot, geometry, width, height, selected_date, is_past, time_params) %}
{% set MAX_LINES = 3 %}
{% set state = spot.state.name %}