Titelvideo, Rundgang mit Kapiteln, naechste freie Termine, ruhigere Buchungsseite

- Webseite > Videos (Datei, Standbild, Kapitel mit Raum im Grundriss); Upload bis 100 MB
- Titelbereich: Video statt Foto (stumme Schleife, respektiert Bewegung reduzieren/Save-Data)
  und naechste freie Termine mit Gesamtpreis (NextFreeStays)
- Neuer Baustein Rundgang (Video) mit waehlbarer Anordnung; Grundriss springt ins Video
- Buchungsseite: Preis unter dem Kalender, Formular rechts, Ablauf als Grafik
- Seebad: Fahrkarten, Fahrplan-Kapitel, Sonnenaufgang als einmaliges Ereignis

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-10-30 11:01:52 +01:00
1 parent f5f18cd984
commit d42c42059c
38 files changed
+1279 -23

No files matched your search

+16 -1
View File
@@ -5,12 +5,21 @@
use App\Themes\Theme;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
/**
* Availability calendar, live price and booking request (Livewire component App\Livewire\BookingRequest).
* Availability calendar, live price and booking request (Livewire component App\Livewire\BookingRequest), optionally
* with the three steps of the booking path (request → offer → acceptance) as a graphic.
*/
class BookingSection extends Section
{
/** Booking path 1 (KONZEPT §6a) in the guest's words: title => explanation. */
public const STEPS = [
'Anfrage senden' => 'Kostenlos und unverbindlich. Wir halten den Termin sofort für Sie frei.',
'Angebot erhalten' => 'Per E-Mail mit Gesamtpreis und Mietvertrag – in Ruhe prüfen.',
'Annehmen' => 'Mit einem Klick im Angebot. Erst dann ist die Buchung verbindlich.',
];
public static function key(): string
{
return 'booking';
@@ -31,6 +40,10 @@ public static function schema(): array
return [
TextInput::make('heading')->label('Überschrift')->default('Preise & Buchung')->maxLength(120),
Textarea::make('text')->label('Text')->rows(2),
Toggle::make('show_steps')
->label('Ablauf als Grafik zeigen')
->helperText('Anfrage → Angebot per E-Mail → Annahme, über dem Kalender.')
->default(true),
];
}
@@ -39,6 +52,8 @@ public function data(Theme $theme, array $data): array
return [
'heading' => $data['heading'] ?? null,
'text' => $data['text'] ?? null,
'showSteps' => (bool) ($data['show_steps'] ?? true),
'steps' => self::STEPS,
'property' => $theme->property(),
];
}
+3
View File
@@ -5,6 +5,7 @@
use App\Models\Amenity;
use App\Models\FloorPlan;
use App\Models\Photo;
use App\Models\Video;
use App\Themes\Theme;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
@@ -52,6 +53,7 @@ public function data(Theme $theme, array $data): array
$amenities = Amenity::query()
->whereIn('id', $rooms->flatMap(fn (array $room): array => $room['amenity_ids'] ?? [])->unique()->all())
->pluck('name', 'id');
$videos = $rooms->isEmpty() ? collect() : Video::query()->where('property_id', $plan->property_id)->whereNotNull('chapters')->get();
return [
'heading' => $data['heading'] ?? 'Der Grundriss',
@@ -65,6 +67,7 @@ public function data(Theme $theme, array $data): array
'points' => collect(FloorPlan::points($room['points']))->map(fn (array $point): string => $point[0].','.$point[1])->implode(' '),
'photos' => collect($room['photo_ids'] ?? [])->map(fn ($id) => $photos->get((int) $id))->filter()->values(),
'amenities' => collect($room['amenity_ids'] ?? [])->map(fn ($id) => $amenities->get((int) $id))->filter()->values(),
'videoChapter' => $videos->map(fn (Video $video): ?array => $video->chapterForRoom($room['name']))->filter()->first(),
]),
];
}
+27 -4
View File
@@ -2,14 +2,18 @@
namespace App\Themes\Sections;
use App\Availability\NextFreeStays;
use App\Pricing\OfferShowcase;
use App\Themes\Theme;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Schemas\Components\Utilities\Get;
/**
* Large photo with headline and the availability search. Seasonal appearances replace photo and texts.
* Large photo (or a silent video loop) with headline, the availability search and the next free dates.
* Seasonal appearances replace photo and texts.
*/
class HeroSection extends Section
{
@@ -36,7 +40,20 @@ public static function schema(): array
Textarea::make('text')->label('Text')->rows(2)->maxLength(400),
static::photoSelect('photo_ids', 'Fotos', multiple: true)
->helperText('Gezeigt wird das erste Foto, das zum Erscheinungsbild passt; leer = automatisch ein Foto der Wohnung. '.self::SEASON_HINT),
static::videoSelect('video_id', 'Video statt Foto')
->helperText('Läuft stumm in Schleife an der Stelle des Fotos (Webseite › Videos). Bei „Bewegung reduzieren“ und langsamer Verbindung bleibt das Standbild des Videos stehen.'),
Toggle::make('show_search')->label('Verfügbarkeitssuche anzeigen')->default(true),
Toggle::make('show_free_dates')
->label('Nächste freie Termine zeigen')
->helperText('Bis zu drei buchbare Zeiträume mit Gesamtpreis; ein Klick öffnet die Anfrage mit diesen Daten.')
->default(true)
->live(),
Select::make('free_dates_nights')
->label('Mindestens … Nächte')
->options(array_combine(range(2, 7), array_map(fn (int $nights): string => "{$nights} Nächte", range(2, 7))))
->default(3)
->selectablePlaceholder(false)
->visible(fn (Get $get): bool => (bool) $get('show_free_dates')),
Toggle::make('show_offer')
->label('Hervorgehobenes Sonderangebot im Titelbereich zeigen')
->helperText('Das wichtigste als „hervorgehoben“ markierte Angebot, sofern gerade eins gilt.')
@@ -46,18 +63,24 @@ public static function schema(): array
public function data(Theme $theme, array $data): array
{
$featuredOffer = ($data['show_offer'] ?? true) && $theme->property()
? app(OfferShowcase::class)->current($theme->property(), limit: 1, featuredOnly: true)->first()
$property = $theme->property();
$featuredOffer = ($data['show_offer'] ?? true) && $property
? app(OfferShowcase::class)->current($property, limit: 1, featuredOnly: true)->first()
: null;
$freeStays = ($data['show_free_dates'] ?? false) && $property
? app(NextFreeStays::class)->for($property, nights: (int) ($data['free_dates_nights'] ?? 3))
: [];
return [
'eyebrow' => $theme->text('hero.eyebrow', $data['eyebrow'] ?? null),
'title' => $theme->text('hero.title', $data['title'] ?? $theme->site->name),
'text' => $theme->text('hero.text', $data['text'] ?? null),
'photo' => $this->chosenPhotos($theme, $data['photo_ids'] ?? [])->first() ?? $this->automaticPhotos($theme, limit: 1)->first(),
'video' => $this->video($data['video_id'] ?? null),
'freeStays' => $freeStays,
'featuredOffer' => $featuredOffer,
'showSearch' => (bool) ($data['show_search'] ?? true),
'property' => $theme->property(),
'property' => $property,
];
}
}
+22
View File
@@ -6,6 +6,7 @@
use App\Filament\Forms\Components\PhotoSelect;
use App\Models\Page;
use App\Models\Photo;
use App\Models\Video;
use App\Themes\Theme;
use Filament\Forms\Components\Radio;
use Filament\Forms\Components\RichEditor\RichContentRenderer;
@@ -173,6 +174,27 @@ protected static function photoSelect(string $name, string $label, bool $multipl
->multiple($multiple);
}
/**
* Select field listing the website videos (Admin › Webseite › Videos).
*/
protected static function videoSelect(string $name, string $label): Select
{
return Select::make($name)
->label($label)
->options(fn (): array => Video::query()->orderBy('title')->pluck('title', 'id')->all())
->placeholder('– kein Video –');
}
/**
* The chosen video, if it still exists and has a file.
*/
protected function video(mixed $id): ?Video
{
$video = filled($id) ? Video::query()->with('media')->find($id) : null;
return $video?->url() ? $video : null;
}
/**
* Select field listing the pages of the site, for links.
*/
+72
View File
@@ -0,0 +1,72 @@
<?php
namespace App\Themes\Sections;
use App\Themes\Theme;
use Filament\Forms\Components\Radio;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
/**
* A video tour through the apartment: plays only when a guest starts it, chapters jump to a room. Floor plan
* rooms named in a chapter offer "Im Video ansehen" when the tour is on the same page.
*/
class TourSection extends Section
{
public const LAYOUTS = [
'wide' => 'Video in voller Breite, Text darüber',
'left' => 'Video links, Text und Kapitel rechts',
'right' => 'Video rechts, Text und Kapitel links',
];
public static function key(): string
{
return 'tour';
}
public static function label(): string
{
return 'Rundgang (Video)';
}
public static function icon(): string
{
return 'heroicon-o-film';
}
public static function schema(): array
{
return [
TextInput::make('eyebrow')->label('Kleine Überschrift')->maxLength(100),
TextInput::make('heading')->label('Überschrift')->default('Ein Rundgang durch die Wohnung')->maxLength(160),
Textarea::make('text')->label('Text')->rows(3)->maxLength(600),
static::videoSelect('video_id', 'Video')
->helperText('Webseite › Videos. Das Video lädt erst, wenn Besucher es starten – die Seite bleibt schnell.')
->required(),
Radio::make('layout')
->label('Anordnung')
->options(self::LAYOUTS)
->default('left')
->required(),
Toggle::make('show_chapters')
->label('Kapitel als Knöpfe zeigen')
->helperText('Die Kapitel pflegen Sie am Video.')
->default(true),
];
}
public function data(Theme $theme, array $data): array
{
$video = $this->video($data['video_id'] ?? null);
return [
'eyebrow' => $data['eyebrow'] ?? null,
'heading' => $data['heading'] ?? null,
'text' => $data['text'] ?? null,
'video' => $video,
'chapters' => ($data['show_chapters'] ?? true) && $video ? $video->chapterList() : [],
'layout' => array_key_exists($data['layout'] ?? '', self::LAYOUTS) ? $data['layout'] : 'left',
];
}
}