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
@@ -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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user