style: align with the ep-corporate-design skill
This commit is contained in:
1 parent
50ef662dd3
commit
ebad54e989
162 files changed
+768
-640
No files matched your search
@@ -1,11 +1,16 @@
|
||||
{% set type = type|default('info') %}
|
||||
|
||||
{# light with a coloured left bar, as the notices of the apps portal (EP/apps Alert.tsx) #}
|
||||
<div class="{{ html_classes('p-4 mb-4 flex items-start space-x-2 border-l-4', { 'border-brand bg-brand-light text-ink': type == 'info', 'border-red-700 bg-red-50 text-red-950': type == 'warning', 'border-emerald-700 bg-emerald-50 text-emerald-950': type == 'success' }) }}">
|
||||
{{ icon(type == 'success' ? 'check' : 'alert', 'w-5 h-5 shrink-0') }}
|
||||
<div class="leading-relaxed text-base">
|
||||
{% block message %}
|
||||
{{ message | nl2br }}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{#
|
||||
A notice in the style of the apps template's Alert.tsx (ep-corporate-design): `type` is success,
|
||||
error, warning or info, `message` the text; `embed` it and fill the `message` block for markup.
|
||||
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 mb-4 {{ style[0] }}">
|
||||
<span class="sr-only">{{ style[1] }}: </span>
|
||||
{%- block message %}{{ message|nl2br }}{% endblock -%}
|
||||
</div>
|
||||
@@ -1,5 +1,5 @@
|
||||
{# The E&P logo with the app name beside it, as in the header of the apps portal (EP/apps) and epbms. #}
|
||||
<span class="flex items-center gap-3">
|
||||
<img class="h-9 w-auto" src="{{ asset('build/images/ep-logo.svg') }}" alt="E&P Reisen & Events" width="157" height="48">
|
||||
<span class="pl-3 border-l border-line text-sm font-bold uppercase tracking-wide text-brand">Team</span>
|
||||
<span class="pl-3 border-l border-line text-sm font-black uppercase tracking-wide text-brand">{{ app_name }}</span>
|
||||
</span>
|
||||
@@ -1,5 +1,5 @@
|
||||
{% if app.session.flashBag.peek('error')|length > 0 %}
|
||||
{% include '_partials/_toast.html.twig' with { level: 'warning', messages: app.flashes('error') } %}
|
||||
{% include '_partials/_toast.html.twig' with { level: 'error', messages: app.flashes('error') } %}
|
||||
{% endif %}
|
||||
{% if app.session.flashBag.peek('success')|length > 0 %}
|
||||
{% include '_partials/_toast.html.twig' with { level: 'success', messages: app.flashes('success') } %}
|
||||
|
||||
@@ -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>
|
||||
@@ -1,86 +0,0 @@
|
||||
{% 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 %}
|
||||
<div class="min-h-full flex grow flex-col gap-y-5">
|
||||
<nav class="flex flex-1 flex-col">
|
||||
<ul role="list" class="space-y-1">
|
||||
{{ block('children') }}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
{% else %}
|
||||
<ul class="{{ html_classes('mt-1 px-2', { 'hidden': not matcher.isCurrent(item) }) }}" {{ stimulus_target('sidebar-menu', 'submenu') }}>
|
||||
{{ block('children') }}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block item %}
|
||||
{% if item.displayed and item.extras.heading is defined %}
|
||||
{# the heading of a group of items, see AbstractMenuBuilder::addHeading() #}
|
||||
<li class="px-2 pt-5 pb-1 text-[11px] font-semibold uppercase tracking-wide text-muted">{{ item.label|raw }}</li>
|
||||
{% elseif item.displayed %}
|
||||
<li>
|
||||
{%- if item.hasChildren and item.displayChildren %}
|
||||
<div {{ stimulus_controller('sidebar-menu', {'expanded': matcher.isAncestor(item)}, {'closed': 'hidden', 'iconClosed': 'text-gray-400', 'iconExpanded': 'text-gray-500'}) }}>
|
||||
{%- endif %}
|
||||
{%- if item.uri is not empty %}
|
||||
{{ block('linkElement') }}
|
||||
{%- else %}
|
||||
{{ block('spanElement') }}
|
||||
{%- endif %}
|
||||
{{ block('list') }}
|
||||
{%- if item.hasChildren and item.displayChildren %}
|
||||
</div>
|
||||
{%- endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block linkElement %}
|
||||
{% import _self as knp_menu %}
|
||||
<a href="{{ item.uri }}"
|
||||
class="{{ html_classes('', {
|
||||
'group flex gap-x-3 p-2 text-sm leading-6 font-semibold': item.level == 1,
|
||||
'block py-2 pr-2 pl-9 text-sm leading-6': item.level > 1,
|
||||
'text-ink hover:bg-white/60 hover:text-brand': not (matcher.isCurrent(item) or matcher.isAncestor(item)),
|
||||
'bg-white text-brand': matcher.isCurrent(item) or matcher.isAncestor(item)
|
||||
}) }}"
|
||||
{{ knp_menu.attributes(item.linkAttributes) }}>
|
||||
{{ block('label') }}
|
||||
</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block spanElement %}
|
||||
{% import _self as knp_menu %}
|
||||
{% if item.hasChildren %}
|
||||
<button type="button"
|
||||
{{ stimulus_action('sidebar-menu', 'toggleSubmenu') }}
|
||||
{{ stimulus_target('sidebar-menu', 'button') }}
|
||||
{{ knp_menu.attributes(item.linkAttributes) }}
|
||||
class="{{ html_classes('hover:bg-white/60 hover:text-brand flex items-center w-full text-left p-2 gap-x-3 text-sm leading-6 font-semibold', { 'text-brand': matcher.isAncestor(item), 'text-ink': not matcher.isAncestor(item) }) }}"
|
||||
aria-expanded="false">
|
||||
{{ block('label') }}
|
||||
</button>
|
||||
{% elseif item.extras.divider is defined %}
|
||||
<hr class="my-4 h-px border-line">
|
||||
{% else %}
|
||||
<div class="hover:bg-white/60 group flex gap-x-3 p-2 text-sm leading-5 font-semibold text-ink"
|
||||
role="button">
|
||||
{{ block('label') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block label -%}
|
||||
{% if item.extras.icon is defined -%}
|
||||
{{ icon(item.extras.icon, 'h-5 w-5 shrink-0 ' ~ ((matcher.isCurrent(item) or matcher.isAncestor(item)) ? 'text-brand' : 'text-muted')) -}}
|
||||
<span class="flex-1">{{ item.label|raw }}</span>
|
||||
{%- else -%}
|
||||
{{ item.label|raw }}
|
||||
{%- endif %}
|
||||
{%- endblock %}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<button type="button"
|
||||
class="btn"
|
||||
class="btn-secondary"
|
||||
title="Beleg hinzufügen"
|
||||
hx-get="{{ path('app_teamer_disposition_receipt_upload', { 'uuid': disposition.uuid }) }}"
|
||||
hx-target="body"
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
{# Marks a season assignment listed among dispositions. #}
|
||||
<span class="inline-block py-1 px-2 text-xs bg-primary text-white">Saison</span>
|
||||
<span class="inline-block py-1 px-2 text-xs bg-brand text-white">Saison</span>
|
||||
@@ -0,0 +1,63 @@
|
||||
{#
|
||||
KnpMenu template for the sidebar (layout_sidebar.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 %}
|
||||
@@ -13,8 +13,8 @@
|
||||
{# by route name: the items carry the return url, which the matcher would compare as well #}
|
||||
{% set current = child.extras.routes|default([])|filter(r => r.route is defined and r.route == app.request.attributes.get('_route'))|length > 0 %}
|
||||
<a href="{{ child.uri }}"
|
||||
class="{{ html_classes('tab', { 'tab--current': current }) }}"
|
||||
{% if current %}aria-current="page"{% endif %}>{{ child.label|raw }}</a>
|
||||
class="tab"
|
||||
{% if current %}aria-current="page"{% endif %}>{{ child.label }}</a>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
{% endblock %}
|
||||
@@ -23,13 +23,13 @@
|
||||
role="menu"
|
||||
{{ stimulus_target('toggle', 'toggle') }}>
|
||||
{% if app.user.teamer %}
|
||||
<a href="{{ path('app_teamer_profile_index') }}" class="user-menu-item" role="menuitem">{{ icon('user', 'w-5 h-5 text-muted') }}Mein Profil</a>
|
||||
<a href="{{ path('app_teamer_profile_index') }}" class="menu-item flex items-center gap-x-3" role="menuitem">{{ icon('user', 'w-5 h-5 text-muted') }}Mein Profil</a>
|
||||
{% elseif is_granted('ROLE_ADMINISTRATIVE') %}
|
||||
<a href="{{ path('app_administrative_profile_index') }}" class="user-menu-item" role="menuitem">{{ icon('user', 'w-5 h-5 text-muted') }}Mein Profil</a>
|
||||
<a href="{{ path('app_administrative_profile_index') }}" class="menu-item flex items-center gap-x-3" role="menuitem">{{ icon('user', 'w-5 h-5 text-muted') }}Mein Profil</a>
|
||||
{% endif %}
|
||||
{% for item in user_menu.children %}
|
||||
{% if loop.last %}<hr class="my-1 border-line">{% endif %}
|
||||
<a href="{{ item.uri }}" class="user-menu-item" role="menuitem">{{ icon(item.extras.icon, 'w-5 h-5 text-muted') }}{{ item.label }}</a>
|
||||
<a href="{{ item.uri }}" class="menu-item flex items-center gap-x-3" role="menuitem">{{ icon(item.extras.icon, 'w-5 h-5 text-muted') }}{{ item.label }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user