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

+2 -2
View File
@@ -34,10 +34,10 @@
</div>
<div class="flex justify-between items-center pt-8">
<a href="{{ path(route) }}" class="text-sm text-gray-600 underline hover:text-gray-900">
<a href="{{ path(route) }}" class="text-sm text-brand underline hover:text-brand-dark">
auf Standard zurücksetzen
</a>
<button type="submit" class="button button--primary button--small">
<button type="submit" class="btn-primary">
anwenden
</button>
</div>
@@ -0,0 +1,12 @@
{#
A notice in the style of the apps template's Alert.tsx: `type` is success, error, warning or
info, `message` the text. Errors are announced at once (role="alert"), the others politely.
#}
{% set styles = {
success: ['border-emerald-700 bg-emerald-50 text-emerald-950', 'Erledigt'],
error: ['border-red-700 bg-red-50 text-red-950', 'Fehler'],
warning: ['border-amber-600 bg-amber-50 text-amber-950', 'Achtung'],
info: ['border-brand bg-brand-light text-ink', 'Hinweis'],
} %}
{% set style = styles[type ?? 'info'] %}
<div role="{{ type == 'error' ? 'alert' : 'status' }}" class="notice {{ style[0] }}"><span class="sr-only">{{ style[1] }}: </span>{{ message }}</div>
@@ -0,0 +1,23 @@
{#
E&P header as in the apps template: logo, app name behind a thin line, a deep blue bar below.
Embed it and fill its blocks:
- `header_nav`: the main views as `.header-tab` links, for apps with few views (layout_tabs)
- `header_end`: season, user menu, help link and, in the sidebar layout, the menu button
`app_name` and `home_path` come from the embedding template; `header_width` lines the header up with
a centred content column (layout_sidebar), without it the header runs full width (layout_tabs).
#}
<header class="shrink-0 print:hidden">
<div class="border-b border-line bg-white">
<div class="flex items-stretch gap-x-6 text-sm {{ header_width ?? 'px-4' }}">
<a href="{{ home_path }}" class="flex shrink-0 items-center gap-3 py-2">
<img src="{{ asset('build/images/ep-logo.svg') }}" alt="E&P Reisen & Events" width="157" height="48" class="h-9 w-auto">
<span class="pl-3 border-l border-line font-black uppercase tracking-wide text-brand">{{ app_name }}</span>
</a>
{% block header_nav %}{% endblock %}
<div class="ml-auto flex items-stretch gap-x-4">
{% block header_end %}{% endblock %}
</div>
</div>
</div>
<div class="h-2 bg-brand" aria-hidden="true"></div>
</header>
@@ -0,0 +1,63 @@
{#
KnpMenu template for the admin sidebar (layout_admin.html.twig). Items of the first level:
- a link (`.sidebar-link`); with children, they show below it while it or a child is current
- without a URI but with children: a group that opens in place (<details>), open while a child is current
- extras `heading` (a group heading) or `divider` (a line)
- extras `icon`: rendered with _partials/_icon.html.twig (`icon`, `class`), as myep's icon() does
#}
{% extends 'knp_menu.html.twig' %}
{% block list %}
{% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %}
{% if item.level == 0 %}
<ul class="space-y-1">
{{ block('children') }}
</ul>
{% elseif item.uri is empty or matcher.isCurrent(item) or matcher.isAncestor(item) %}
<ul class="mt-1 space-y-1">
{{ block('children') }}
</ul>
{% endif %}
{% endif %}
{% endblock %}
{% block item %}
{% if item.displayed and item.extras.heading is defined %}
<li class="sidebar-heading">{{ item.label }}</li>
{% elseif item.displayed and item.extras.divider is defined %}
<li><hr class="my-4 border-line"></li>
{% elseif item.displayed %}
<li>
{% if item.uri is empty and item.hasChildren and item.displayChildren %}
<details class="sidebar-group" {{ matcher.isAncestor(item) ? 'open' }}>
<summary class="sidebar-link {{ matcher.isAncestor(item) ? 'text-brand' }}">{{ block('label') }}</summary>
{{ block('list') }}
</details>
{% else %}
{{ block('linkElement') }}
{{ block('list') }}
{% endif %}
</li>
{% endif %}
{% endblock %}
{% block linkElement %}
{% import _self as knp_menu %}
{% set is_current = matcher.isCurrent(item) %}
<a href="{{ item.uri }}"
class="{{ item.level == 1 ? 'sidebar-link' : 'sidebar-sublink' }} {{ not is_current and item.level == 1 and matcher.isAncestor(item) ? 'sidebar-link--ancestor' }}"
{% if is_current %}aria-current="page"{% endif %}
{{ knp_menu.attributes(item.linkAttributes) }}>{{ block('label') }}</a>
{% endblock %}
{% block label -%}
{% if item.extras.icon is defined -%}
{{ include('_partials/_icon.html.twig', {
icon: item.extras.icon,
class: 'size-5 shrink-0 ' ~ (matcher.isCurrent(item) or matcher.isAncestor(item) ? 'text-brand' : 'text-muted'),
}) }}
<span class="flex-1">{{ item.label }}</span>
{%- else -%}
{{ item.label }}
{%- endif %}
{%- endblock %}