feat: replace the navigation with a dashboard and per-area boards
This commit is contained in:
1 parent
d63df2cc1b
commit
bce8f58be3
26 files changed
+810
-328
No files matched your search
@@ -3,29 +3,78 @@
|
||||
{% block title %}Übersicht · ephub{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Buchen</h1>
|
||||
<p class="subline">Tag und Zeitraum wählen, dann einen freien Platz im Raumplan anklicken.</p>
|
||||
<h1>Übersicht</h1>
|
||||
<p class="subline">{{ today|format_datetime(pattern: 'EEEE, d. MMMM y') }}</p>
|
||||
|
||||
<div class="mt-8 grid gap-8 xl:grid-cols-3">
|
||||
<div class="xl:col-span-1">
|
||||
{#
|
||||
The two blocks below are what DashboardController::day and BookingController
|
||||
swap out of band. Each one owns a stable id and emits hx-swap-oob only when
|
||||
rendered through htmxOobResponse -- rendered normally they are plain markup.
|
||||
#}
|
||||
{% block calendar %}
|
||||
<div id="board-calendar"{% if htmx_oob_swap is defined and htmx_oob_swap %} hx-swap-oob="true"{% endif %}>
|
||||
{% include 'dashboard/_calendar.html.twig' %}
|
||||
{#
|
||||
One tile per ResourceType, generated rather than written out. A new bookable kind appears
|
||||
here -- with a working link and a correct count -- by adding a case to the enum.
|
||||
#}
|
||||
<div class="mt-8 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{% for tile in tiles %}
|
||||
<a href="{{ path('app_board', { type: tile.type.slug }) }}"
|
||||
class="group flex flex-col rounded-md border border-gray-200 p-6 hover:border-primary hover:bg-gray-50">
|
||||
<div class="flex items-center gap-3 pb-2">
|
||||
{{ ux_icon(tile.type.icon, { class: 'h-6 w-6 shrink-0 text-primary' }) }}
|
||||
<span class="text-lg font-bold">{{ tile.type.plural }}</span>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
<div class="xl:col-span-2">
|
||||
{% block floorplan %}
|
||||
<div id="board-floorplan"{% if htmx_oob_swap is defined and htmx_oob_swap %} hx-swap-oob="true"{% endif %}>
|
||||
{% include 'dashboard/_floorplan.html.twig' %}
|
||||
<p class="text-sm text-gray-500 pb-4">{{ tile.type.description }}</p>
|
||||
|
||||
<div class="mt-auto flex items-baseline justify-between">
|
||||
<span class="text-sm">
|
||||
{% if tile.total == 0 %}
|
||||
<span class="text-gray-400">nichts eingerichtet</span>
|
||||
{% elseif tile.free == 0 %}
|
||||
<span class="font-semibold text-red-600">heute alles belegt</span>
|
||||
{% else %}
|
||||
<span class="font-semibold text-emerald-700">{{ tile.free }}</span>
|
||||
<span class="text-gray-500">von {{ tile.total }} heute frei</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% if tile.mine %}
|
||||
<span class="badge bg-primary text-white">{{ tile.mine.resource.label }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
<a href="{{ path('app_booking') }}"
|
||||
class="group flex flex-col rounded-md border border-gray-200 p-6 hover:border-primary hover:bg-gray-50">
|
||||
<div class="flex items-center gap-3 pb-2">
|
||||
{{ ux_icon('lucide:calendar-days', { class: 'h-6 w-6 shrink-0 text-primary' }) }}
|
||||
<span class="text-lg font-bold">Meine Buchungen</span>
|
||||
</div>
|
||||
<p class="text-sm text-gray-500 pb-4">Alle Termine und Serien verwalten.</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<h2 class="pt-10">Als Nächstes</h2>
|
||||
|
||||
{% if upcoming is empty %}
|
||||
<p class="text-sm text-gray-500">Nichts gebucht.</p>
|
||||
{% else %}
|
||||
<ul class="divide-y divide-gray-200 border-y border-gray-200">
|
||||
{% for booking in upcoming %}
|
||||
<li class="flex items-center justify-between gap-4 py-3">
|
||||
<div>
|
||||
<div class="font-semibold">
|
||||
{{ booking.date|format_datetime(pattern: 'EEEE, d. MMMM') }}
|
||||
<span class="font-normal text-gray-500">· {{ booking.timeRange }}</span>
|
||||
</div>
|
||||
<div class="text-sm text-gray-500">
|
||||
{{ booking.resource.type.label }} · {{ booking.resource.label }}
|
||||
{% if booking.partOfSeries %}
|
||||
<span class="badge bg-gray-100 text-gray-600 ml-1">Serie</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<a class="text-sm underline shrink-0"
|
||||
href="{{ path('app_board', { type: booking.resource.type.slug, tag: booking.date|date('Y-m-d') }) }}">
|
||||
Im Plan
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user