Offers by their own rules, seasonal photos per section, theme authoring tooling
- 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>
This commit is contained in:
1 parent
bc77b64ea7
commit
7d0bc93abc
50 files changed
+2805
-259
No files matched your search
@@ -34,6 +34,7 @@ public function activate(): self
|
||||
{
|
||||
$paths = array_map(fn (ThemeManifest $theme): string => $theme->viewsPath(), $this->chain());
|
||||
View::replaceNamespace('theme', $paths);
|
||||
View::getFinder()->flush();
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -96,6 +97,32 @@ public function heroPhoto(?Photo $fallback = null): ?Photo
|
||||
return $this->appearance?->heroPhoto ?? $fallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Photo ids the active appearance sets for a slot of a placed section ("Bilder je Baustein").
|
||||
*
|
||||
* @return list<int>
|
||||
*/
|
||||
public function sectionPhotoIds(?string $sectionId, string $slot): array
|
||||
{
|
||||
if (blank($sectionId) || $this->appearance === null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$ids = $this->appearance->section_photos[$sectionId][$slot] ?? null;
|
||||
|
||||
return array_values(array_map('intval', array_filter((array) $ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether seasonal photos replace the automatic photos of a section ('replace') or come first ('prepend').
|
||||
*/
|
||||
public function sectionPhotoMode(?string $sectionId): string
|
||||
{
|
||||
$mode = $sectionId ? ($this->appearance?->section_photos[$sectionId]['mode'] ?? null) : null;
|
||||
|
||||
return $mode === 'prepend' ? 'prepend' : 'replace';
|
||||
}
|
||||
|
||||
public function appearanceKey(): string
|
||||
{
|
||||
return $this->appearance ? str($this->appearance->name)->slug()->toString() : 'standard';
|
||||
|
||||
Reference in new issue
Block a user