Ordne Paket, Rechteprofil, Säulen, Kombinationen und Benutzer in die gemeinsamen Muster ein.
- Gemeinsame Katalog-Objektseite (catalog/objekt): Kopf, Hauptabschnitte, Begleitinformation. Angebot, Paket und Rechteprofil nutzen sie; lesbare Bezeichnungen zentral in CatalogLabels. - Paket: eine Maske für erste und geänderte Fassung, bei einer Änderung mit der neuesten veröffentlichten Fassung vorbelegt; Wirkung unverändert BundleService::publish (frühere Fassungen bleiben veröffentlicht). - Rechteprofil: erlaubte Handlungen lesbar, Verwendung in Angeboten, Fassungen; der doppelte Titel „… ansehen ansehen“ entfällt. - Fachliche Säulen, Fachliche Kombinationen und Benutzer in der gemeinsamen Bestandsliste; Säulen mit Website-Zustand und Medienzahl, Konten mit Status und Rollen. - Gefüllte Filament-Hauptknöpfe überall im Verwaltungsgrün (auch Formularfuß, etwa „Speichern“ der Säule). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3aa1bad859
commit
51d58ac55c
14 files changed
+675
-198
No files matched your search
@@ -5,6 +5,7 @@
|
||||
use App\Domain\Catalog\OfferService;
|
||||
use App\Domain\Catalog\RightsProfile;
|
||||
use App\Filament\Resources\RightsProfiles\RightsProfileResource;
|
||||
use App\Filament\Support\CatalogLabels;
|
||||
use App\Filament\Support\ListsCatalog;
|
||||
use App\Filament\Support\ReportsDomainRules;
|
||||
use Filament\Actions\Action;
|
||||
@@ -19,19 +20,6 @@ class ListRightsProfiles extends ListRecords
|
||||
use ListsCatalog;
|
||||
use ReportsDomainRules;
|
||||
|
||||
/** Lesbare Fähigkeiten; dieselben Werte wie im Anlegedialog. */
|
||||
public const FAEHIGKEITEN = [
|
||||
'film:streamen' => 'Film ansehen',
|
||||
'film:laden' => 'Film herunterladen',
|
||||
'audio:streamen' => 'Hörstück ansehen',
|
||||
'document:ansehen' => 'Dokument ansehen',
|
||||
'document:laden' => 'Dokument herunterladen',
|
||||
'pdf:ansehen' => 'PDF ansehen',
|
||||
'pdf:laden' => 'PDF herunterladen',
|
||||
'text:ansehen' => 'Text ansehen',
|
||||
'bild:ansehen' => 'Bild ansehen',
|
||||
];
|
||||
|
||||
protected static string $resource = RightsProfileResource::class;
|
||||
|
||||
public function getSubheading(): string|Htmlable|null
|
||||
@@ -53,7 +41,7 @@ protected function getHeaderActions(): array
|
||||
'kommerziell' => 'Kommerziell',
|
||||
'institutionell' => 'Institutionell',
|
||||
])->required(),
|
||||
CheckboxList::make('capabilities')->label('Fähigkeiten')->options(self::FAEHIGKEITEN)->required(),
|
||||
CheckboxList::make('capabilities')->label('Fähigkeiten')->options(CatalogLabels::FAEHIGKEITEN)->required(),
|
||||
])->action(function (array $data): void {
|
||||
$this->report(function () use ($data): void {
|
||||
$capabilities = [];
|
||||
@@ -75,20 +63,8 @@ protected function catalogRows(): array
|
||||
|
||||
foreach (RightsProfile::query()->with('versions')->orderBy('name')->get() as $profile) {
|
||||
$version = $profile->versions->sortByDesc('number')->first();
|
||||
$faehigkeiten = [];
|
||||
|
||||
foreach ($version?->capabilities ?? [] as $class => $actions) {
|
||||
foreach ((array) $actions as $action) {
|
||||
$faehigkeiten[] = self::FAEHIGKEITEN[$class.':'.$action] ?? $class.': '.$action;
|
||||
}
|
||||
}
|
||||
|
||||
$purpose = match ((string) $version?->purpose) {
|
||||
'ehrenamtlich' => 'Ehrenamtlich',
|
||||
'kommerziell' => 'Kommerziell',
|
||||
'institutionell' => 'Institutionell',
|
||||
default => (string) $version?->purpose,
|
||||
};
|
||||
$faehigkeiten = CatalogLabels::faehigkeiten($version?->capabilities);
|
||||
$purpose = CatalogLabels::zweck($version?->purpose);
|
||||
$chips = $version === null
|
||||
? [['label' => 'Noch keine Fassung', 'ton' => 'offen']]
|
||||
: [['label' => 'Fassung '.$version->number, 'ton' => 'neutral'], ['label' => $purpose, 'ton' => 'leise']];
|
||||
|
||||
Reference in new issue
Block a user