- Sites (Domain, Theme, Farben; mehrfähig für weitere Vermieter), Seiten aus Bausteinen mit Menüs, Erscheinungsbilder mit jährlichem Zeitplan, Priorität und signierter Vorschau - Theme-Kern (app/Themes): Manifest, Registry, Vererbung (Child-Themes), Token-Farben als CSS-Variablen, Bausteinkatalog als Registry (config/themes.php) - 15 Bausteine: Titelbereich mit Suche, Eckdaten, Text mit Bildern, Galerie, Ausstattung, Lage, Preise, Angebote, Kalender & Anfrage, Bewertungen, Gastgeber, FAQ, Abschluss, Kontakt, Fließtext - Theme Ostsee-Licht: Layout, Kopf/Fuß, Banner, mobile Buchungsleiste, Lightbox, selbst gehostete Schriften, Reduced Motion - Seiten Start, Wohnung, Kühlungsborn, Preise & Buchung, Kontakt, Impressum, Datenschutz; Sitemap, robots.txt, JSON-LD - Admin: Seiten-Baukasten, Erscheinungsbilder, Websites - Dokumentation docs/THEMES.md inkl. Übergabe für die Design-Sitzung Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58 lines
1.7 KiB
PHP
58 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Themes\Sections;
|
|
|
|
use App\Enums\PhotoCategory;
|
|
use App\Models\Photo;
|
|
use App\Themes\Theme;
|
|
use Filament\Forms\Components\RichEditor;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Forms\Components\Toggle;
|
|
|
|
/**
|
|
* Location: text, photos of the area and a map link (no embedded third-party map, so no consent needed).
|
|
*/
|
|
class LocationSection extends Section
|
|
{
|
|
public static function key(): string
|
|
{
|
|
return 'location';
|
|
}
|
|
|
|
public static function label(): string
|
|
{
|
|
return 'Lage & Umgebung';
|
|
}
|
|
|
|
public static function icon(): string
|
|
{
|
|
return 'heroicon-o-map-pin';
|
|
}
|
|
|
|
public static function schema(): array
|
|
{
|
|
return [
|
|
TextInput::make('eyebrow')->label('Kleine Überschrift')->maxLength(100),
|
|
TextInput::make('heading')->label('Überschrift')->required()->maxLength(160),
|
|
RichEditor::make('text')->label('Text')->toolbarButtons([['bold', 'italic', 'link'], ['bulletList']]),
|
|
Toggle::make('show_photos')->label('Bilder der Umgebung zeigen')->default(true),
|
|
];
|
|
}
|
|
|
|
public function data(Theme $theme, array $data): array
|
|
{
|
|
$address = $theme->property()?->address;
|
|
|
|
return [
|
|
'eyebrow' => $data['eyebrow'] ?? null,
|
|
'heading' => $data['heading'] ?? '',
|
|
'text' => $this->html($data['text'] ?? null),
|
|
'address' => $address,
|
|
'mapUrl' => $address ? 'https://www.openstreetmap.org/search?query='.rawurlencode($address) : null,
|
|
'photos' => ($data['show_photos'] ?? true)
|
|
? Photo::query()->published()->with('media')->where('category', PhotoCategory::Area)->limit(6)->get()
|
|
: collect(),
|
|
];
|
|
}
|
|
}
|