Refine shared header language selector

This commit is contained in:
2026-09-15 12:34:26 +02:00
parent 50bf79965f
commit 52a48cacb9
8 changed files with 135 additions and 42 deletions
+14 -4
View File
@@ -1,4 +1,14 @@
<nav class="language-switch" aria-label="{{ _('Sprache') }}">
{% set target_language = 'en' if language() == 'de' else 'de' %}
<a class="active" href="{{ language_url(target_language) }}" lang="{{ target_language }}" hreflang="{{ target_language }}" aria-label="{{ _('Zu Englisch wechseln') if target_language == 'en' else _('Zu Deutsch wechseln') }}" title="{{ _('Zu Englisch wechseln') if target_language == 'en' else _('Zu Deutsch wechseln') }}">{{ '🇬🇧' if target_language == 'en' else '🇩🇪' }}</a>
</nav>
<details class="language-switch">
<summary aria-label="{{ _('Sprache wechseln') }}: {{ language() | upper }}">
<span aria-hidden="true">🌐</span> <span>{{ language() | upper }}</span> <span class="language-caret" aria-hidden="true"></span>
</summary>
<nav class="language-panel" aria-label="{{ _('Sprache') }}">
<p class="language-heading"><span aria-hidden="true">🌐</span> {{ _('Sprache') }}</p>
{% for code, flag, label in [('de', '🇩🇪', 'Deutsch'), ('en', '🇬🇧', 'English')] %}
<a href="{{ language_url(code) }}" lang="{{ code }}" hreflang="{{ code }}"{% if language() == code %} aria-current="true"{% endif %}>
<span aria-hidden="true">{{ flag }}</span> <span>{{ label }}</span>{% if language() == code %}<span class="language-selected" aria-hidden="true"></span>{% endif %}
</a>
{% endfor %}
</nav>
</details>
<script src="/static/js/header-controls.js" defer></script>
+1 -1
View File
@@ -1,5 +1,5 @@
<details class="user-menu">
<summary>{{ user.display_name }}{% if user.notification_count %} <span class="metal-notification" title="{{ user.notification_count }} {{ _('neue Nachricht(en) oder Anfrage(n)') }}" aria-label="{{ _('Neue Benachrichtigungen') }}">🤘<b>{{ user.notification_count }}</b></span>{% endif %}</summary>
<summary><span aria-hidden="true"></span> <span class="user-menu-name">{{ user.display_name }}</span>{% if user.notification_count %} <span class="metal-notification" title="{{ user.notification_count }} {{ _('neue Nachricht(en) oder Anfrage(n)') }}" aria-label="{{ _('Neue Benachrichtigungen') }}">🤘<b>{{ user.notification_count }}</b></span>{% endif %}</summary>
<div class="user-menu-panel">
<a href="/profile">{{ _('Mein Profil') }}</a>
<a href="/messages">{{ _('Nachrichten') }}{% if user.notification_count %} <span class="metal-notification" title="{{ _('Neue Nachrichten oder Anfragen') }}" aria-label="{{ _('Neue Nachrichten oder Anfragen') }}">🤘<b>{{ user.notification_count }}</b></span>{% endif %}</a>
+1 -1
View File
@@ -19,7 +19,7 @@
>
<style>
.detail-topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.detail-topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.event-type-badge { display: inline-block; margin-bottom: 8px; padding: 4px 9px; border: 1px solid #4b5563; border-radius: 999px; color: #c4b5fd; font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.parent-event-link { color: #c4b5fd; }
.flyer-source { display: block; width: 100%; flex: 0 0 100%; margin: 10px 0 0; color: #a8a29e; font-size: .85rem; text-align: center; }
+19 -8
View File
@@ -21,10 +21,10 @@
<style>
.page-header {
display: flex;
justify-content: space-between;
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
align-items: center;
gap: 20px;
gap: 12px 16px;
margin-bottom: 35px;
}
@@ -54,6 +54,7 @@
}
.header-actions {
grid-column: 1 / -1;
display: flex;
gap: 10px;
align-items: center;
@@ -175,7 +176,7 @@
min-height: 100vh;
}
.page-header { padding: 24px; border: 1px solid #5f1515; border-left: 4px solid #dc2626; border-radius: 14px; background: linear-gradient(110deg, rgba(10,10,10,.9), rgba(69,10,10,.28)); box-shadow: 0 12px 30px rgba(0,0,0,.3); }
.page-header { padding: 16px 20px; border: 1px solid #5f1515; border-left: 4px solid #dc2626; border-radius: 14px; background: linear-gradient(110deg, rgba(10,10,10,.9), rgba(69,10,10,.28)); box-shadow: 0 12px 30px rgba(0,0,0,.3); }
.page-header h1 { font-family: "Nimbus Sans Narrow", Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; letter-spacing: .05em; text-transform: uppercase; text-shadow: 0 2px 18px rgba(185, 28, 28, .45); }
.new-concert-button { background: #991b1b; border: 1px solid #dc2626; }
.new-concert-button:hover { background: #b91c1c; }
@@ -185,13 +186,23 @@
.concert-date { color: #ef4444; }
.concert-card.linked-event { border-left-color: #dc2626; background: #0d0d0d; }
@media (min-width: 1024px) {
.page-header { grid-template-columns: minmax(0, 1fr) auto auto; }
.page-header > .header-controls { grid-column: 3; grid-row: 1; }
.page-header > .header-actions { grid-column: 2; grid-row: 1; }
}
@media (max-width: 600px) {
.page-header {
align-items: flex-start;
flex-direction: column;
padding: 12px;
gap: 10px;
}
.page-header .subtitle { display: none; }
.page-header h1 { font-size: 1.25rem; overflow-wrap: anywhere; }
.page-header .brand-logo { max-width: 100% !important; }
.new-concert-button {
width: 100%;
text-align: center;
@@ -244,6 +255,8 @@
</div>
{% include '_header_controls.html' %}
<div class="header-actions">
<a href="{% if archive %}/{% else %}/events/past{% endif %}" class="admin-button">
@@ -257,8 +270,6 @@
{{ _('+ Veranstaltung hinzufügen') }}
</a>
{% include '_header_controls.html' %}
</div>
</header>