Theme Seebad 0.4.0: menu panels; fix missing chevron icons; render test for all themes
- Menu panels: arrow next to each main menu item opens a panel with the page description (SEO text), jump links to the headed sections and a cartouche with booking and phone; Escape/outside click closes, focus returns; without JavaScript the menu stays plain links - Header: booking button hidden between 1280 and 1535 px (too narrow with the arrows), desktop phone removed - Fix: offers carousel and menu used outline chevron icons that do not exist (500 as soon as offers are shown); now mini chevrons - New test: every installed theme renders all pages with reviews and offers in every display mode - Wish: menu photo per page (ZUSAMMENARBEIT §5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d9e52c4789
commit
d2f53ceb84
7 files changed
+178
-15
No files matched your search
@@ -76,6 +76,7 @@ ## 5. Wünsche der Design-Session an die Anwendung
|
||||
| 23.10.2026 | **Baustein „Gut zu wissen“**: strukturierte Angaben (Zugang/Stufen, Dusche, Rollstuhl, Haustiere, An-/Abreisezeiten, Parken) an der Wohnung; Seebad stellt ihn in der Kartusche dar (DESIGN-KONZEPT §7 Nr. 5) | offen |
|
||||
| 23.10.2026 | **Bildwelt-System** (MANDANTEN-ANFORDERUNGEN A18–A20): Seebad nutzt schon Plätze über `partials/motif` (`mark`, `divider`, `closing`, `crest`, `gulls`, `vignette.*`) | offen |
|
||||
| 23.10.2026 | Hilfetext „*Wort* wird hervorgehoben“ im Titelbereich ist theme-abhängig (Seebad hebt nicht hervor) – Hinweis neutral formulieren | offen |
|
||||
| 23.10.2026 | **Menübild je Seite** (Feld an der Seite, Auswahl aus den Fotos, `PhotoSelect`) und optional ein kurzer **Menütext** – Seebad zeigt beides in den Menü-Tafeln; heute nur SEO-Beschreibung und Sprunglinks | offen |
|
||||
|
||||
## 6. Änderungsprotokoll Vorlagen-Vertrag
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ ## Eigene Vorlagen
|
||||
| Datei | Zweck |
|
||||
|---|---|
|
||||
| `layouts/app` | Grundgerüst (größere Grundschrift, Lightbox mit großer Schließen-Fläche) |
|
||||
| `partials/header` | Logo-Bildmarke, Menü, Telefon (ab 1536 px), „Verfügbarkeit prüfen“; Handy-Menü als dunkle Tafel mit großen Links, Anruf-Taste und Seebrücken-Band |
|
||||
| `partials/header` | Logo-Bildmarke, Menü mit **Menü-Tafeln** (Pfeil neben dem Menüpunkt: Seitenbeschreibung aus dem SEO-Text, Sprunglinks zu den Abschnitten mit Überschrift, Kartusche mit Buchung und Telefon; Escape/Klick daneben schließt; ohne JS normale Links), „Verfügbarkeit prüfen“ (bis 1279 px und ab 1536 px – dazwischen zu eng, Buchung dann im Titelbereich und in den Tafeln); Handy-Menü als dunkle Tafel mit großen Links, Anruf-Taste und Seebrücken-Band |
|
||||
| `partials/footer` | Seebrücken-Band, Bildmarke, Kontakt, Rechtliches |
|
||||
| `partials/banner` | Hinweis-Banner mit Möwen |
|
||||
| `partials/mobile-booking-bar` | „Verfügbarkeit prüfen“ und Anruf-Taste |
|
||||
|
||||
@@ -6,3 +6,47 @@ import '../ostsee-licht/theme.js';
|
||||
|
||||
// Logo, favicon (resources/themes/seebad/img) – addressed in Blade via Vite::asset().
|
||||
import.meta.glob(['./img/**'], { eager: true, query: '?url' });
|
||||
|
||||
/**
|
||||
* Menu panels (partials/header): the arrow next to a menu item opens a panel with jump links into the page.
|
||||
* Without JavaScript the arrows stay hidden and the menu items are plain links.
|
||||
*/
|
||||
function initMenuPanels() {
|
||||
const header = document.querySelector('[data-menu]');
|
||||
const toggles = [...document.querySelectorAll('[data-menu-toggle]')];
|
||||
if (!header || toggles.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const panelOf = (toggle) => document.getElementById(toggle.getAttribute('aria-controls'));
|
||||
const close = (toggle) => {
|
||||
toggle.setAttribute('aria-expanded', 'false');
|
||||
panelOf(toggle).hidden = true;
|
||||
};
|
||||
|
||||
toggles.forEach((toggle) => {
|
||||
toggle.hidden = false;
|
||||
toggle.addEventListener('click', () => {
|
||||
const open = toggle.getAttribute('aria-expanded') === 'true';
|
||||
toggles.filter((other) => other !== toggle).forEach(close);
|
||||
toggle.setAttribute('aria-expanded', String(!open));
|
||||
panelOf(toggle).hidden = open;
|
||||
});
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', (event) => {
|
||||
const open = toggles.find((toggle) => toggle.getAttribute('aria-expanded') === 'true');
|
||||
if (event.key === 'Escape' && open) {
|
||||
close(open);
|
||||
open.focus();
|
||||
}
|
||||
});
|
||||
document.addEventListener('click', (event) => {
|
||||
if (!header.contains(event.target)) {
|
||||
toggles.forEach(close);
|
||||
}
|
||||
});
|
||||
window.matchMedia('(min-width: 80rem)').addEventListener('change', () => toggles.forEach(close));
|
||||
}
|
||||
|
||||
initMenuPanels();
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"key": "seebad",
|
||||
"name": "Seebad",
|
||||
"version": "0.3.0",
|
||||
"version": "0.4.0",
|
||||
"parent": "ostsee-licht",
|
||||
"description": "Ruhiges Magazin für Paare: Logo und Bäderstil-Details des Hauses (Rundbogengaube, Balkongeländer, Kopfbänder), große gut lesbare Schrift",
|
||||
"assets": {
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
@php($phone = (string) config('fewo.owner.phone'))
|
||||
<header class="relative z-20">
|
||||
@php
|
||||
$phone = (string) config('fewo.owner.phone');
|
||||
// Menu panels: jump links to the headed sections of each page (sections limited to appearances are left out).
|
||||
$menuEntries = $theme->menu('main')->values()->map(fn ($page, $position) => [
|
||||
'page' => $page,
|
||||
'panel' => 'menu-panel-'.$position,
|
||||
'anchors' => collect($page->sections ?? [])
|
||||
->map(fn ($section, $index) => [
|
||||
'label' => $section['data']['heading'] ?? null,
|
||||
'id' => ($section['type'] ?? '').'-'.$index.'-title',
|
||||
'type' => $section['type'] ?? '',
|
||||
'limited' => ! empty($section['data']['appearances'] ?? []),
|
||||
])
|
||||
->filter(fn ($anchor) => filled($anchor['label']) && ! $anchor['limited']
|
||||
&& ! in_array($anchor['type'], ['hero', 'booking', 'contact', 'rich_text', 'offers', 'reviews'], true))
|
||||
->take(6)
|
||||
->values(),
|
||||
]);
|
||||
@endphp
|
||||
<header class="relative z-20" data-menu>
|
||||
<div class="mx-auto flex max-w-7xl items-center justify-between gap-6 px-4 py-4 sm:px-8 lg:py-5">
|
||||
<a href="{{ route('home') }}" class="flex min-w-0 items-center gap-3 sm:shrink-0" aria-label="{{ $theme->site->name }} – Startseite">
|
||||
@include('theme::partials.logo', ['class' => 'h-12 w-auto shrink-0 lg:h-16', 'sizes' => '(min-width: 1024px) 9.5rem, 7rem'])
|
||||
@@ -7,20 +25,24 @@
|
||||
</a>
|
||||
|
||||
<nav aria-label="Hauptnavigation" class="hidden xl:block">
|
||||
<ul class="flex gap-6 text-lg whitespace-nowrap xl:gap-7">
|
||||
@foreach ($theme->menu('main') as $item)
|
||||
<li><a href="{{ $item->url() }}" @class(['underline-offset-8 hover:underline', 'underline decoration-accent decoration-2' => url()->current() === $item->url()]) @if (url()->current() === $item->url()) aria-current="page" @endif>{{ $item->label() }}</a></li>
|
||||
<ul class="flex gap-4 text-lg whitespace-nowrap 2xl:gap-6">
|
||||
@foreach ($menuEntries as $entry)
|
||||
@php($item = $entry['page'])
|
||||
<li class="flex items-center gap-0.5">
|
||||
<a href="{{ $item->url() }}" @class(['underline-offset-8 hover:underline', 'underline decoration-accent decoration-2' => url()->current() === $item->url()]) @if (url()->current() === $item->url()) aria-current="page" @endif>{{ $item->label() }}</a>
|
||||
@if ($entry['anchors']->isNotEmpty())
|
||||
<button type="button" data-menu-toggle aria-controls="{{ $entry['panel'] }}" aria-expanded="false" aria-label="Übersicht „{{ $item->label() }}“" hidden
|
||||
class="flex size-9 items-center justify-center rounded-md hover:bg-ink/5 aria-expanded:bg-ink/5 aria-expanded:[&_svg]:rotate-180">
|
||||
<x-heroicon-m-chevron-down class="size-5 transition" aria-hidden="true" />
|
||||
</button>
|
||||
@endif
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="flex items-center gap-2 sm:gap-4">
|
||||
@if ($phone)
|
||||
<a href="tel:{{ preg_replace('/[^0-9+]/', '', $phone) }}" class="hidden items-center gap-2 font-semibold whitespace-nowrap hover:text-accent 2xl:flex">
|
||||
<x-heroicon-o-phone class="size-5" aria-hidden="true" />{{ $phone }}
|
||||
</a>
|
||||
@endif
|
||||
<a href="{{ route('booking.create') }}" class="btn-accent hidden whitespace-nowrap sm:inline-flex">Verfügbarkeit prüfen</a>
|
||||
<a href="{{ route('booking.create') }}" class="btn-accent hidden whitespace-nowrap sm:inline-flex xl:hidden 2xl:inline-flex">Verfügbarkeit prüfen</a>
|
||||
|
||||
<details class="group xl:hidden">
|
||||
<summary class="flex size-12 cursor-pointer list-none items-center justify-center rounded-md border border-line bg-surface [&::-webkit-details-marker]:hidden" aria-label="Menü">
|
||||
@@ -48,4 +70,35 @@
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach ($menuEntries->filter(fn ($entry) => $entry['anchors']->isNotEmpty()) as $entry)
|
||||
@php($item = $entry['page'])
|
||||
<div id="{{ $entry['panel'] }}" data-menu-panel hidden class="absolute inset-x-0 top-full border-y border-line bg-surface shadow-lg shadow-ink/10">
|
||||
<div class="mx-auto grid max-w-7xl grid-cols-[1.15fr_1fr_0.9fr] items-start gap-12 px-8 pt-10 pb-12">
|
||||
<div>
|
||||
<p class="font-display text-[2.25rem] leading-tight">{{ $item->label() }}</p>
|
||||
@if ($item->seo_description)<p class="mt-3 max-w-[42ch] text-muted">{{ $item->seo_description }}</p>@endif
|
||||
<a href="{{ $item->url() }}" class="mt-5 inline-block border-b-2 border-accent pb-0.5 font-semibold hover:text-accent">Zur Seite „{{ $item->label() }}“</a>
|
||||
</div>
|
||||
<nav aria-label="Auf der Seite „{{ $item->label() }}“">
|
||||
<p class="eyebrow">Auf dieser Seite</p>
|
||||
<ul class="divide-y divide-line border-y border-line">
|
||||
@foreach ($entry['anchors'] as $anchor)
|
||||
<li><a href="{{ $item->url() }}#{{ $anchor['id'] }}" class="block py-2.5 text-lg hover:text-accent">{{ $anchor['label'] }}</a></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="cartouche mt-6 px-6 pt-12 pb-7 text-center">
|
||||
<span class="absolute -top-8 left-1/2 -translate-x-1/2 bg-surface px-2" aria-hidden="true">@include('theme::partials.motif', ['slot' => 'crest', 'class' => 'h-12 w-auto'])</span>
|
||||
<span class="absolute -top-0.5 -left-0.5" aria-hidden="true">@include('theme::partials.motif', ['slot' => 'bracket', 'class' => 'size-9'])</span>
|
||||
<span class="absolute -top-0.5 -right-0.5 -scale-x-100" aria-hidden="true">@include('theme::partials.motif', ['slot' => 'bracket', 'class' => 'size-9'])</span>
|
||||
<p class="font-display text-[1.625rem] leading-tight">Ihr Wunschtermin?</p>
|
||||
<a href="{{ route('booking.create') }}" class="btn-accent mt-4">Verfügbarkeit prüfen</a>
|
||||
@if ($phone)
|
||||
<a href="tel:{{ preg_replace('/[^0-9+]/', '', $phone) }}" class="mt-3 flex items-center justify-center gap-2 font-semibold hover:text-accent"><x-heroicon-o-phone class="size-5" aria-hidden="true" />{{ $phone }}</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</header>
|
||||
@@ -9,8 +9,8 @@
|
||||
<h2 id="{{ $sectionId }}-title" class="heading-display">{{ $heading }}</h2>
|
||||
@if ($rotating)
|
||||
<div class="flex gap-2">
|
||||
<button type="button" data-rotator-prev class="flex size-12 items-center justify-center rounded-md border-2 border-ink hover:bg-ink/5" aria-label="Vorheriges Angebot"><x-heroicon-o-chevron-left class="size-5" aria-hidden="true" /></button>
|
||||
<button type="button" data-rotator-next class="flex size-12 items-center justify-center rounded-md border-2 border-ink hover:bg-ink/5" aria-label="Nächstes Angebot"><x-heroicon-o-chevron-right class="size-5" aria-hidden="true" /></button>
|
||||
<button type="button" data-rotator-prev class="flex size-12 items-center justify-center rounded-md border-2 border-ink hover:bg-ink/5" aria-label="Vorheriges Angebot"><x-heroicon-m-chevron-left class="size-5" aria-hidden="true" /></button>
|
||||
<button type="button" data-rotator-next class="flex size-12 items-center justify-center rounded-md border-2 border-ink hover:bg-ink/5" aria-label="Nächstes Angebot"><x-heroicon-m-chevron-right class="size-5" aria-hidden="true" /></button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Enums\ReviewStatus;
|
||||
use App\Models\Page;
|
||||
use App\Models\Property;
|
||||
use App\Models\Review;
|
||||
use App\Models\Site;
|
||||
use App\Models\SpecialOffer;
|
||||
use App\Themes\ThemeRegistry;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Database\Seeders\PropertySeeder;
|
||||
use Database\Seeders\SiteSeeder;
|
||||
use Database\Seeders\WebsiteContentSeeder;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Every installed theme must render every page with real content in every display mode – a template that only
|
||||
* breaks when data exists (e.g. offers shown as a carousel) would otherwise go unnoticed until it is live.
|
||||
*/
|
||||
class InstalledThemesRenderTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
private const PAGES = ['/', '/wohnung', '/kuehlungsborn', '/buchen', '/kontakt', '/impressum', '/datenschutz'];
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->travelTo(CarbonImmutable::parse('2026-10-22 10:00'));
|
||||
$this->seed([PropertySeeder::class, WebsiteContentSeeder::class, SiteSeeder::class]);
|
||||
$this->withoutVite();
|
||||
|
||||
$property = Property::sole();
|
||||
Review::factory()->for($property)->count(2)->create(['status' => ReviewStatus::Approved]);
|
||||
SpecialOffer::factory()->for($property)->create(['name' => 'Herbstwochen', 'is_featured' => true]);
|
||||
SpecialOffer::factory()->for($property)->create(['name' => 'Ab 5 Nächten', 'min_nights' => 5]);
|
||||
}
|
||||
|
||||
public function test_every_installed_theme_renders_all_pages_with_offers_in_every_display_mode(): void
|
||||
{
|
||||
$site = Site::sole();
|
||||
$home = Page::query()->where('slug', Page::HOME)->sole();
|
||||
|
||||
foreach (array_keys(app(ThemeRegistry::class)->all()) as $themeKey) {
|
||||
$site->update(['theme' => $themeKey]);
|
||||
|
||||
foreach (['grid', 'list', 'rotating'] as $display) {
|
||||
$home->update(['sections' => array_map(
|
||||
fn (array $section): array => $section['type'] === 'offers' ? [...$section, 'data' => [...$section['data'], 'display' => $display]] : $section,
|
||||
$home->sections,
|
||||
)]);
|
||||
|
||||
$this->get('/')->assertOk()->assertSee('Herbstwochen');
|
||||
}
|
||||
|
||||
foreach (self::PAGES as $path) {
|
||||
$this->get($path)->assertOk();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user