diff --git a/app/Domain/Media/ThumbnailDeriver.php b/app/Domain/Media/ThumbnailDeriver.php index 6be195c..dcd6ff6 100644 --- a/app/Domain/Media/ThumbnailDeriver.php +++ b/app/Domain/Media/ThumbnailDeriver.php @@ -58,6 +58,91 @@ public function forCompositionFromElement(Composition $composition, ContentEleme $this->rememberChoice($composition, 'element:'.$element->id); } + public function forCompositionFrame(Composition $composition, ContentElementVersion $version, float $seconds): void + { + $version->loadMissing('element'); + + if ($version->element?->output_class !== 'film') { + $this->failComposition($composition, 'Aus dieser Filmstelle ließ sich kein Titelbild erzeugen.'); + + return; + } + + $bytes = $this->jpegAtVersion($version, $seconds); + + if (! is_string($bytes)) { + $this->failComposition($composition, 'Aus dieser Filmstelle ließ sich kein Titelbild erzeugen.'); + + return; + } + + $name = 'komposition-'.$composition->id; + $path = 'vorschau/'.$name.'.jpg'; + Storage::disk('media_derived')->put($path, $bytes); + $this->still($composition, Storage::disk('media_derived'), $path, $name); + $this->rememberChoice($composition, 'frame:'.$version->id.'@'.$this->secondText($seconds)); + } + + public function jpegAtVersion(ContentElementVersion $version, float $seconds): ?string + { + $file = is_array($version->metadata) ? ($version->metadata['file'] ?? null) : null; + + if (! is_string($file) || $file === '' || str_contains($file, '..') || ! str_starts_with($file, 'inhalte/')) { + return null; + } + + if ($seconds < 0 || $seconds > 7200) { + return null; + } + + $disk = Storage::disk('media_derived'); + + if (! $disk->exists($file)) { + return null; + } + + $binary = (new ExecutableFinder)->find('ffmpeg'); + + if ($binary === null) { + return null; + } + + $process = new Process([ + $binary, + '-hide_banner', + '-loglevel', + 'error', + '-i', + $disk->path($file), + '-ss', + $this->secondText($seconds), + '-frames:v', + '1', + '-f', + 'image2pipe', + '-vcodec', + 'mjpeg', + 'pipe:1', + ]); + $process->setTimeout(30); + $process->run(); + $bytes = $process->getOutput(); + + if (! $process->isSuccessful() || ! str_starts_with($bytes, "\xFF\xD8")) { + return null; + } + + return $bytes; + } + + private function secondText(float $seconds): string + { + $seconds = max(0, min(7200, $seconds)); + $text = number_format($seconds, 3, '.', ''); + + return rtrim(rtrim($text, '0'), '.') ?: '0'; + } + private function frame(ContentElement $element, string $file): void { $binary = (new ExecutableFinder)->find('ffmpeg'); diff --git a/app/Filament/Resources/Compositions/Pages/EditComposition.php b/app/Filament/Resources/Compositions/Pages/EditComposition.php index e626f89..47132f6 100644 --- a/app/Filament/Resources/Compositions/Pages/EditComposition.php +++ b/app/Filament/Resources/Compositions/Pages/EditComposition.php @@ -20,6 +20,8 @@ use App\Domain\Catalog\IdentityProfile; use App\Domain\Catalog\StructureNode; use App\Filament\Support\EditorialCatalog; +use App\Http\Controllers\ContentPreviewController; +use App\Jobs\DeriveCompositionFrame; use App\Jobs\DeriveThumbnail; use App\Models\User; use Filament\Actions\Action; @@ -101,6 +103,26 @@ abstract class EditComposition extends EditRecord public string $imageQuery = ''; + public bool $moduleOpen = false; + + public string $moduleTab = 'beschreibung'; + + public bool $partOpen = false; + + public string $imageMode = 'film'; + + public string $imagePick = ''; + + public ?int $frameVersionId = null; + + public string $frameSecond = ''; + + /** @var array */ + public array $moduleSnapshot = []; + + /** @var list> */ + public array $partSnapshot = []; + /** @var list> */ public array $members = []; @@ -260,6 +282,14 @@ public function hits(): array public function openPicker(): void { + if ($this->moduleOpen) { + $this->closeModule(); + } + + if ($this->partOpen) { + $this->closePart(); + } + $this->pickerOpen = true; $this->textOpen = false; $this->pickerSelected = ''; @@ -296,15 +326,67 @@ public function pickerDetail(): ?array return null; } - return app(EditorialCatalog::class)->rowForTarget( + $row = app(EditorialCatalog::class)->rowForTarget( $this->pickerSelected, (int) $this->getRecord()->getKey(), ); + + if ($row === null) { + return null; + } + + $row['file_url'] = null; + + if (preg_match('/^element:(\d+)$/', (string) $row['target'], $match) === 1) { + $version = ContentElementVersion::query()->find($match[1]); + $row['file_url'] = $version instanceof ContentElementVersion + ? app(ContentPreviewController::class)->fileUrl($version) + : null; + } + + return $row; + } + + /** + * @return list + */ + public function pickerVersions(): array + { + $detail = $this->pickerDetail(); + + if ($detail === null) { + return []; + } + + $options = app(EditorialCatalog::class)->alternatives( + (string) ($detail['identity'] ?? ''), + (int) $this->getRecord()->getKey(), + ); + + if ($options === []) { + return []; + } + + $current = $options[array_key_last($options)]['target']; + + return array_map( + fn (array $option): array => $option + ['current' => $option['target'] === $current], + $options, + ); + } + + public function pickerMatches(string $identity): bool + { + $detail = $this->pickerDetail(); + + return $detail !== null && ($detail['identity'] ?? '') === $identity; } public function openText(): void { $this->pickerOpen = false; + $this->moduleOpen = false; + $this->partOpen = false; $this->textOpen = true; } @@ -611,7 +693,12 @@ public function addPart(string $target): void $this->search = ''; $this->pickerOpen = false; $this->pickerSelected = ''; - $this->feedback = $row['title'].' ist in den Aufbau übernommen. Die Datei wird nicht kopiert. Gespeichert ist das erst mit „Entwurf speichern“.'; + + if (! $this->persistDraft()) { + return; + } + + $this->feedback = $row['title'].' ist in den Aufbau übernommen. Die Datei wird nicht kopiert. Der Entwurf ist gespeichert. Es entsteht keine neue Fassung.'; } public function removePart(int $index): void @@ -625,7 +712,9 @@ public function removePart(int $index): void $this->selected = null; $this->roleDraft = ''; $this->panel = 'angaben'; - $this->feedback = 'Der Bestandteil ist aus dem Arbeitsstand genommen. Gespeichert ist das erst mit einer neuen Fassung.'; + $this->partOpen = false; + $this->partSnapshot = []; + $this->feedback = 'Der Bestandteil ist aus dem Arbeitsstand genommen. Entwurf speichern hält das fest. Eine freigegebene Fassung bleibt unverändert.'; } public function movePart(int $index, int $direction): void @@ -663,7 +752,7 @@ public function useVersion(int $index, string $target): void $row['role'] = $this->members[$index]['role'] ?? $row['kind']; $this->members[$index] = $row; $this->syncRoleDraft(); - $this->feedback = $row['version_label'].' ist für diese Stelle ausgewählt. Übernehmen legt dafür eine neue Fassung an.'; + $this->feedback = $row['version_label'].' ist für diese Stelle ausgewählt. Der Entwurf speichert das. Eine freigegebene Fassung bleibt unverändert.'; } public function loadTemplate(int $versionId): void @@ -678,7 +767,7 @@ public function loadTemplate(int $versionId): void $this->applyVersion($version); $this->templateNumber = $version->number; - $this->feedback = 'Fassung '.$version->number.' ist als Arbeitsstand geladen. Übernehmen legt eine neue Fassung an und lässt die geladene Fassung unverändert.'; + $this->feedback = 'Fassung '.$version->number.' ist als Arbeitsstand geladen. Die geladene Fassung bleibt unverändert.'; } public function addText(): void @@ -706,7 +795,7 @@ public function addText(): void $this->newTextBody = ''; $this->textOpen = false; $this->addPart('element:'.$version->id); - $this->feedback = $title.' ist angelegt und in den Aufbau übernommen. Derselbe Text kann später woanders wiederverwendet werden. Gespeichert ist das erst mit „Entwurf speichern“.'; + $this->feedback = $title.' ist angelegt und in den Aufbau übernommen. Derselbe Text kann später woanders wiederverwendet werden. Der Entwurf ist gespeichert. Es entsteht keine neue Fassung dieses Eintrags.'; } public function startModule(): void @@ -727,27 +816,197 @@ public function startModule(): void public function saveDisplay(): void { - /** @var Composition $record */ - $record = $this->getRecord(); - $name = trim($this->designation); + if (! $this->persistPresentation()) { + return; + } - if ($name === '') { - $this->feedback = 'Der Name fehlt.'; + $this->feedback = 'Die Anzeige ist gespeichert. Die Fassung bleibt unverändert.'; + } + + public function openModule(): void + { + $this->moduleSnapshot = [ + 'designation' => $this->designation, + 'displayTitle' => $this->displayTitle, + 'summary' => $this->summary, + 'description' => $this->description, + 'learningGoal' => $this->learningGoal, + 'durationMinutes' => $this->durationMinutes, + 'materialNote' => $this->materialNote, + 'revisionNote' => $this->revisionNote, + 'thumbnailAlt' => $this->thumbnailAlt, + 'dimensionIds' => $this->dimensionIds, + 'imageMode' => $this->imageMode, + 'imagePick' => $this->imagePick, + 'frameVersionId' => $this->frameVersionId, + 'frameSecond' => $this->frameSecond, + ]; + $this->pickerOpen = false; + $this->partOpen = false; + $this->textOpen = false; + $this->moduleTab = 'beschreibung'; + $films = $this->frameFilms(); + $this->imageMode = $films === [] ? 'bestand' : 'film'; + + if ($films !== [] && $this->frameVersionId === null) { + $this->frameVersionId = $films[0]['version_id']; + } + + $this->moduleOpen = true; + } + + public function closeModule(): void + { + foreach ($this->moduleSnapshot as $key => $value) { + $this->{$key} = $value; + } + + $this->moduleOpen = false; + $this->moduleSnapshot = []; + $this->previewUpload = null; + } + + public function saveModule(): void + { + if ($this->minutes($this->durationMinutes) === false) { + $this->feedback = 'Der Zeitbedarf ist eine Zahl von Minuten oder bleibt leer.'; return; } - $record->designation = $name; - app(IdentityProfile::class)->fill($record, [ - 'display_title' => $this->displayTitle, - 'summary' => $this->summary, - 'description' => $this->description, - 'thumbnail_alt' => $this->thumbnailAlt, - ], $this->actor()); - $this->syncDimensions($record, array_map(intval(...), $this->dimensionIds)); - $record->refresh(); - $this->getRecord()->setRawAttributes($record->getAttributes()); - $this->feedback = 'Die Anzeige ist gespeichert. Die Fassung bleibt unverändert.'; + if (! $this->persistPresentation()) { + return; + } + + $image = $this->applyChosenImage(); + + if ($image === false) { + return; + } + + /** @var Composition $record */ + $record = $this->getRecord(); + + if ($this->needsRevision() || app(EditorialWorkingDraft::class)->read($record) !== null) { + $this->persistDraft(); + } + + $this->moduleOpen = false; + $this->moduleSnapshot = []; + $this->previewUpload = null; + $this->imagePick = ''; + $this->feedback = trim('Die Angaben sind übernommen. Es entsteht keine neue Fassung.'.($image === '' ? '' : ' '.$image)); + } + + public function openPart(int $index): void + { + $this->selectPart($index); + $this->partSnapshot = $this->members; + $this->moduleOpen = false; + $this->pickerOpen = false; + $this->textOpen = false; + $this->partOpen = true; + } + + public function closePart(): void + { + if ($this->partSnapshot !== []) { + $this->members = $this->partSnapshot; + } + + $this->partOpen = false; + $this->partSnapshot = []; + $this->syncRoleDraft(); + } + + public function savePart(): void + { + if (trim($this->roleDraft) === '') { + $this->feedback = 'Die Rolle fehlt.'; + + return; + } + + $this->commitRoleDraft(); + + if (! $this->persistDraft()) { + return; + } + + $this->partOpen = false; + $this->partSnapshot = []; + $this->feedback = 'Die Angaben zum Bestandteil sind im Entwurf. Es entsteht keine neue Fassung.'; + } + + /** + * @return list + */ + public function frameFilms(): array + { + $preview = app(ContentPreviewController::class); + $films = []; + + foreach ($this->members as $member) { + if (preg_match('/^element:(\d+)$/', (string) ($member['target'] ?? ''), $match) !== 1) { + continue; + } + + $version = ContentElementVersion::query()->with('element')->find($match[1]); + + if (! $version instanceof ContentElementVersion || $version->element?->output_class !== 'film') { + continue; + } + + $films[] = [ + 'version_id' => $version->id, + 'title' => (string) ($member['title'] ?? $version->element->working_title), + 'label' => 'Fassung '.$version->number, + 'file_url' => $preview->fileUrl($version), + ]; + } + + return $films; + } + + public function framePreviewUrl(): ?string + { + if ($this->frameVersionId === null || ! is_numeric($this->frameSecond) || trim($this->frameSecond) === '') { + return null; + } + + return route('editorial.frame', [ + 'version' => $this->frameVersionId, + 'sekunde' => $this->frameSecond, + ]); + } + + public function imageCaption(): ?string + { + /** @var Composition $composition */ + $composition = $this->getRecord(); + $composition->refresh(); + $source = $composition->thumbnail_source; + + if (! is_string($source) || $source === '') { + return null; + } + + if (preg_match('/^frame:(\d+)@([\d.]+)$/', $source, $match) === 1) { + $version = ContentElementVersion::query()->with('element')->find($match[1]); + $title = $version?->element?->working_title ?: 'dem Film'; + + return 'Titelbild aus '.$title.' bei '.$match[2].' Sekunden.'; + } + + if ($source === 'eigen') { + return 'Eigenes Titelbild.'; + } + + if (str_starts_with($source, 'element:')) { + return 'Titelbild aus einem vorhandenen Bild.'; + } + + return null; } public function savePreview(): void @@ -1228,6 +1487,120 @@ protected function syncDimensions(Composition $composition, array $ids): void } } + protected function persistPresentation(): bool + { + /** @var Composition $record */ + $record = $this->getRecord(); + $name = trim($this->designation); + + if ($name === '') { + $this->feedback = 'Der Name fehlt.'; + + return false; + } + + $record->designation = $name; + app(IdentityProfile::class)->fill($record, [ + 'display_title' => $this->displayTitle, + 'summary' => $this->summary, + 'description' => $this->description, + 'thumbnail_alt' => $this->thumbnailAlt, + ], $this->actor()); + $this->syncDimensions($record, array_map(intval(...), $this->dimensionIds)); + $record->refresh(); + $this->getRecord()->setRawAttributes($record->getAttributes()); + + return true; + } + + protected function persistDraft(): bool + { + if ($this->minutes($this->durationMinutes) === false) { + $this->feedback = 'Der Zeitbedarf ist eine Zahl von Minuten oder bleibt leer.'; + + return false; + } + + /** @var Composition $record */ + $record = $this->getRecord(); + app(EditorialWorkingDraft::class)->write($record, $this->payload()); + + return true; + } + + protected function applyChosenImage(): string|false + { + if ($this->imageMode === 'upload' && $this->previewUpload instanceof TemporaryUploadedFile) { + $extension = strtolower($this->previewUpload->getClientOriginalExtension()); + + if (! in_array($extension, ['png', 'jpg', 'jpeg', 'webp'], true)) { + $this->feedback = 'Das Vorschaubild muss eine Bilddatei sein.'; + + return false; + } + + $path = $this->previewUpload->storeAs( + 'vorschau', + 'karte-'.bin2hex(random_bytes(4)).'.'.$extension, + 'cms_incoming', + ); + $this->previewUpload = null; + + if (! is_string($path)) { + $this->feedback = 'Das Vorschaubild wurde nicht übernommen.'; + + return false; + } + + $this->storePreview($path); + + return str_contains($this->feedback, 'unverändert') ? $this->feedback : false; + } + + if ($this->imageMode === 'bestand' && ctype_digit($this->imagePick)) { + $this->adoptPicture((int) $this->imagePick); + + return str_contains($this->feedback, 'unverändert') ? $this->feedback : false; + } + + if ($this->imageMode === 'film' && $this->frameVersionId !== null && trim($this->frameSecond) !== '') { + if (! is_numeric($this->frameSecond) || (float) $this->frameSecond < 0 || (float) $this->frameSecond > 7200) { + $this->feedback = 'Die Zeitposition muss eine Zahl in Sekunden sein.'; + + return false; + } + + $version = ContentElementVersion::query()->with('element')->find($this->frameVersionId); + $target = 'element:'.(int) $this->frameVersionId; + $known = array_map(fn (array $member): string => (string) ($member['target'] ?? ''), $this->members); + + if (! $version instanceof ContentElementVersion || $version->element?->output_class !== 'film' || ! in_array($target, $known, true)) { + $this->feedback = 'Die Filmfassung gehört nicht zu diesem Aufbau.'; + + return false; + } + + /** @var Composition $record */ + $record = $this->getRecord(); + $before = $record->versions()->count(); + DeriveCompositionFrame::dispatch($record->id, $version->id, (float) $this->frameSecond); + $record->refresh(); + $this->thumbnailPath = $record->thumbnail_path; + $this->thumbnailError = $record->thumbnail_error; + $note = $this->previewFeedback($record, $before); + + if (! str_contains($note, 'unverändert')) { + $this->feedback = $note; + + return false; + } + + return $note; + } + + return ''; + } + protected function storePreview(string $path): void { if (! str_starts_with($path, 'vorschau/') || str_contains($path, '..')) { diff --git a/app/Filament/Support/EditorialCatalog.php b/app/Filament/Support/EditorialCatalog.php index 69cb1da..5f62bae 100644 --- a/app/Filament/Support/EditorialCatalog.php +++ b/app/Filament/Support/EditorialCatalog.php @@ -205,12 +205,16 @@ public function browse(string $query, string $kind, string $dimension, int $exce $dimensionId = ctype_digit($dimension) ? (int) $dimension : 0; if ($kind !== 'modul') { - $elements = ContentElementVersion::query() + $latestElements = ContentElementVersion::query() + ->selectRaw('MAX(id)') ->where('status', ContentVersionStatus::Bereit) - ->with('element.editorialContentKind') ->whereHas('element', function ($builder) use ($query, $like, $kind, $dimensionId): void { $this->constrainElement($builder, $query, $like, $kind, $dimensionId); }) + ->groupBy('content_element_id'); + $elements = ContentElementVersion::query() + ->with('element.editorialContentKind') + ->whereIn('id', $latestElements) ->orderByDesc('id') ->limit($limit + 1) ->get(); @@ -225,10 +229,10 @@ public function browse(string $query, string $kind, string $dimension, int $exce } if (in_array($kind, ['alle', 'modul'], true)) { - $versions = CompositionVersion::query() + $latestCompositions = CompositionVersion::query() + ->selectRaw('MAX(id)') ->where('status', ContentVersionStatus::Bereit) ->where('composition_id', '!=', $exceptCompositionId) - ->with('composition.editorialContentKind') ->whereHas('composition', function ($builder) use ($query, $like, $kind, $dimensionId): void { if ($kind === 'modul') { $builder->where('kind', CompositionKind::Uebung); @@ -248,6 +252,10 @@ public function browse(string $query, string $kind, string $dimension, int $exce ->orWhere('summary', 'like', $like); }); }) + ->groupBy('composition_id'); + $versions = CompositionVersion::query() + ->with('composition.editorialContentKind') + ->whereIn('id', $latestCompositions) ->orderByDesc('id') ->limit($limit + 1) ->get(); diff --git a/app/Http/Controllers/EditorialPreviewController.php b/app/Http/Controllers/EditorialPreviewController.php index 9273f51..8f2c406 100644 --- a/app/Http/Controllers/EditorialPreviewController.php +++ b/app/Http/Controllers/EditorialPreviewController.php @@ -10,8 +10,11 @@ use App\Domain\Catalog\ContentVersionStatus; use App\Domain\Catalog\StructureNode; use App\Domain\Identity\StaffRole; +use App\Domain\Media\ThumbnailDeriver; use App\Filament\Support\EditorialCatalog; use App\Models\User; +use Illuminate\Http\Request; +use Illuminate\Http\Response; use Illuminate\Support\Facades\Storage; use Illuminate\View\View; use Symfony\Component\HttpFoundation\StreamedResponse; @@ -146,6 +149,23 @@ private function render( ]); } + public function frame(ContentElementVersion $version, Request $request): Response + { + $this->authorizeStaff(); + $version->loadMissing('element'); + abort_unless($version->element?->output_class === 'film', 404); + $seconds = $request->query('sekunde'); + abort_unless(is_numeric($seconds), 404); + + $bytes = app(ThumbnailDeriver::class)->jpegAtVersion($version, (float) $seconds); + abort_unless(is_string($bytes), 404); + + return response($bytes, 200, [ + 'Content-Type' => 'image/jpeg', + 'Cache-Control' => 'private, no-store', + ]); + } + /** * @return array */ diff --git a/app/Jobs/DeriveCompositionFrame.php b/app/Jobs/DeriveCompositionFrame.php new file mode 100644 index 0000000..f8d3d98 --- /dev/null +++ b/app/Jobs/DeriveCompositionFrame.php @@ -0,0 +1,32 @@ +find($this->compositionId); + $version = ContentElementVersion::query()->find($this->versionId); + + if (! $composition instanceof Composition || ! $version instanceof ContentElementVersion) { + return; + } + + $deriver->forCompositionFrame($composition, $version, $this->atSecond); + } +} diff --git a/resources/views/filament/editorial/editor.blade.php b/resources/views/filament/editorial/editor.blade.php index 33b3ba6..5eed695 100644 --- a/resources/views/filament/editorial/editor.blade.php +++ b/resources/views/filament/editorial/editor.blade.php @@ -20,7 +20,7 @@

@endif - @if ($this->feedback !== '') + @if ($this->feedback !== '' && ! $this->moduleOpen && ! $this->partOpen)

{{ $this->feedback }}

@endif @if ($this->releaseArmed) @@ -40,7 +40,7 @@

Aufbau

-

Die Bausteine bleiben sichtbar, auch wenn rechts ein Bestandteil bearbeitet wird. Ziehen sortiert sie. Nach oben und Nach unten tun dasselbe ohne Ziehen.

+

Der Aufbau ist die Arbeitsfläche. Das Stiftsymbol öffnet die Eigenschaften eines Bestandteils. Ziehen ändert die Reihenfolge, Nach oben und Nach unten tun dasselbe ohne Ziehen.

@if ($this->members === [])

@if ($this->isProgram()) @@ -63,21 +63,33 @@ @dragenter.prevent="over = {{ $index }}" :class="{ 'is-drop': over === {{ $index }} && from !== {{ $index }} }">

+
@@ -87,187 +99,75 @@ @endif -
-
- - - +
+

{{ $this->hostLabel() }}

+

{{ trim($this->displayTitle) !== '' ? $this->displayTitle : $this->designation }}

+
+ @foreach ($this->presentationChips() as $chip) + {{ $chip['label'] }} + @endforeach
- - @if ($this->panel === 'bestandteil' && $this->selectedMember()) - @php($member = $this->selectedMember()) -

Bestandteil an dieser Stelle

-

{{ $member['title'] }}

-

{{ $member['kind'] }} · {{ $member['version_label'] }}

-
- - -
-

Die Rolle gilt nur hier. Dasselbe Medium kann woanders eine andere Rolle haben.

- @if (count($this->selectedAlternatives()) > 1) -

Vorhandene Fassung

-
- @foreach ($this->selectedAlternatives() as $alternative) - - @endforeach -
- @endif -
- @if ($member['open_url']) - Medium ansehen - @endif - @if ($member['edit_url']) - Bestandteil bearbeiten - @endif - -
- @elseif ($this->panel === 'fassungen') -

Nur freigegebene Stände

-

Freigegebene Fassungen

- @if ($this->versionChoices() === []) -

Noch keine freigegebene Fassung. Sie entsteht mit „Freigeben“, nicht beim Speichern des Entwurfs.

+ @php($cover = $this->coverPicture()) +

Katalogvorschau

+
+ @if ($cover['url']) + {{ $this->thumbnailAlt !== '' ? $this->thumbnailAlt : '' }} @else -
    - @foreach ($this->versionChoices() as $version) -
  • -
    - {{ $version['text'] }} - @if ($version['current']) - Letzter freigegebener Stand - @endif -
    -
    - - @if ($url = $this->previewUrlFor($version['id'])) - Vorschau - @endif -
    -
  • - @endforeach -
+ @endif -

Eine freigegebene Fassung wird nicht überschrieben. Als Vorlage laden ändert nur den Arbeitsstand.

- @else -

{{ $this->hostLabel() }}

-

{{ trim($this->displayTitle) !== '' ? $this->displayTitle : $this->designation }}

-

Titel, Texte, Einordnung und Titelbild beschreiben die Karte. Sie legen keine Inhaltsfassung an. Lernziel, Zeit und Material gehören zum fachlichen Stand darunter.

-
- @foreach ($this->presentationChips() as $chip) - {{ $chip['label'] }} - @endforeach -
- @php($cover = $this->coverPicture()) -

Katalogvorschau

-
- @if ($cover['url']) - {{ $this->thumbnailAlt !== '' ? $this->thumbnailAlt : '' }} - @else - + @if ($cover['note']) + {{ $cover['note'] }} + @endif +
+

{{ trim($this->summary) !== '' ? \Illuminate\Support\Str::limit(trim($this->summary), 180) : 'Noch keine Kurzbeschreibung' }}

+ @if (trim($this->learningGoal) !== '') +

Lernziel: {{ \Illuminate\Support\Str::limit(trim($this->learningGoal), 140) }}

+ @endif + @if (trim($this->durationMinutes) !== '' || trim($this->materialNote) !== '') +

+ @if (trim($this->durationMinutes) !== '') + {{ $this->durationMinutes }} Minuten @endif - @if ($cover['note']) - {{ $cover['note'] }} + @if (trim($this->materialNote) !== '') + · {{ \Illuminate\Support\Str::limit(trim($this->materialNote), 80) }} @endif -

-

- {{ trim($this->displayTitle) !== '' ? $this->displayTitle : ($this->designation !== '' ? $this->designation : 'Ohne Titel') }} - {{ trim($this->summary) !== '' ? \Illuminate\Support\Str::limit(trim($this->summary), 160) : 'Noch keine Kurzbeschreibung' }}

-
- - -
-
- - -
-
- - - Steht auf der Katalogkarte. -
-
- - - Ausführlicher Text für die Mitgliederbibliothek und eine spätere öffentliche Produktseite. Preis und Nutzungsrechte bleiben beim Angebot. -
- @foreach ($this->dimensionGroups() as $group) -
- {{ $group['label'] }} - @foreach ($group['values'] as $value) - - @endforeach -
- @endforeach -

Titelbild

-

Ein selbst gewähltes Bild hat Vorrang vor einem Vorschlag. Ein Bild aus einem Film bleibt geschützt und wird nicht auf der öffentlichen Website ausgegeben.

- @if ($this->thumbnailError) -

{{ $this->thumbnailError }}

- @endif - @php($films = $this->filmChoices()) - @php($suggestion = $this->suggestedFilm()) - @if ($suggestion) -

Vorschlag aus dem Film {{ $suggestion['title'] }}.

- - @endif - @if ($films !== []) -

Mehrere Filme sind enthalten. Wähle das Titelbild.

- @foreach ($films as $film) -
- - {{ $film['title'] }} - -
- @endforeach - @endif -
- - -
-
- - -
-
- - -
- @foreach ($this->mediaChoices() as $medium) -
- - {{ $medium['kind'] }}{{ $medium['title'] }} - -
- @endforeach -
- - -
+ @endif + @if ($caption = $this->imageCaption()) +

{{ $caption }}

+ @endif +
+ +
+ @if ($member = $this->selectedMember()) +

Ausgewählt: {{ $member['title'] }}, Rolle {{ $member['role'] }}. Das Stiftsymbol öffnet die Bearbeitung.

+ @endif -

Zum fachlichen Stand

-

Lernziel, Zeit und Material gehören zum Aufbau. Speichern schreibt sie in den Entwurf. Erst Freigeben erzeugt eine neue Fassung.

-
- - -
-
- - -
-
- - -
-
- - -
-

{{ $this->publishHint() }}

+

Freigegebene Fassungen

+ @if ($this->versionChoices() === []) +

Noch keine freigegebene Fassung. Sie entsteht mit „Freigeben“, nicht beim Speichern des Entwurfs.

+ @else +
    + @foreach ($this->versionChoices() as $version) +
  • +
    + {{ $version['text'] }} + @if ($version['current']) + Letzter freigegebener Stand + @endif +
    +
    + + @if ($url = $this->previewUrlFor($version['id'])) + Vorschau + @endif +
    +
  • + @endforeach +
@endif @if ($this->usageLines() !== []) @@ -290,11 +190,209 @@
+ @if ($this->moduleOpen) + + @endif + + @if ($this->partOpen && $this->selectedMember()) + @php($member = $this->selectedMember()) + + @endif + @if ($this->pickerOpen)