Zeige auf der Shopkachel Titelbild, Saeulen, Materialart mit Symbol und Marker
- ShopCatalog als gemeinsame Datenquelle der Kacheln, shop/kachel als Partial - Titelbild nur mit Website-Freigabe (PresentationMedia::coverPresentation), schmueckend mit leerem alt - Symbol je Materialart (Stammdaten), Marker Neu, Aktualisiert, Beliebt mit Einstellung am Artikel - Migration 2026_12_01_100000, rein ergaenzend - ADR-54, Plan, DEPLOYMENT.md Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
db3a6ba779
commit
0ac70884cc
18 files changed
+991
-88
No files matched your search
@@ -14,6 +14,8 @@
|
||||
use App\Filament\Resources\LicenseArticles\LicenseArticleResource;
|
||||
use App\Filament\Resources\Pillars\PillarResource;
|
||||
use App\Filament\Support\EditorialCatalog;
|
||||
use App\Filament\Support\SymbolField;
|
||||
use App\Support\Brand\SymbolCatalog;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\ActionGroup;
|
||||
use Filament\Forms\Components\Checkbox;
|
||||
@@ -261,6 +263,8 @@ private function formular(?Model $record): array
|
||||
];
|
||||
|
||||
if ($this->istMaterialart()) {
|
||||
$felder[] = SymbolField::make('symbol', 'Symbol im Shop')
|
||||
->helperText('Optional. Das Symbol steht auf der Shopkachel bei Artikeln dieser Materialart, auch wenn kein Bild gepflegt ist.');
|
||||
$system = $record instanceof EditorialContentKind && $record->isSystem();
|
||||
$felder[] = CheckboxList::make('contexts')
|
||||
->label('Zulässig für')
|
||||
@@ -325,6 +329,7 @@ private function bearbeitenAction(): Action
|
||||
->schema(fn (Model $record): array => $this->formular($record))
|
||||
->fillForm(fn (Model $record): array => [
|
||||
'label' => $record->label,
|
||||
'symbol' => $record instanceof EditorialContentKind ? $record->symbol : null,
|
||||
'contexts' => $record instanceof EditorialContentKind ? (array) ($record->contexts ?? []) : [],
|
||||
])
|
||||
->modalSubmitActionLabel('Speichern')
|
||||
@@ -337,11 +342,21 @@ private function bearbeitenAction(): Action
|
||||
$record->contexts = $this->kontexte((array) $data['contexts']);
|
||||
}
|
||||
|
||||
if ($record instanceof EditorialContentKind) {
|
||||
$record->symbol = $this->symbol($data['symbol'] ?? null);
|
||||
}
|
||||
|
||||
$record->save();
|
||||
Notification::make()->success()->title('Gespeichert')->body('Die neue Bezeichnung gilt sofort in Redaktion, Filtern und Picker.')->send();
|
||||
});
|
||||
}
|
||||
|
||||
/** Ein Symbol wird nur gespeichert, wenn die Symbolbibliothek es kennt; sonst bleibt die Materialart ohne Symbol. */
|
||||
private function symbol(mixed $value): ?string
|
||||
{
|
||||
return is_string($value) && array_key_exists($value, SymbolCatalog::options()) ? $value : null;
|
||||
}
|
||||
|
||||
private function anlegen(array $data): void
|
||||
{
|
||||
$label = trim((string) $data['label']);
|
||||
@@ -354,6 +369,7 @@ private function anlegen(array $data): void
|
||||
'sort_order' => (int) EditorialContentKind::query()->max('sort_order') + 10,
|
||||
'is_active' => true,
|
||||
'contexts' => $this->kontexte((array) ($data['contexts'] ?? [])),
|
||||
'symbol' => $this->symbol($data['symbol'] ?? null),
|
||||
]);
|
||||
} else {
|
||||
$dimension = $this->dimension();
|
||||
|
||||
Reference in new issue
Block a user