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:
1 parent
f5f18cd984
commit
d42c42059c
38 files changed
+1279
-23
No files matched your search
@@ -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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user