Führe Abschnitte mit Raster, gemeinsames Designsystem und globales Website-Gerüst ein.
CI Feature / test (push) Failing after 20s
CI Feature / test (push) Failing after 20s
- Seite → Abschnitte → Plätze → Widgets: sechs Raster mit höchstens vier Einheiten, Hintergrund, Breite, Abstand und Trenner als Aufzählungswerte; je Platz ein Widget aus dem bestehenden Register. Neue Spalte page_revisions.sections (ergänzend); blocks erhält weiterhin alle Widgets in Lesereihenfolge als Rollback-Fassung. - Widgets erhalten Mindest- und Vorzugsbreite; Darstellung über Container-Abfragen. - Editor: Abschnitts-Repeater mit grafischer Rasterauswahl, Plätzen im Rasterverhältnis, breiter Arbeitsfläche, kompakten Vorschauen ohne Bildlaufleiste, Meldungen mit Abschnitt und Platz; Rasterwechsel entfernt nie ein Widget. Seite duplizieren. - Designsystem: Marken- und Bedeutungs-Tokens (vorläufig), gemeinsame Grundkomponenten, Nunito/Source Sans 3 lokal; Mitgliederbereich nutzt dieselben Tokens und die Wortmarke. - Kopfzeile, mobile Navigation, Untermenü (parent_id, ergänzend), Fußbereichsgruppen, vorbereiteter Warenkorbzugang (abgeschaltet). Öffentliche Seiten gleich für alle Besucher. - cms:revert-published als Wiederherstellungsweg vor einem Code-Rollback. Die Editor-Tests der ersten Iteration sind bewusst auf den neuen Formularzustand (sections statt blocks) umgestellt; ihre Prüfungen gelten unverändert für die Widgets. Der Vorschautest erwartet keine anmeldeabhängige Kopfzeile mehr (ADR-32). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
db4bd30319
commit
480d55989b
57 files changed
+4730
-818
No files matched your search
@@ -6,12 +6,25 @@
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class NavigationItem extends Model
|
||||
{
|
||||
/**
|
||||
* Plätze im globalen Website-Gerüst. Die drei Fußbereichsgruppen ersetzen eine eigene Footer-Verwaltung.
|
||||
*/
|
||||
public const PLACEMENTS = [
|
||||
'header' => 'Kopfzeile',
|
||||
'footer' => 'Fußzeile',
|
||||
'header' => 'Kopfzeile (Hauptnavigation)',
|
||||
'footer' => 'Fußbereich: Service',
|
||||
'footer_contact' => 'Fußbereich: Kontakt',
|
||||
'footer_legal' => 'Fußbereich: Rechtliches',
|
||||
];
|
||||
|
||||
/** Spaltenüberschriften im Fußbereich. */
|
||||
public const FOOTER_GROUPS = [
|
||||
'footer' => 'Service',
|
||||
'footer_contact' => 'Kontakt',
|
||||
'footer_legal' => 'Rechtliches',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
@@ -21,8 +34,19 @@ class NavigationItem extends Model
|
||||
'placement',
|
||||
'sort_order',
|
||||
'is_visible',
|
||||
'parent_id',
|
||||
];
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
// Untermenüs gibt es nur in der Hauptnavigation.
|
||||
static::saving(function (NavigationItem $item): void {
|
||||
if ($item->placement !== 'header' && $item->getAttribute('parent_id') !== null) {
|
||||
$item->parent_id = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -35,6 +59,16 @@ public function page(): BelongsTo
|
||||
return $this->belongsTo(Page::class);
|
||||
}
|
||||
|
||||
public function parent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(self::class, 'parent_id');
|
||||
}
|
||||
|
||||
public function children(): HasMany
|
||||
{
|
||||
return $this->hasMany(self::class, 'parent_id')->orderBy('sort_order')->orderBy('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Builder<NavigationItem> $query
|
||||
*/
|
||||
@@ -59,4 +93,22 @@ public function href(): ?string
|
||||
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pfad des Ziels innerhalb der Website (für die Kennzeichnung des aktiven Eintrags); null bei externen Zielen.
|
||||
*/
|
||||
public function targetPath(): ?string
|
||||
{
|
||||
if ($this->page !== null) {
|
||||
return $this->page->path;
|
||||
}
|
||||
|
||||
if (is_string($this->url) && str_starts_with($this->url, '/') && ! str_starts_with($this->url, '//')) {
|
||||
$path = parse_url($this->url, PHP_URL_PATH);
|
||||
|
||||
return is_string($path) ? '/'.trim($path, '/') : null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user