feat: adopt E&P corporate design in admin

This commit is contained in:
fromme committed 2026-11-13 11:51:46 +01:00
1 parent 55378b2bbc
commit c660bd68de
36 files changed
+866 -544

No files matched your search

+3 -3
View File
@@ -1,9 +1,9 @@
{% set variant = variant ?? 'primary' %}
{% set cva = html_cva('badge', {
variant: {
primary: 'bg-primary text-white',
success: 'bg-green-500 text-white',
warning: 'bg-red-500 text-white',
primary: 'bg-brand-light text-brand',
success: 'bg-emerald-50 text-emerald-950',
warning: 'bg-amber-100 text-amber-950',
}
}, [], { variant: 'primary' }) %}
<span {{ attributes.defaults({class: cva.apply({variant: variant})}).without('variant') }}>
+23 -28
View File
@@ -1,9 +1,15 @@
{% set weekdays = ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'] %}
<div class="space-y-4 mb-4">
{% set rows = [
{label: 'Preis', key: 'hasPrice', color: 'bg-brand-mid', legend: 'Preiskonfigurationen'},
{label: 'Verpfl.', key: 'hasBoard', color: 'bg-emerald-600', legend: 'Verpflegungsleistungen'},
{label: 'Zusatzl.', key: 'hasAdditional', color: 'bg-amber-500', legend: 'optionale Zusatzleistungen'},
{label: 'n. v.', key: 'isBlocked', color: 'bg-red-700', legend: 'nicht verfügbar'},
] %}
<div class="divide-y divide-line">
{% for month in months %}
{% set totalCols = month.firstDow + (month.days | length) %}
<div>
<div class="text-sm font-semibold mb-1">{{ month.label }}</div>
<div class="px-5 py-4">
<h3 class="mb-2 text-xs font-bold uppercase tracking-wide text-brand">{{ month.label }}</h3>
<div class="overflow-x-auto">
<div class="w-max">
<div class="flex">
@@ -11,11 +17,11 @@
{% for col in 0..(totalCols - 1) %}
{% set dow = col % 7 %}
<div class="w-6 text-center">
<span class="block text-xs leading-none {{ dow >= 5 ? 'text-red-400' : 'text-gray-300' }}">{{ weekdays[dow] }}</span>
<span class="block text-[10px] leading-4 {{ dow >= 5 ? 'font-bold text-red-700' : 'text-muted' }}">{{ weekdays[dow] }}</span>
</div>
{% endfor %}
</div>
<div class="flex mb-0.5">
<div class="mb-1 flex">
<div class="w-20 shrink-0"></div>
{% if month.firstDow > 0 %}
{% for i in 1..month.firstDow %}
@@ -24,20 +30,16 @@
{% endif %}
{% for dayNum, day in month.days %}
<div class="w-6 text-center">
<span class="{{ html_classes('block text-xs leading-none cursor-default', {'font-bold text-secondary': day.isToday, 'text-gray-500': not day.isToday}) }}"
<span class="{{ html_classes('mx-auto block w-5 cursor-default text-xs leading-5', {'bg-brand font-bold text-white': day.isToday, 'text-ink': not day.isToday}) }}"
{% if day.isToday %}title="heute"{% endif %}
{% if day.tooltip %}{{ stimulus_controller('tooltip', {'content': day.tooltip}) }}{% endif %}
>{{ dayNum }}</span>
</div>
{% endfor %}
</div>
{% for row in [
{label: 'Preis', key: 'hasPrice', color: 'bg-blue-500'},
{label: 'Verpfl.', key: 'hasBoard', color: 'bg-green-500'},
{label: 'Zusatzl.', key: 'hasAdditional', color: 'bg-amber-500'},
{label: 'n. v.', key: 'isBlocked', color: 'bg-red-500'},
] %}
<div class="flex items-center mt-0.5">
<div class="w-20 shrink-0 text-xs text-gray-500">{{ row.label }}</div>
{% for row in rows %}
<div class="mt-0.5 flex items-center">
<div class="w-20 shrink-0 text-xs text-muted">{{ row.label }}</div>
{% if month.firstDow > 0 %}
{% for i in 1..month.firstDow %}
<div class="w-6 px-px"><div class="h-3"></div></div>
@@ -45,7 +47,7 @@
{% endif %}
{% for dayNum, day in month.days %}
<div class="w-6 px-px">
<div class="h-3 {{ attribute(day, row.key) ? row.color : 'bg-gray-100' }}"></div>
<div class="h-3 {{ attribute(day, row.key) ? row.color : 'bg-page' }}"></div>
</div>
{% endfor %}
</div>
@@ -55,17 +57,10 @@
</div>
{% endfor %}
</div>
<div class="flex flex-wrap gap-x-6 gap-y-2 mb-4 text-sm text-gray-600">
<div class="flex items-center gap-1.5">
<span class="inline-block w-4 h-3 bg-blue-500"></span> Preiskonfigurationen
</div>
<div class="flex items-center gap-1.5">
<span class="inline-block w-4 h-3 bg-green-500"></span> Verpflegungsleistungen
</div>
<div class="flex items-center gap-1.5">
<span class="inline-block w-4 h-3 bg-amber-500"></span> optionale Zusatzleistungen
</div>
<div class="flex items-center gap-1.5">
<span class="inline-block w-4 h-3 bg-red-500"></span> nicht verfügbar
</div>
<div class="flex flex-wrap gap-x-6 gap-y-2 border-t border-line px-5 py-3 text-xs text-muted">
{% for row in rows %}
<div class="flex items-center gap-1.5">
<span class="inline-block h-3 w-4 {{ row.color }}" aria-hidden="true"></span> {{ row.legend }}
</div>
{% endfor %}
</div>
+22 -16
View File
@@ -1,17 +1,23 @@
<div id="calendar-wrapper">
<twig:calendar:grid :months="months"/>
<div class="flex items-center justify-between mt-4">
<button class="button button--secondary button--small"
hx-get="{{ path('app_admin_accommodation_calendar', {id: accommodation.id, month: prevMonth}) }}"
hx-target="#calendar-wrapper"
hx-swap="outerHTML">
← {{ prevLabel }}
</button>
<button class="button button--secondary button--small"
hx-get="{{ path('app_admin_accommodation_calendar', {id: accommodation.id, month: nextMonth}) }}"
hx-target="#calendar-wrapper"
hx-swap="outerHTML">
{{ nextLabel }} →
</button>
{#- The card is the swap target, so the month navigation replaces the whole calendar -#}
<section id="calendar-wrapper" class="card" aria-labelledby="calendar-title">
<div class="flex flex-wrap items-center justify-between gap-4 border-b border-line px-5 py-3">
<h2 id="calendar-title" class="section-title">Kalender</h2>
<div class="flex gap-2">
<button type="button"
class="btn-tool"
hx-get="{{ path('app_admin_accommodation_calendar', {id: accommodation.id, month: prevMonth}) }}"
hx-target="#calendar-wrapper"
hx-swap="outerHTML">
← {{ prevLabel }}
</button>
<button type="button"
class="btn-tool"
hx-get="{{ path('app_admin_accommodation_calendar', {id: accommodation.id, month: nextMonth}) }}"
hx-target="#calendar-wrapper"
hx-swap="outerHTML">
{{ nextLabel }} →
</button>
</div>
</div>
</div>
<twig:calendar:grid :months="months"/>
</section>
@@ -1,15 +1,15 @@
{% set emptyText = emptyText ?? 'Keine Einträge vorhanden.' %}
{% set entries %}{% block content %}{% endblock %}{% endset %}
<div {{ attributes.defaults({class: 'bg-gray-100 border border-gray-200 rounded-md px-4 py-2'}).without('title', 'emptyText') }}>
<h2 class="flex justify-between pb-2">
<span class="font-bold text-lg">{{ title }}</span>
<div {{ attributes.defaults({class: 'card px-5 py-4'}).without('title', 'emptyText') }}>
<div class="flex justify-between pb-3">
<h2 class="section-title">{{ title }}</h2>
{% block actions %}{% endblock %}
</h2>
</div>
{% if entries|trim is empty %}
{% block empty %}
<p class="py-2 text-sm text-gray-500">{{ emptyText }}</p>
<p class="py-2 text-sm text-muted">{{ emptyText }}</p>
{% endblock %}
{% else %}
<ul class="divide-y divide-gray-200">{{ entries }}</ul>
<ul class="divide-y divide-line">{{ entries }}</ul>
{% endif %}
</div>
@@ -1,12 +1,9 @@
{% set warning = warning ?? false %}
{% set method = method ?? 'get' %}
<button type="button"
class="{{ html_classes('block px-4 py-2 text-sm w-full text-left', {
'text-red-500 hover:text-primary': warning,
'text-gray-700 hover:text-primary': not warning
}) }}"
class="{{ warning ? 'menu-item-danger' : 'menu-item' }}"
role="menuitem"
tabindex="-1"
{{ stimulus_action('menu', 'choose') }}
{{ attributes
.defaults({
'hx-target': 'body',
+11 -16
View File
@@ -1,20 +1,15 @@
<div class="relative inline-block text-left group cursor-pointer">
{#- The "⋯" menu of a row or card (menu_controller.js); fill it with dropdown:link and dropdown:hxbutton -#}
<div class="relative inline-block text-left" {{ stimulus_controller('menu') }}>
<button type="button"
class="flex items-center text-gray-400 hover:text-gray-600 focus:outline-hidden focus:ring-0"
aria-expanded="true"
aria-haspopup="true">
<span class="sr-only">Funktionen</span>
{{ icon('dots', 'w-6 h-6') }}
class="btn-more"
aria-haspopup="menu"
aria-expanded="false"
aria-label="Funktionen"
{{ stimulus_target('menu', 'button') }}
{{ stimulus_action('menu', 'toggle') }}>
{{ icon('dots', 'size-5') }}
</button>
<div class="hidden group-hover:block absolute right-0 top-0 z-10 w-56 origin-top-right pt-4"
role="menu"
aria-orientation="vertical"
aria-labelledby="menu-button"
tabindex="-1">
<div class="rounded-md bg-white shadow-lg ring-1 ring-black/5 focus:outline-hidden">
<div class="py-1 menu menu--pulldown" role="none">
{% block content %}{% endblock %}
</div>
</div>
<div class="menu-panel" role="menu" hidden {{ stimulus_target('menu', 'panel') }}>
{% block content %}{% endblock %}
</div>
</div>
+2 -5
View File
@@ -1,10 +1,7 @@
{% set warning = warning ?? false %}
<a href="{{ url }}"
class="{{ html_classes('block px-4 py-2 text-sm w-full', {
'text-red-500 hover:text-primary': warning,
'text-gray-700 hover:text-primary': not warning
}) }}"
class="{{ warning ? 'menu-item-danger' : 'menu-item' }}"
role="menuitem"
tabindex="-1">
{{ stimulus_action('menu', 'choose') }}>
{{ block('content') }}
</a>
+6 -6
View File
@@ -1,11 +1,11 @@
{#- A titled panel grouping the fields of a long admin form. No overflow-hidden: the dots
dropdowns inside must be able to open past its edge. -#}
<div {{ attributes.defaults({class: 'bg-white border border-gray-200 rounded-md'}).without('title') }}>
<div class="flex items-center justify-between gap-4 px-4 py-2 bg-gray-100 border-b border-gray-200 rounded-t-md font-bold">
{{ title }}
{#- A titled card grouping the fields of a long admin form. No overflow-hidden: the "⋯" menus
inside must be able to open past its edge. -#}
<div {{ attributes.defaults({class: 'card'}).without('title') }}>
<div class="flex items-center justify-between gap-4 border-b border-line px-5 py-3">
<h2 class="section-title">{{ title }}</h2>
{% block actions %}{% endblock %}
</div>
<div class="p-4">
<div class="p-5">
{% block content %}{% endblock %}
</div>
</div>
+1 -1
View File
@@ -1 +1 @@
<h1 class="text-2xl font-bold pb-8">{{ block('content') }}</h1>
<h1 class="pb-6 text-2xl font-bold text-brand">{{ block('content') }}</h1>