Lasse Präsentationsmedien ohne Inhaltsfassung zu.
CI Feature / test (push) Successful in 53s
Deploy Test / test (push) Successful in 48s
Deploy Test / deploy (push) Successful in 22s

Bilder, Filme und Hörstücke lassen sich zuordnen und für die Website freigeben, ohne eine fachliche Fassung anzulegen. Unterrichtsfilme behalten die Teaserfassung an ihrer bereitgestellten Fassung.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-19 08:20:35 +01:00
1 parent 5590225f4f
commit 7b325f0d66
25 files changed
+734 -93

No files matched your search

+16 -6
View File
@@ -7,7 +7,9 @@
use App\Domain\Catalog\ContentService;
use App\Domain\Catalog\DomainRuleException;
use App\Domain\Catalog\IdentityProfile;
use App\Domain\Media\PresentationFile;
use App\Jobs\DeriveThumbnail;
use Filament\Forms\Components\Checkbox;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea;
@@ -39,6 +41,10 @@ public static function fields(bool $creating, ?ContentElement $element = null):
$fields[] = self::fileField()
->visible(fn ($get): bool => filled($get('shape')) && $get('shape') !== 'text')
->required(fn ($get): bool => filled($get('shape')) && $get('shape') !== 'text');
$fields[] = Checkbox::make('without_version')
->label('Eigenständiges Präsentationsmedium')
->helperText('Bild, Film oder Hörstück ohne fachliche Inhaltsfassung. Die Datei bleibt eine technische Ableitung am Medium. Sie wird nicht lizenziert und nicht automatisch für die Website freigegeben.')
->visible(fn ($get): bool => in_array($get('shape'), ['film', 'audio', 'bild'], true));
} elseif ($element?->output_class === 'text') {
$fields[] = Textarea::make('body')->label('Text')->rows(8)->required();
}
@@ -120,13 +126,17 @@ public static function create(array $data, bool $hold): ContentElement
throw new DomainRuleException('Diese Datei passt nicht zur gewählten Art.');
}
$metadata = ['incoming' => $incoming];
if ($hold) {
$metadata['hold'] = true;
$service->draftElementVersion($element, null, $metadata);
if (! empty($data['without_version']) && in_array($output, ['bild', 'film', 'audio'], true)) {
app(PresentationFile::class)->store($element, $incoming);
} else {
$service->publishElementVersion($element, null, $metadata);
$metadata = ['incoming' => $incoming];
if ($hold) {
$metadata['hold'] = true;
$service->draftElementVersion($element, null, $metadata);
} else {
$service->publishElementVersion($element, null, $metadata);
}
}
}