Mache die Inhaltsverwaltung fuer die Redaktion bedienbar
Deploy Test / test (push) Successful in 18s
Deploy Test / deploy (push) Successful in 22s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-16 08:59:30 +01:00
1 parent 9b52181be1
commit d6ff881e4e
10 files changed
+371 -49

No files matched your search

@@ -31,32 +31,30 @@ protected function getHeaderActions(): array
->label('Medium anlegen')
->visible(fn (): bool => ContentElementResource::editor())
->schema([
TextInput::make('working_title')->label('Arbeitstitel')->required(),
Select::make('kind')->label('Art')->options([
TextInput::make('working_title')->label('Titel')->required(),
Select::make('shape')->label('Was ist das?')->options([
'film' => 'Film',
'audio' => 'Audio',
'audio' => 'Hörstück',
'bild' => 'Bild',
'pdf' => 'PDF',
'document' => 'Dokument',
'text' => 'Text',
'aufgabe' => 'Aufgabe',
])->required(),
Select::make('output_class')->label('Ausgabeklasse')->options([
'film' => 'Film',
'audio' => 'Audio',
'bild' => 'Bild',
'pdf' => 'PDF',
'text' => 'Text',
])->required(),
Textarea::make('body')->label('Text'),
EditContentElement::uploadField(),
TextInput::make('decision_seconds')->label('Entscheidungsmarke in Sekunden')->numeric()->minValue(0),
TextInput::make('change_note')->label('Änderungsnotiz'),
])->required()->live(),
Textarea::make('body')->label('Text')->visible(fn ($get): bool => $get('shape') === 'text'),
EditContentElement::uploadField()->visible(fn ($get): bool => $get('shape') !== 'text'),
TextInput::make('change_note')->label('Notiz zur ersten Fassung'),
])
->action(function (array $data): void {
$element = null;
$this->report(function () use ($data, &$element): void {
$service = app(ContentService::class);
$element = $service->createElement($data['kind'], $data['output_class'], $data['working_title']);
[$kind, $output] = match ($data['shape']) {
'audio' => ['audio', 'audio'],
'bild' => ['bild', 'bild'],
'document' => ['dokument', 'document'],
'text' => ['text', 'text'],
default => ['film', 'film'],
};
$element = $service->createElement($kind, $output, $data['working_title']);
$metadata = [];
$incoming = IncomingFile::store($data['incoming'] ?? null);