Files
fewo-stommer/resources/themes/ostsee-licht/views/sections/offers.blade.php
T
Lars StommerandClaude Opus 5.5 7d0bc93abc Offers by their own rules, seasonal photos per section, theme authoring tooling
- Special offers: kinds (rule, fixed dates, gap filler), package price, priority, highlight;
  GapFinder detects calendar gaps (optionally waiving the minimum stay); OfferShowcase decides
  what the website advertises and prices fixed dates/gaps with PriceCalculator; offers section
  shows them side by side, as a list or rotating; hero can show the top offer. Appearances no
  longer carry a featured offer.
- Sections get stable ids; appearances set photos per section ("Bilder je Baustein") and
  sections can be limited to appearances. Photo pickers show thumbnails everywhere.
- Themes: themes:make (scaffold, never overwrites), themes:check (contract, build, markup,
  colours, external resources, WCAG contrast), themes:preview (signed links per page and
  appearance), signed ?theme= preview and preview action in the site form, inherited colour
  tokens in the admin. Base CSS split into theme.css + reusable theme-base.css.
- docs/THEME-ERSTELLUNG.md: binding guide for building additional themes elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:51:38 +02:00

75 lines
5.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{-- Contract: $heading, $display (grid|list|rotating), $offers (Collection of App\Pricing\AdvertisedOffer) --}}
@if ($offers->isNotEmpty())
@php($layout = $display === 'rotating' && $offers->count() === 1 ? 'grid' : $display)
@php($rotating = $layout === 'rotating')
<section class="mx-auto max-w-7xl px-4 py-16 sm:px-8" aria-labelledby="{{ $sectionId }}-title"
@if ($rotating) data-rotator aria-roledescription="Karussell" @endif>
<div class="mb-8 flex items-end justify-between gap-4">
<h2 id="{{ $sectionId }}-title" class="heading-display">{{ $heading }}</h2>
@if ($rotating)
<div class="flex gap-2">
<button type="button" data-rotator-prev class="rounded border border-line px-3 py-1.5 hover:bg-surface" aria-label="Vorheriges Angebot">←</button>
<button type="button" data-rotator-next class="rounded border border-line px-3 py-1.5 hover:bg-surface" aria-label="Nächstes Angebot">→</button>
</div>
@endif
</div>
<ul @class([
'grid gap-4 sm:grid-cols-2 lg:grid-cols-3' => $layout === 'grid',
'grid gap-4' => $layout === 'list',
'relative' => $rotating,
]) @if ($rotating) data-rotator-track aria-live="polite" @endif>
@foreach ($offers as $advertised)
<li data-offer="{{ $advertised->key() }}" @class([
'reveal flex flex-col rounded bg-surface p-7',
'ring-2 ring-accent' => $advertised->offer->is_featured,
'sm:flex-row sm:items-center sm:gap-8' => $layout === 'list',
]) @if ($rotating) data-rotator-slide @if (! $loop->first) hidden @endif aria-label="Angebot {{ $loop->iteration }} von {{ $offers->count() }}" @endif>
<div class="flex-1">
<p class="inline-block rounded bg-accent px-2.5 py-1 text-sm font-semibold text-accent-ink">{{ $advertised->advantage }}</p>
<p class="mt-3 font-display text-2xl">{{ $advertised->title }}</p>
@if ($advertised->arrival)
<p class="mt-1 font-semibold">
{{ $advertised->arrival->locale('de')->isoFormat('dd DD.MM.') }} – {{ $advertised->departure->locale('de')->isoFormat('dd DD.MM.YYYY') }}
· {{ $advertised->nights() }} {{ $advertised->nights() === 1 ? 'Nacht' : 'Nächte' }}
</p>
@endif
@if ($advertised->description)<p class="mt-2 text-muted">{{ $advertised->description }}</p>@endif
@if ($advertised->conditions)
<ul class="mt-3 flex flex-wrap gap-2 text-sm text-muted">
@foreach ($advertised->conditions as $condition)
<li class="rounded border border-line px-2 py-0.5">{{ $condition }}</li>
@endforeach
</ul>
@endif
</div>
<div @class(['mt-5', 'sm:mt-0 sm:text-right' => $layout === 'list'])>
@if ($advertised->quote)
<p class="text-lg">
<strong>{{ \App\Support\Money::format($advertised->quote->total()) }}</strong>
@if ($advertised->regularTotal() > $advertised->quote->total())
<span class="text-muted">statt <s>{{ \App\Support\Money::format($advertised->regularTotal()) }}</s></span>
@endif
</p>
<p class="text-sm text-muted">für {{ $advertised->quote->guests }} {{ $advertised->quote->guests === 1 ? 'Person' : 'Personen' }} inkl. Endreinigung</p>
@endif
<a href="{{ $advertised->bookingUrl() }}" class="mt-3 inline-block rounded bg-accent px-5 py-2.5 font-semibold text-accent-ink hover:opacity-90">
{{ $advertised->arrival ? 'Diesen Termin anfragen' : 'Preis berechnen' }}
</a>
</div>
</li>
@endforeach
</ul>
@if ($rotating)
<div class="mt-4 flex justify-center gap-2" role="tablist" aria-label="Angebote">
@foreach ($offers as $advertised)
<button type="button" data-rotator-dot="{{ $loop->index }}" role="tab" aria-label="Angebot {{ $loop->iteration }}"
aria-selected="{{ $loop->first ? 'true' : 'false' }}" class="size-2.5 rounded-full bg-line aria-selected:bg-accent"></button>
@endforeach
</div>
@endif
<p class="mt-4 text-sm text-muted">Angebote werden bei der Preisberechnung automatisch berücksichtigt – Sie erhalten immer das für Sie günstigste.</p>
</section>
@endif