Zeige Medienfassungen in der Verwaltung und halte Beschreibungen davon getrennt.
Eine Fassung bleibt nummeriert und kann deaktiviert werden. Beschreibung und fachliche Säulen gehören zum Medium und legen keine neue Fassung an. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
12f12117dd
commit
af85a94cd5
28 files changed
+1002
-168
No files matched your search
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Pillars\Pages;
|
||||
|
||||
use App\Domain\Catalog\PillarService;
|
||||
use App\Filament\Resources\ContentElements\ContentElementResource;
|
||||
use App\Filament\Resources\Pillars\PillarResource;
|
||||
use App\Filament\Support\ReportsDomainRules;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
|
||||
class ListPillars extends ListRecords
|
||||
{
|
||||
use ReportsDomainRules;
|
||||
|
||||
protected static string $resource = PillarResource::class;
|
||||
|
||||
public function getSubheading(): string|Htmlable|null
|
||||
{
|
||||
return 'Die fachlichen Säulen des Materials. Es können weitere hinzukommen. Ein Medium kann mehreren Säulen zugeordnet sein.';
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('create')
|
||||
->label('Säule anlegen')
|
||||
->visible(fn (): bool => ContentElementResource::editor())
|
||||
->schema([
|
||||
TextInput::make('name')->label('Name')->required(),
|
||||
])
|
||||
->action(function (array $data): void {
|
||||
$pillar = null;
|
||||
$this->report(function () use ($data, &$pillar): void {
|
||||
$pillar = app(PillarService::class)->create($data['name']);
|
||||
}, 'Die Säule ist angelegt.');
|
||||
|
||||
if ($pillar !== null) {
|
||||
$this->redirect(PillarResource::getUrl('edit', ['record' => $pillar]));
|
||||
}
|
||||
}),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user