- Special offers: kinds (rule, fixed dates, gap filler), package price, priority, highlight;
GapFinder detects calendar gaps (optionally waiving the minimum stay); OfferShowcase decides
what the website advertises and prices fixed dates/gaps with PriceCalculator; offers section
shows them side by side, as a list or rotating; hero can show the top offer. Appearances no
longer carry a featured offer.
- Sections get stable ids; appearances set photos per section ("Bilder je Baustein") and
sections can be limited to appearances. Photo pickers show thumbnails everywhere.
- Themes: themes:make (scaffold, never overwrites), themes:check (contract, build, markup,
colours, external resources, WCAG contrast), themes:preview (signed links per page and
appearance), signed ?theme= preview and preview action in the site form, inherited colour
tokens in the admin. Base CSS split into theme.css + reusable theme-base.css.
- docs/THEME-ERSTELLUNG.md: binding guide for building additional themes elsewhere.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
57 lines
1.7 KiB
PHP
57 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Themes\Sections;
|
|
|
|
use App\Models\Photo;
|
|
use App\Themes\Theme;
|
|
use Filament\Forms\Components\Textarea;
|
|
use Filament\Forms\Components\TextInput;
|
|
|
|
/**
|
|
* Closing invitation with photo and button; seasonal appearances may replace the texts.
|
|
*/
|
|
class CallToActionSection extends Section
|
|
{
|
|
public static function key(): string
|
|
{
|
|
return 'cta';
|
|
}
|
|
|
|
public static function label(): string
|
|
{
|
|
return 'Abschluss mit Aufruf';
|
|
}
|
|
|
|
public static function icon(): string
|
|
{
|
|
return 'heroicon-o-cursor-arrow-rays';
|
|
}
|
|
|
|
public static function schema(): array
|
|
{
|
|
return [
|
|
TextInput::make('title')->label('Überschrift')->required()->maxLength(160),
|
|
Textarea::make('text')->label('Text')->rows(2),
|
|
static::photoSelect('photo_id', 'Hintergrundfoto'),
|
|
TextInput::make('button_label')->label('Button-Text')->default('Belegung & Preise')->maxLength(60),
|
|
static::pageSelect('button_page', 'Button führt zu'),
|
|
];
|
|
}
|
|
|
|
public static function photoSlots(): array
|
|
{
|
|
return ['photo_id' => ['label' => 'Hintergrundfoto', 'type' => self::SLOT_SINGLE]];
|
|
}
|
|
|
|
public function data(Theme $theme, array $data): array
|
|
{
|
|
return [
|
|
'title' => $theme->text('cta.title', $data['title'] ?? null),
|
|
'text' => $theme->text('cta.text', $data['text'] ?? null),
|
|
'photo' => $this->seasonalPhoto($theme, $data, 'photo_id') ?? (isset($data['photo_id']) ? Photo::find($data['photo_id']) : null),
|
|
'buttonLabel' => $data['button_label'] ?? 'Belegung & Preise',
|
|
'buttonUrl' => $this->pageUrl($data['button_page'] ?? null) ?? route('booking.create'),
|
|
];
|
|
}
|
|
}
|