Booking path 1 (offer + guest acceptance), 2FA for all, privacy hardening, brand graphics in theme

- Offer workflow: "Angebot senden" in the admin (dates, guests, promo code, manual price adjustment,
  validity from the property's hold time, message, guest data for the contract) with live price;
  contract draft PDF; signed, versioned offer page for the guest to accept (acceptance record without
  IP) or decline; expiry job, landlord notifications, editable offer texts, wording on the website.
- 2FA is mandatory for every admin account.
- Privacy: complete anonymisation (notes, attribution, review names, offer messages), shorter
  periods for unbinding requests, portal mail excerpts and attribution (configurable proposals),
  iCal summary not stored, known e-mail no longer overwrites guest data, security headers, bearer
  tokens for automations, metadata stripped from photo originals, review link throttled.
- Daily database backup (backup:database) and scripts/backup-pull.sh for the NAS.
- Theme: brand mark in header/footer, favicon/touch icon, wave divider, icons, illustration as
  image placeholder; navy follows the text colour for dark appearances.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lars StommerandClaude Opus 5.5 committed 2026-10-22 21:38:22 +02:00
1 parent 82698f8eda
commit 4f69b426a4
77 files changed
+1658 -108

No files matched your search

@@ -30,6 +30,15 @@ @theme inline {
--font-sans: 'Figtree', ui-sans-serif, system-ui, sans-serif;
}
/* Brand graphics (public/brand, inlined via partials/brand): navy follows the text colour, so the logo stays
visible in dark appearances; teal, light wave and sun keep the brand colours unless a theme overrides them. */
:root {
--brand-navy: var(--ink);
--brand-teal: #0286a2;
--brand-wave: #6dbfc2;
--brand-sun: #f2c27a;
}
@layer base {
html {
scroll-behavior: smooth;
@@ -20,6 +20,8 @@
<meta property="og:image" content="{{ $ogImage }}">
@endisset
<link rel="canonical" href="{{ url()->current() }}">
<link rel="icon" href="{{ asset('brand/favicon.svg') }}" type="image/svg+xml">
<link rel="apple-touch-icon" href="{{ asset('brand/apple-touch-icon.png') }}">
@if ($theme->isPreview || ! app()->isProduction())
<meta name="robots" content="noindex">
@endif
@@ -0,0 +1,16 @@
{{--
Inline brand graphic from public/brand/<name>.svg (mark, logo, wave-divider, icon-apartment, icon-sea,
icon-terrace, icon-location). Inline, so the colours follow the CSS variables --brand-navy/-teal/-wave/-sun
(theme-base.css maps navy to the text colour, so it stays visible in dark appearances).
Variables: $name, $class (optional), $label (optional; without it the graphic is decorative).
--}}
@php
static $brandSvgs = [];
$brandSvgs[$name] ??= is_file(public_path("brand/{$name}.svg")) ? file_get_contents(public_path("brand/{$name}.svg")) : '';
$brandUid = 'b'.\Illuminate\Support\Str::lower(\Illuminate\Support\Str::random(6));
$brandSvg = preg_replace(['/\s(role|aria-label)="[^"]*"/', '/<title>.*?<\/title>/s'], '', $brandSvgs[$name]);
$brandSvg = preg_replace(['/id="([^"]+)"/', '/url\(#([^)]+)\)/'], ['id="$1-'.$brandUid.'"', 'url(#$1-'.$brandUid.')'], $brandSvg);
$brandAttributes = 'class="'.e($class ?? '').'" '.(isset($label) ? 'role="img" aria-label="'.e($label).'"' : 'aria-hidden="true" focusable="false"');
$brandSvg = preg_replace('/<svg\s/', '<svg '.$brandAttributes.' ', $brandSvg, 1);
@endphp
{!! $brandSvg !!}
@@ -1,7 +1,10 @@
<footer class="mt-8 border-t border-line">
<div class="mt-16 px-4" aria-hidden="true">
@include('theme::partials.brand', ['name' => 'wave-divider', 'class' => 'mx-auto block h-auto w-full max-w-4xl'])
</div>
<footer class="border-t border-line">
<div class="mx-auto flex max-w-7xl flex-wrap justify-between gap-x-16 gap-y-6 px-4 py-14 text-sm text-muted sm:px-8">
<div>
<span class="font-display text-2xl text-ink">{{ $theme->site->name }}</span><br>
<span class="flex items-center gap-2 font-display text-2xl text-ink">@include('theme::partials.brand', ['name' => 'mark', 'class' => 'h-7 w-auto']){{ $theme->site->name }}</span>
{{ $theme->property()?->address }}
</div>
<div>
@@ -1,8 +1,11 @@
<header class="relative z-20">
<div class="mx-auto flex max-w-7xl items-center justify-between gap-6 px-4 py-5 sm:px-8">
<a href="{{ route('home') }}" class="flex flex-col leading-tight">
<span class="font-display text-[1.875rem] font-semibold tracking-wide">{{ str($theme->site->name)->afterLast(' ') }}</span>
<span class="text-[11px] tracking-[0.24em] text-muted uppercase">Ferienwohnung · Kühlungsborn</span>
<a href="{{ route('home') }}" class="flex items-center gap-3 leading-tight" aria-label="{{ $theme->site->name }} – Startseite">
@include('theme::partials.brand', ['name' => 'mark', 'class' => 'h-11 w-auto shrink-0 sm:h-12'])
<span class="flex flex-col">
<span class="font-display text-[1.875rem] font-semibold tracking-wide">{{ str($theme->site->name)->afterLast(' ') }}</span>
<span class="text-[11px] tracking-[0.24em] text-muted uppercase">Ferienwohnung · Kühlungsborn</span>
</span>
</a>
<nav aria-label="Hauptnavigation" class="hidden lg:block">
@@ -10,5 +10,7 @@
decoding="async"
class="{{ $class ?? '' }}">
@else
<div class="{{ $class ?? '' }} flex items-center justify-center bg-line/60 text-sm text-muted" role="img" aria-label="Bild folgt">Bild folgt</div>
<div class="{{ $class ?? '' }} flex items-center justify-center bg-surface" role="img" aria-label="Bild folgt">
<img src="{{ asset('brand/coastal-illustration-1200.webp') }}" alt="" loading="lazy" decoding="async" class="h-full max-h-full w-full object-contain p-6 opacity-90">
</div>
@endif
@@ -2,16 +2,16 @@
@if ($heading)<h2 id="{{ $sectionId }}-title" class="heading-display mb-8">{{ $heading }}</h2>@endif
<ul class="reveal grid grid-cols-2 gap-6 border-y border-line lg:grid-cols-4">
@if ($property?->size_sqm)
<li class="py-7"><span class="block font-display text-[2.5rem] leading-none">{{ $property->size_sqm }} m²</span><span class="text-sm text-muted">Wohnfläche</span></li>
<li class="py-7">@include('theme::partials.brand', ['name' => 'icon-apartment', 'class' => 'mb-3 size-12'])<span class="block font-display text-[2.5rem] leading-none">{{ $property->size_sqm }} m²</span><span class="text-sm text-muted">Wohnfläche</span></li>
@endif
@if ($property)
<li class="py-7"><span class="block font-display text-[2.5rem] leading-none">1–{{ $property->max_guests }}</span><span class="text-sm text-muted">Gäste</span></li>
<li class="py-7">@include('theme::partials.brand', ['name' => 'icon-terrace', 'class' => 'mb-3 size-12'])<span class="block font-display text-[2.5rem] leading-none">1–{{ $property->max_guests }}</span><span class="text-sm text-muted">Gäste</span></li>
@endif
@if ($fromPrice)
<li class="py-7"><span class="block font-display text-[2.5rem] leading-none">ab {{ \App\Support\Money::format((int) $fromPrice) }}</span><span class="text-sm text-muted">pro Nacht</span></li>
<li class="py-7">@include('theme::partials.brand', ['name' => 'icon-sea', 'class' => 'mb-3 size-12'])<span class="block font-display text-[2.5rem] leading-none">ab {{ \App\Support\Money::format((int) $fromPrice) }}</span><span class="text-sm text-muted">pro Nacht</span></li>
@endif
@if ($highlights->isNotEmpty())
<li class="py-7"><span class="block font-display text-[2.5rem] leading-none">inklusive</span><span class="text-sm text-muted">{{ $highlights->take(3)->implode(', ') }}</span></li>
<li class="py-7">@include('theme::partials.brand', ['name' => 'icon-location', 'class' => 'mb-3 size-12'])<span class="block font-display text-[2.5rem] leading-none">inklusive</span><span class="text-sm text-muted">{{ $highlights->take(3)->implode(', ') }}</span></li>
@endif
</ul>
</section>
@@ -5,8 +5,10 @@
<h2 id="{{ $sectionId }}-title" class="heading-display">{{ $heading }}</h2>
@if ($text)<div class="mt-6 text-band-muted [&_a]:underline [&_p]:mb-4">{{ $text }}</div>@endif
@if ($address)
<p class="mt-6 text-band-muted">{{ $address }}<br>
<a href="{{ $mapUrl }}" class="font-semibold text-band-ink underline" rel="noopener" target="_blank">Auf der Karte ansehen</a>
<p class="mt-6 flex items-start gap-3 text-band-muted [--brand-navy:var(--band-ink)]">
@include('theme::partials.brand', ['name' => 'icon-location', 'class' => 'size-10 shrink-0'])
<span>{{ $address }}<br>
<a href="{{ $mapUrl }}" class="font-semibold text-band-ink underline" rel="noopener" target="_blank">Auf der Karte ansehen</a></span>
</p>
@endif
</div>
@@ -215,10 +215,10 @@ class="mt-1 w-full rounded-lg border-line">
@disabled(! $pricing['quote'])
wire:loading.attr="disabled"
class="mt-5 w-full rounded-xl bg-accent px-4 py-3 font-semibold text-accent-ink transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50">
<span wire:loading.remove wire:target="submit">Termin vormerken &amp; Angebot erhalten</span>
<span wire:loading.remove wire:target="submit">Unverbindlich anfragen</span>
<span wire:loading wire:target="submit">Wird gesendet …</span>
</button>
<p class="mt-2 text-center text-xs text-muted">Kostenlos und unverbindlich. Verbindlich wird die Buchung erst mit unserer Bestätigung.</p>
<p class="mt-2 text-center text-xs text-muted">Kostenlos und unverbindlich. Wir halten den Termin für Sie frei und senden Ihnen ein Angebot per E-Mail – verbindlich wird die Buchung erst, wenn Sie es annehmen.</p>
</form>
</section>
</div>
@@ -3,7 +3,11 @@
Guten Tag {{ $booking->guest->full_name }},
@if ($booking->accepted_at)
vielen Dank – Sie haben unser Angebot am {{ $booking->accepted_at->format('d.m.Y') }} um {{ $booking->accepted_at->format('H:i') }} Uhr angenommen. Damit ist Ihre Buchung der **{{ $booking->property->name }}** verbindlich.
@else
wir freuen uns, Ihre Buchung der **{{ $booking->property->name }}** verbindlich zu bestätigen.
@endif
**Anreise:** {{ $booking->arrival->translatedFormat('l, d.m.Y') }}@if ($booking->property->check_in_time) ab {{ substr($booking->property->check_in_time, 0, 5) }} Uhr @endif<br>
**Abreise:** {{ $booking->departure->translatedFormat('l, d.m.Y') }}@if ($booking->property->check_out_time) bis {{ substr($booking->property->check_out_time, 0, 5) }} Uhr @endif<br>
@@ -20,6 +20,6 @@
@endif
<x-mail::button :url="\App\Filament\Resources\Bookings\BookingResource::getUrl('view', ['record' => $booking])">
Anfrage bestätigen oder ablehnen
Angebot senden oder Anfrage ablehnen
</x-mail::button>
</x-mail::message>
@@ -0,0 +1,15 @@
<x-mail::message>
@if ($accepted)
# Angebot angenommen
{{ $booking->guest->full_name }} hat das Angebot **{{ $booking->reference }}** ({{ $booking->arrival->format('d.m.Y') }} – {{ $booking->departure->format('d.m.Y') }}, {{ \App\Support\Money::format($booking->total) }}) am {{ $booking->accepted_at?->format('d.m.Y') }} um {{ $booking->accepted_at?->format('H:i') }} Uhr angenommen. Die Buchung ist verbindlich; Bestätigung und Mietvertrag wurden an den Gast gesendet.
@else
# Angebot abgelehnt
{{ $booking->guest->full_name }} hat das Angebot **{{ $booking->reference }}** ({{ $booking->arrival->format('d.m.Y') }} – {{ $booking->departure->format('d.m.Y') }}) abgelehnt. Der Zeitraum ist im Kalender wieder frei.
@endif
<x-mail::button :url="\App\Filament\Resources\Bookings\BookingResource::getUrl('view', ['record' => $booking])">
Buchung öffnen
</x-mail::button>
</x-mail::message>
+31
View File
@@ -0,0 +1,31 @@
<x-mail::message>
# Ihr Angebot für die {{ $booking->property->name }}
Guten Tag {{ $booking->guest->full_name }},
{{ \App\Support\Content::get('offer.intro') }}
**Anreise:** {{ $booking->arrival->translatedFormat('l, d.m.Y') }}<br>
**Abreise:** {{ $booking->departure->translatedFormat('l, d.m.Y') }}<br>
**Personen:** {{ $booking->guests }}<br>
**Angebotsnummer:** {{ $booking->reference }}
@include('mail.partials.quote')
@if ($booking->offer_message)
{{ $booking->offer_message }}
@endif
Das Angebot gilt **bis {{ $booking->hold_expires_at->format('d.m.Y, H:i') }} Uhr**; bis dahin halten wir den Zeitraum für Sie frei.
<x-mail::button :url="$offerUrl">
Angebot ansehen und annehmen
</x-mail::button>
Auf der Angebotsseite können Sie das Angebot annehmen oder ablehnen. Erst mit Ihrer Annahme wird die Buchung verbindlich; Sie erhalten dann sofort die Buchungsbestätigung mit dem Mietvertrag.
Bei Fragen antworten Sie einfach auf diese E-Mail oder rufen Sie uns an: {{ config('fewo.owner.phone') }}
Herzliche Grüße<br>
{{ config('fewo.owner.name') }}
</x-mail::message>
@@ -1,9 +1,9 @@
<x-mail::message>
# Vormerkung abgelaufen
# {{ $booking->offer_version > 0 ? 'Angebot abgelaufen' : 'Vormerkung abgelaufen' }}
Die Anfrage **{{ $booking->reference }}** von {{ $booking->guest->full_name }} ({{ $booking->arrival->format('d.m.Y') }} – {{ $booking->departure->format('d.m.Y') }}) wurde nicht rechtzeitig bestätigt. Der Zeitraum ist im Kalender wieder frei.
Die Anfrage **{{ $booking->reference }}** von {{ $booking->guest->full_name }} ({{ $booking->arrival->format('d.m.Y') }} – {{ $booking->departure->format('d.m.Y') }}) {{ $booking->offer_version > 0 ? 'wurde vom Gast nicht rechtzeitig angenommen' : 'wurde nicht rechtzeitig beantwortet' }}. Der Zeitraum ist im Kalender wieder frei.
Sie können die Anfrage weiterhin bestätigen, sofern der Zeitraum noch frei ist.
Sie können weiterhin ein (neues) Angebot senden, sofern der Zeitraum noch frei ist.
<x-mail::button :url="\App\Filament\Resources\Bookings\BookingResource::getUrl('view', ['record' => $booking])">
Anfrage öffnen
@@ -3,16 +3,18 @@
Guten Tag {{ $booking->guest->full_name }},
wir haben Ihre Anfrage für die **{{ $booking->property->name }}** erhalten und den Zeitraum für Sie **bis {{ $booking->hold_expires_at->format('d.m.Y, H:i') }} Uhr vorgemerkt**.
wir haben Ihre unverbindliche Anfrage für die **{{ $booking->property->name }}** erhalten und den Zeitraum für Sie **bis {{ $booking->hold_expires_at->format('d.m.Y, H:i') }} Uhr vorgemerkt**.
**Anreise:** {{ $booking->arrival->translatedFormat('l, d.m.Y') }}<br>
**Abreise:** {{ $booking->departure->translatedFormat('l, d.m.Y') }}<br>
**Personen:** {{ $booking->guests }}<br>
**Anfragenummer:** {{ $booking->reference }}
**Voraussichtlicher Preis laut Preisliste:**
@include('mail.partials.quote')
Wir prüfen Ihre Anfrage und melden uns in Kürze mit der Buchungsbestätigung. Erst mit unserer Bestätigung ist die Buchung verbindlich.
Wir prüfen Ihre Anfrage und senden Ihnen in Kürze **unser Angebot** per E-Mail. Verbindlich wird die Buchung erst, wenn Sie dieses Angebot annehmen.
@if ($booking->message)
**Ihre Nachricht:**<br>
+93
View File
@@ -0,0 +1,93 @@
@php($money = fn (int $cents): string => \App\Support\Money::format($cents))
@extends('theme::layouts.app', ['title' => 'Ihr Angebot'])
@push('head')
<meta name="robots" content="noindex">
@endpush
@section('content')
<div class="mx-auto max-w-3xl px-4 py-14 sm:px-8">
<p class="eyebrow">Angebot {{ $booking->reference }}</p>
<h1 class="heading-display">{{ $booking->property->name }}</h1>
<p class="mt-2 text-muted">für {{ $booking->guest->full_name }}</p>
@if (session('offer.success'))
<div class="mt-8 rounded border border-accent bg-surface p-5" role="status">{{ session('offer.success') }}</div>
@endif
@if (session('offer.error') || $problem)
<div class="mt-8 rounded border border-line bg-surface p-5" role="alert">{{ session('offer.error') ?? $problem }}</div>
@endif
@if (! session('offer.success') && ! $problem)
@if ($booking->status === \App\Enums\BookingStatus::Declined)
<div class="mt-8 rounded border border-line bg-surface p-5">Dieses Angebot wurde abgelehnt.</div>
@elseif (in_array($booking->status, \App\Enums\BookingStatus::occupying(), true))
<div class="mt-8 rounded border border-accent bg-surface p-5">Dieses Angebot wurde @if ($booking->accepted_at) am {{ $booking->accepted_at->format('d.m.Y') }} @endif angenommen – Ihre Buchung ist verbindlich.</div>
@elseif ($booking->status === \App\Enums\BookingStatus::Expired)
<div class="mt-8 rounded border border-line bg-surface p-5">{{ \App\Exceptions\ReservationException::offerExpired()->getMessage() }}</div>
@endif
@endif
<section class="mt-10 rounded bg-surface p-7" aria-labelledby="offer-stay">
<h2 id="offer-stay" class="font-display text-2xl">Ihr Aufenthalt</h2>
<dl class="mt-4 grid grid-cols-[auto_1fr] gap-x-6 gap-y-1">
<dt class="text-muted">Anreise</dt><dd>{{ $booking->arrival->translatedFormat('l, d.m.Y') }}@if ($booking->property->check_in_time) ab {{ substr($booking->property->check_in_time, 0, 5) }} Uhr @endif</dd>
<dt class="text-muted">Abreise</dt><dd>{{ $booking->departure->translatedFormat('l, d.m.Y') }}@if ($booking->property->check_out_time) bis {{ substr($booking->property->check_out_time, 0, 5) }} Uhr @endif</dd>
<dt class="text-muted">Nächte</dt><dd>{{ $booking->nights() }}</dd>
<dt class="text-muted">Personen</dt><dd>{{ $booking->guests }}</dd>
@if ($booking->status === \App\Enums\BookingStatus::OfferSent)
<dt class="text-muted">Gültig bis</dt><dd>{{ $booking->hold_expires_at?->format('d.m.Y, H:i') }} Uhr</dd>
@endif
</dl>
<h2 class="mt-8 font-display text-2xl">Preis</h2>
<table class="mt-3 w-full">
@foreach ($booking->quote['lines'] ?? [] as $line)
<tr class="border-b border-line"><td class="py-2">{{ $line['label'] }}</td><td class="py-2 text-right whitespace-nowrap">{{ $money($line['amount']) }}</td></tr>
@endforeach
<tr class="font-semibold"><td class="pt-3">Gesamtpreis</td><td class="pt-3 text-right">{{ $money($booking->total) }}</td></tr>
</table>
<p class="mt-3 text-sm text-muted">
@if ($booking->balance_due_on->lessThanOrEqualTo(today()->addDays(config('fewo.deposit_due_days'))))
Da die Anreise kurz bevorsteht, ist der Gesamtbetrag innerhalb von {{ config('fewo.deposit_due_days') }} Tagen nach Buchung fällig.
@else
Anzahlung {{ $money($booking->deposit) }} innerhalb von {{ config('fewo.deposit_due_days') }} Tagen nach Buchung,
Restbetrag {{ $money($booking->total - $booking->deposit) }} bis {{ $booking->balance_due_on->format('d.m.Y') }}.
@endif
Die Kurtaxe ist nicht enthalten und wird vor Ort entrichtet.
</p>
@if ($booking->offer_message)
<p class="mt-6 rounded border border-line p-4">{{ $booking->offer_message }}</p>
@endif
<h2 class="mt-8 font-display text-2xl">Bedingungen</h2>
<div class="prose-theme mt-3">{{ \App\Support\Content::html('contract.terms') }}</div>
@if (\App\Support\Content::get('stay.cancellation'))
<h3 class="mt-6 font-semibold">Rücktritt / Stornierung</h3>
<div class="prose-theme mt-2">{{ \App\Support\Content::html('stay.cancellation') }}</div>
@endif
<p class="mt-4 text-sm text-muted">Den vollständigen Vertragsentwurf finden Sie als PDF im Anhang unserer E-Mail.</p>
</section>
@if ($canAnswer)
<section class="mt-8 rounded bg-surface p-7" aria-label="Angebot annehmen oder ablehnen">
<form method="post" action="{{ $acceptUrl }}">
@csrf
<label class="flex items-start gap-3">
<input type="checkbox" name="terms" value="1" required class="mt-1">
<span>Ich habe die Angaben und Bedingungen dieses Angebots gelesen.</span>
</label>
@error('terms')<p class="mt-1 text-sm" role="alert">{{ $message }}</p>@enderror
<p class="mt-4 text-sm text-muted">{{ \App\Support\Content::get('offer.accept_note') }}</p>
<button type="submit" class="btn-accent mt-4 w-full sm:w-auto">{{ \App\Support\Content::get('offer.accept_button') }}</button>
</form>
<form method="post" action="{{ $rejectUrl }}" class="mt-6 border-t border-line pt-4">
@csrf
<button type="submit" class="text-sm text-muted underline hover:text-ink">Angebot ablehnen</button>
</form>
</section>
@endif
<p class="mt-8 text-sm text-muted">Fragen? {{ config('fewo.owner.name') }} · {{ config('fewo.owner.phone') }} · <a class="underline" href="mailto:{{ config('fewo.owner.email') }}">{{ config('fewo.owner.email') }}</a></p>
</div>
@endsection
+8 -2
View File
@@ -25,8 +25,14 @@
<body>
<div class="footer">{{ config('fewo.owner.name') }} · {{ config('fewo.owner.street') }} · {{ config('fewo.owner.city') }} · {{ config('fewo.owner.phone') }} · {{ config('fewo.owner.email') }}</div>
<h1>Mietvertrag Ferienwohnung</h1>
<p class="muted">Buchungsnummer {{ $booking->reference }} · ausgestellt am {{ ($booking->confirmed_at ?? now())->format('d.m.Y') }}</p>
@if ($draft ?? false)
<h1>Angebot und Mietvertrag (Entwurf)</h1>
<p class="muted">Angebot {{ $booking->reference }} · Version {{ $booking->offer_version }} · erstellt am {{ ($booking->offer_sent_at ?? now())->format('d.m.Y') }} · gültig bis {{ $booking->hold_expires_at?->format('d.m.Y, H:i') }} Uhr</p>
<p><strong>{{ \App\Support\Content::get('offer.contract_note') }}</strong></p>
@else
<h1>Mietvertrag Ferienwohnung</h1>
<p class="muted">Buchungsnummer {{ $booking->reference }} · ausgestellt am {{ ($booking->confirmed_at ?? now())->format('d.m.Y') }}@if ($booking->accepted_at) · Angebot angenommen am {{ $booking->accepted_at->format('d.m.Y, H:i') }} Uhr @endif</p>
@endif
<p>{{ \App\Support\Content::get('contract.intro') }}</p>