Phase 6, Anwendungsseite: Bildwelten und die Marke je Website
Die Theme-Sitzung wartete darauf: Seebad ruft schon ortsneutrale Plätze über `partials/motif` auf und behilft sich mit einem eigenen `motifs/`- Ordner. Der Kommentar dort sagt es selbst – „so a later picture-world system can replace the mapping below". Das System gibt es jetzt. **Bildwelten** (A18–A20) sind Pakete wie Themes: `resources/image-worlds/ <key>/` mit `world.json` und `svg/`. Eine Website wählt eine Bildwelt, eine Wohnung darf eine andere tragen – das ist der Platz für die Bergwohnung auf einer Küsten-Website. Vorlagen fragen über `$theme->motif($slot)` nach einem Platz, nie nach einer Datei. Die Render-Logik ist aus Seebads Partial in die Anwendung gewandert, damit jedes Theme sie bekommt: Inline-SVG (nimmt die Textfarbe an, kein zweiter Request), Titel und ARIA entfernt, und die internen Ids je Aufruf eindeutig gemacht – zwei Kopien derselben Grafik auf einer Seite würden sonst auf denselben Verlauf zeigen und eine davon verlöre ihre Farben. Ein leerer Platz ist kein Fehler: die Vorlage bekommt schlicht keine Dekoration. Weil das leicht zu übersehen ist, meldet `php artisan image-worlds:check`, welcher Platz ohne Datei dasteht. **Marke je Website** (A14/A22): Logo, Favicon und ein Logo für E-Mail und Vertrag als Medien der Website. Der Mietvertrag bettet die Datei ein statt eine URL zu holen – er wird auf dem Server gerendert und darf nicht davon abhängen, dass dieser sich selbst erreicht. Ohne Logo bleibt der Vertrag wie bisher. `resources/themes/**` ist unberührt: die Ostsee-Grafiken sind kopiert, nicht verschoben. Was die Theme-Sitzung nun tun kann, steht in ZUSAMMENARBEIT.md §6; ihr Wunsch aus §5 ist als erledigt vermerkt. 272 Feature-Tests grün. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f686996122
commit
4e66add1f0
28 files changed
+906
-5
No files matched your search
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Themes;
|
||||
|
||||
use App\ImageWorlds\ImageWorldManifest;
|
||||
use App\ImageWorlds\MotifRenderer;
|
||||
use App\Models\Appearance;
|
||||
use App\Models\Page;
|
||||
use App\Models\Photo;
|
||||
@@ -9,6 +11,7 @@
|
||||
use App\Models\Site;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
/**
|
||||
* The theme context of the current request: site, theme chain and appearance. Activating it registers the
|
||||
@@ -128,6 +131,39 @@ public function appearanceKey(): string
|
||||
return $this->appearance ? str($this->appearance->name)->slug()->toString() : 'standard';
|
||||
}
|
||||
|
||||
/**
|
||||
* A brand graphic of this website (logo, favicon, document logo), or null when none was uploaded.
|
||||
* The brand belongs to the landlord; the picture world belongs to the look. Templates that fall back
|
||||
* to their own graphic should ask for this first (A14/A22).
|
||||
*/
|
||||
public function brand(string $collection): ?string
|
||||
{
|
||||
return $this->site->exists ? $this->site->brandUrl($collection) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The graphic behind a picture-world slot (divider, closing, vignette.beach …). Templates ask for a
|
||||
* slot, never for a file, so the same template works in every picture world (A18/A19).
|
||||
*/
|
||||
public function motif(string $slot, ?string $class = null, ?string $label = null): HtmlString
|
||||
{
|
||||
return app(MotifRenderer::class)->render($slot, $class, $label);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the current picture world fills this slot – for templates that want to leave out a whole
|
||||
* decorative block instead of rendering an empty one.
|
||||
*/
|
||||
public function hasMotif(string $slot): bool
|
||||
{
|
||||
return app(MotifRenderer::class)->has($slot);
|
||||
}
|
||||
|
||||
public function imageWorld(): ?ImageWorldManifest
|
||||
{
|
||||
return app(MotifRenderer::class)->world();
|
||||
}
|
||||
|
||||
public function property(): ?Property
|
||||
{
|
||||
if (! $this->propertyResolved) {
|
||||
|
||||
Reference in new issue
Block a user