Pflege Anzeigedaten ohne neue Fassung und zeige sie in den echten Karten.
Deploy Test / test (push) Successful in 47s
Deploy Test / deploy (push) Successful in 28s

Der Medieneditor trennt Beschreibung, Inhalt, Fassungen und Verwendung. Der vorhandene Picker filtert nach Zusammenhang und lässt Entwürfe für die gemeinsame Freigabe sichtbar.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-18 20:03:56 +01:00
1 parent 3e56314cf9
commit d37a7093dd
13 files changed
+827 -54

No files matched your search

@@ -104,8 +104,10 @@ public function labelFor(mixed $id): ?string
/**
* Anzeigedaten für eine Karte. Öffentlich null, wenn das Element nicht öffentlich genannt wird.
*
* @param array<string, mixed> $draft ungespeicherte Anzeigedaten, nur für die Redaktionsvorschau
*/
public function subject(mixed $id, bool $includeNonPublic): ?CardSubject
public function subject(mixed $id, bool $includeNonPublic, array $draft = []): ?CardSubject
{
$element = is_numeric($id) ? ContentElement::query()->with('editorialContentKind')->find((int) $id) : null;
@@ -119,11 +121,22 @@ public function subject(mixed $id, bool $includeNonPublic): ?CardSubject
return null;
}
$shown = clone $element;
foreach (['working_title', 'display_title', 'summary', 'thumbnail_path', 'thumbnail_alt'] as $field) {
if (! array_key_exists($field, $draft)) {
continue;
}
$value = $draft[$field];
$shown->setAttribute($field, is_string($value) && trim($value) === '' ? null : $value);
}
$program = $this->publicProgramFor($element);
$output = self::outputLabel((string) $element->output_class);
$film = $element->output_class === 'film';
$output = self::outputLabel((string) $shown->output_class);
$film = $shown->output_class === 'film';
$editorialKind = $element->editorialContentKind?->label;
$summary = filled($element->summary) ? trim((string) $element->summary) : null;
$summary = filled($shown->summary) ? trim((string) $shown->summary) : null;
$meta = [$output];
if ($program !== null) {
@@ -137,14 +150,14 @@ public function subject(mixed $id, bool $includeNonPublic): ?CardSubject
if ($summary === null) {
$missing[] = 'Keine Kurzbeschreibung gepflegt (Medium bearbeiten → Kurzbeschreibung).';
}
if (! filled($element->display_title)) {
if (! filled($shown->display_title)) {
$missing[] = 'Kein Anzeigetitel gepflegt; die Karte zeigt den Arbeitstitel.';
}
$previewImage = $includeNonPublic ? ThumbnailRef::url('editorial.card', 'element', (int) $element->id, $element->thumbnail_path) : null;
$previewImage = $includeNonPublic ? ThumbnailRef::url('editorial.card', 'element', (int) $element->id, $shown->thumbnail_path) : null;
return new CardSubject(
title: (string) ($element->display_title ?: $element->working_title),
title: (string) ($shown->display_title ?: $shown->working_title),
summary: $summary,
kind: filled($editorialKind) ? (string) $editorialKind : $output,
badge: $output,
@@ -172,6 +185,17 @@ public static function outputLabel(string $outputClass): string
};
}
public function visibilityNote(ContentElement $element): string
{
if ($this->isPublic($element)) {
$program = $this->publicProgramFor($element);
return 'Öffentlich nur als Teil der Programmseite „'.($program['title'] ?? '').'“. Die Mediendatei wird dabei nicht ausgeliefert.';
}
return $this->notice($element, $this->publicProgramFor($element));
}
/**
* @param array{id: int, title: string}|null $program
*/
@@ -20,6 +20,7 @@
use App\Domain\Catalog\IdentityDimensionValue;
use App\Domain\Catalog\IdentityProfile;
use App\Domain\Catalog\StructureNode;
use App\Domain\Cms\Catalog\PublicMaterialReader;
use App\Filament\Resources\ContentElements\ContentElementResource;
use App\Filament\Support\EditorialCatalog;
use App\Filament\Support\MediumForm;
@@ -87,6 +88,8 @@ abstract class EditComposition extends EditRecord
public string $pickerKind = 'alle';
public string $pickerLayout = 'kacheln';
public string $pickerDimension = '';
public string $pickerSelected = '';
@@ -351,6 +354,7 @@ public function pickerDetail(): ?array
$row = app(EditorialCatalog::class)->rowForTarget(
$this->pickerSelected,
(int) $this->getRecord()->getKey(),
allowDraft: true,
);
if ($row === null) {
@@ -360,10 +364,13 @@ public function pickerDetail(): ?array
$row['playback'] = null;
if (preg_match('/^element:(\d+)$/', (string) $row['target'], $match) === 1) {
$version = ContentElementVersion::query()->with('element')->find($match[1]);
$version = ContentElementVersion::query()->with('element.editorialContentKind')->find($match[1]);
$row['playback'] = $version instanceof ContentElementVersion
? app(ContentPreviewController::class)->playback($version)
: null;
if ($version?->element !== null) {
$row['visibility'] = app(PublicMaterialReader::class)->visibilityNote($version->element);
}
}
return $row;
@@ -6,20 +6,25 @@
use App\Domain\Catalog\ContentElementVersion;
use App\Domain\Catalog\ContentService;
use App\Domain\Catalog\ContentVersionStatus;
use App\Domain\Catalog\EditorialDimensionValue;
use App\Domain\Catalog\IdentityChange;
use App\Domain\Catalog\IdentityDimension;
use App\Domain\Catalog\IdentityDimensionValue;
use App\Domain\Catalog\IdentityProfile;
use App\Domain\Catalog\Pillar;
use App\Domain\Catalog\PillarService;
use App\Domain\Cms\Catalog\PublicMaterialReader;
use App\Domain\Cms\Widgets\RenderContext;
use App\Domain\Media\ThumbnailRef;
use App\Filament\Resources\ContentElements\ContentElementResource;
use App\Filament\Support\CatalogReading;
use App\Filament\Support\EditorialCatalog;
use App\Filament\Support\ElementRevision;
use App\Filament\Support\MediaLibrary;
use App\Filament\Support\ReportsDomainRules;
use App\Http\Controllers\ContentPreviewController;
use App\Jobs\DeriveThumbnail;
use Filament\Actions\Action;
use Filament\Forms\Components\CheckboxList;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Resources\Pages\ViewRecord;
use Filament\Schemas\Components\View;
use Filament\Schemas\Schema;
@@ -47,6 +52,42 @@ class ViewContentElement extends ViewRecord
public mixed $previewUpload = null;
public string $bereich = 'inhalt';
public string $workingTitle = '';
public string $displayTitle = '';
public string $summary = '';
public string $descriptionText = '';
public string $usageNote = '';
public string $licenseNote = '';
public int|string|null $kindId = null;
/** @var list<int|string> */
public array $pillarIds = [];
/** @var list<int|string> */
public array $dimensionIds = [];
public string $editorialFeedback = '';
public string $previewWidth = '640';
public string $previewSurface = 'website';
public string $pickerQuery = '';
public string $pickerContext = 'modul';
public string $pickerLayout = 'kacheln';
public string $pickerSelected = '';
public function mount(int|string $record): void
{
parent::mount($record);
@@ -57,13 +98,18 @@ public function mount(int|string $record): void
$this->fassung = $requested;
}
$bereich = (string) request()->query('bereich', 'inhalt');
$this->bereich = in_array($bereich, ['beschreibung', 'inhalt', 'fassungen', 'herkunft', 'verwendung', 'auswahl', 'vorschau'], true)
? $bereich
: 'inhalt';
$this->thumbnailAlt = (string) ($this->getRecord()->thumbnail_alt ?? '');
$this->fillEditorial();
$this->syncBodyDraft();
}
public function getSubheading(): string|Htmlable|null
{
return 'Jede Fassung hat eine eigene Nummer und bleibt einsehbar. Beschreibung, Arbeitstitel und Säulen gehören zum Medium und ändern keine Fassung. Eine deaktivierte Fassung wird nicht mehr ausgeliefert und lässt sich nicht neu einbauen.';
return 'Beschreibung, Anzeigename, Kurzbeschreibung und Vorschaubild gehören zum Medium und ändern keine Fassung. Eine neue Film- oder Textdatei entsteht nur über eine neue Fassung. Die Website zeigt nur, was dafür freigegeben ist.';
}
public function infolist(Schema $schema): Schema
@@ -242,40 +288,6 @@ public function deactivateAction(): Action
protected function getHeaderActions(): array
{
return [
Action::make('describe')
->label('Beschreibung ändern')
->visible(fn (): bool => ContentElementResource::editor())
->fillForm(fn (): array => [
'working_title' => $this->getRecord()->working_title,
'description' => $this->getRecord()->description,
'usage_note' => $this->getRecord()->usage_note,
'license_note' => $this->getRecord()->license_note,
'pillars' => $this->getRecord()->pillars()->pluck('pillars.id')->all(),
])
->schema([
TextInput::make('working_title')->label('Arbeitstitel')->required(),
Textarea::make('description')->label('Beschreibung')->rows(4)
->helperText('Gilt für das Medium. Speichern legt keine neue Fassung an.'),
Textarea::make('usage_note')->label('Hinweise für den Einsatz')->rows(4),
Textarea::make('license_note')->label('Interner Lizenzvermerk')->rows(3)
->helperText('Nur in der Verwaltung. Nicht in der Bibliothek und nicht auf der Website.'),
CheckboxList::make('pillars')
->label('Fachliche Säulen')
->options(fn (): array => Pillar::query()->orderBy('name')->pluck('name', 'id')->all()),
])
->action(function (array $data): void {
$this->report(function () use ($data): void {
/** @var ContentElement $element */
$element = $this->getRecord();
app(ContentService::class)->describe($element, (string) $data['working_title'], $data['description'] ?? null);
app(IdentityProfile::class)->fill($element, [
'usage_note' => $data['usage_note'] ?? null,
'license_note' => $data['license_note'] ?? null,
], auth()->user());
app(PillarService::class)->assign($element, array_map(intval(...), $data['pillars'] ?? []));
}, 'Die Beschreibung ist gespeichert.');
$this->getRecord()->refresh();
}),
Action::make('releaseVersion')
->label('Fassung freigeben')
->modalHeading('Fassung freigeben')
@@ -395,6 +407,7 @@ private function pictureCaption(ContentElement $element): string
return match ($source) {
'eigen' => 'Eigenes Vorschaubild.',
'datei' => 'Vorschaubild aus der Datei des Mediums.',
'bestand' => 'Vorschaubild aus einem Bild im Bestand. Es ist damit nicht für die Website freigegeben.',
default => '',
};
}
@@ -406,4 +419,234 @@ private function ownedVersion(int $id): ?ContentElementVersion
return $element->versions()->whereKey($id)->first();
}
public function saveEditorial(): void
{
abort_unless(ContentElementResource::editor(), 403);
/** @var ContentElement $element */
$element = $this->getRecord();
$title = trim($this->workingTitle);
if ($title === '') {
$this->editorialFeedback = 'Der Arbeitstitel fehlt.';
return;
}
$versions = $element->versions()->count();
app(IdentityProfile::class)->fill($element, [
'working_title' => $title,
'display_title' => $this->displayTitle,
'summary' => $this->summary,
'description' => $this->descriptionText,
'usage_note' => $this->usageNote,
'license_note' => $this->licenseNote,
'thumbnail_alt' => $this->thumbnailAlt,
'editorial_content_kind_id' => filled($this->kindId) ? (int) $this->kindId : null,
], auth()->user());
app(PillarService::class)->assign($element, array_map(intval(...), $this->pillarIds));
$ids = array_map(intval(...), $this->dimensionIds);
IdentityDimensionValue::query()
->where('subject_type', $element->getMorphClass())
->where('subject_id', $element->id)
->where('origin', 'direkt')
->whereNotIn('editorial_dimension_value_id', $ids === [] ? [0] : $ids)
->delete();
foreach (EditorialDimensionValue::query()->whereIn('id', $ids)->get() as $value) {
app(IdentityDimension::class)->assign($element, $value, 'direkt');
}
$element->refresh();
$this->fillEditorial();
$this->editorialFeedback = $element->versions()->count() === $versions
? 'Gespeichert. Es gibt keine neue Fassung.'
: 'Gespeichert. Prüfe die Fassungen, ihre Zahl hat sich geändert.';
}
public function adoptLibraryImage(): void
{
abort_unless(ContentElementResource::editor(), 403);
/** @var ContentElement $element */
$element = $this->getRecord();
$detail = $this->selectionDetail();
$sourceId = (int) ($detail['element_id'] ?? 0);
$source = $sourceId > 0 ? ContentElement::query()->find($sourceId) : null;
$path = $source?->thumbnail_path;
if (! $source instanceof ContentElement || $source->output_class !== 'bild' || ! is_string($path) || ! str_starts_with($path, 'vorschau/') || str_contains($path, '..')) {
$this->pictureFeedback = 'Dieses Bild hat noch kein übernehmbares Vorschaubild.';
return;
}
$versions = $element->versions()->count();
app(IdentityProfile::class)->fill($element, [
'thumbnail_path' => $path,
'thumbnail_alt' => filled($source->thumbnail_alt) ? $source->thumbnail_alt : $source->working_title,
'thumbnail_source' => 'bestand',
'thumbnail_error' => null,
], auth()->user());
$element->refresh();
$this->thumbnailAlt = (string) ($element->thumbnail_alt ?? '');
$this->pictureFeedback = $element->versions()->count() === $versions
? 'Vorschaubild übernommen. Es gibt keine neue Fassung. Für die Website ist es damit nicht freigegeben.'
: 'Vorschaubild übernommen. Prüfe die Fassungen.';
}
/**
* @return array{items: list<array<string, mixed>>, more: bool}
*/
public function selection(): array
{
return app(EditorialCatalog::class)->browse(
$this->pickerQuery,
$this->pickerContext === 'bild' ? 'bild' : 'alle',
'',
0,
elementsOnly: $this->pickerContext !== 'modul',
);
}
/**
* @return array<string, mixed>|null
*/
public function selectionDetail(): ?array
{
if ($this->pickerSelected === '') {
return null;
}
$row = app(EditorialCatalog::class)->rowForTarget($this->pickerSelected, 0, allowDraft: true);
if ($row === null || ! isset($row['element_id'])) {
return $row;
}
$element = ContentElement::query()->with('editorialContentKind')->find((int) $row['element_id']);
if ($element instanceof ContentElement) {
$row['visibility'] = app(PublicMaterialReader::class)->visibilityNote($element);
}
return $row;
}
public function previewHtml(): string
{
/** @var ContentElement $element */
$element = $this->getRecord();
$draft = [
'working_title' => $this->workingTitle,
'display_title' => $this->displayTitle,
'summary' => $this->summary,
'thumbnail_alt' => $this->thumbnailAlt,
];
if ($this->previewSurface === 'bibliothek') {
$title = trim($this->displayTitle) !== '' ? trim($this->displayTitle) : trim($this->workingTitle);
return view('member.partials.card', [
'href' => '#vorschau',
'card' => [
'title' => $title !== '' ? $title : $element->working_title,
'summary' => trim($this->summary) !== '' ? trim($this->summary) : null,
'kind' => PublicMaterialReader::outputLabel((string) $element->output_class),
'coverage' => 'offen',
'image' => trim($this->thumbnailAlt) !== '' ? trim($this->thumbnailAlt) : $title,
'image_url' => ThumbnailRef::url('editorial.card', 'element', $element->id, $element->thumbnail_path),
'error' => 'Vorschau der Kartenform. Ob jemand sie öffnen darf, entscheidet die Lizenz.',
],
])->render();
}
$subject = app(PublicMaterialReader::class)->subject($element->id, true, $draft);
if ($subject === null) {
return '<p class="preview-note">Für dieses Medium liegt noch keine anzeigbare Fassung vor. Die Karte erscheint deshalb auch in der Vorschau nicht.</p>';
}
return view('widgets.premium_card', [
'subject' => $subject,
'context' => RenderContext::preview(),
'cardStyle' => $subject->style ?? 'media',
'imageUrl' => null,
'alt' => '',
'focus' => ['x' => 50, 'y' => 45],
'format' => 'landscape',
'fit' => 'cover',
'headingTag' => 'h3',
'show' => ['summary' => true, 'kind' => true, 'meta' => true, 'action' => true],
'actionLabel' => 'Ansehen',
'note' => null,
'stacked' => $this->previewWidth === '390',
])->render();
}
/**
* @return list<array{field: string, after: string, when: string}>
*/
public function editorialHistory(): array
{
/** @var ContentElement $element */
$element = $this->getRecord();
$labels = [
'working_title' => 'Arbeitstitel',
'display_title' => 'Anzeigename',
'description' => 'Beschreibung',
'summary' => 'Kurzbeschreibung',
'usage_note' => 'Einsatzhinweis',
'license_note' => 'Interner Lizenzvermerk',
'thumbnail_alt' => 'Alternativtext',
'thumbnail_path' => 'Vorschaubild',
'thumbnail_source' => 'Herkunft des Vorschaubilds',
'editorial_content_kind_id' => 'Inhaltsart',
];
return IdentityChange::query()
->where('subject_type', $element->getMorphClass())
->where('subject_id', $element->id)
->latest('occurred_at')
->limit(8)
->get()
->map(fn (IdentityChange $change): array => [
'field' => $labels[$change->field] ?? $change->field,
'after' => is_scalar($change->after) ? (string) $change->after : '',
'when' => $change->occurred_at?->timezone(config('app.timezone'))->format('d.m.Y H:i') ?? '',
])
->all();
}
/**
* @return array<string, mixed>
*/
public function usageCard(): array
{
/** @var ContentElement $element */
$element = $this->getRecord();
return app(MediaLibrary::class)->cardFor($element, ContentElementResource::editor());
}
private function fillEditorial(): void
{
/** @var ContentElement $element */
$element = $this->getRecord();
$this->workingTitle = (string) $element->working_title;
$this->displayTitle = (string) ($element->display_title ?? '');
$this->summary = (string) ($element->summary ?? '');
$this->descriptionText = (string) ($element->description ?? '');
$this->usageNote = (string) ($element->usage_note ?? '');
$this->licenseNote = (string) ($element->license_note ?? '');
$this->kindId = $element->editorial_content_kind_id;
$this->pillarIds = $element->pillars()->pluck('pillars.id')->all();
$this->dimensionIds = IdentityDimensionValue::query()
->where('subject_type', $element->getMorphClass())
->where('subject_id', $element->id)
->where('origin', 'direkt')
->pluck('editorial_dimension_value_id')
->all();
}
}
+44 -3
View File
@@ -16,7 +16,9 @@
use App\Domain\Catalog\IdentityDimensionValue;
use App\Domain\Catalog\LicenseArticle;
use App\Domain\Catalog\OfferStatus;
use App\Domain\Cms\Catalog\PublicMaterialReader;
use App\Filament\Resources\Combinations\CombinationResource;
use App\Filament\Resources\ContentElements\ContentElementResource;
use App\Filament\Resources\Courses\CourseResource;
use App\Filament\Resources\Exercises\ExerciseResource;
use Illuminate\Database\Eloquent\Builder;
@@ -111,7 +113,7 @@ public function rowForTarget(string $target, int $exceptCompositionId, bool $all
'identity' => 'medium:'.$element->id,
'open_url' => route('content.preview', $version),
'open_label' => 'Medium ansehen',
'edit_url' => null,
'edit_url' => ContentElementResource::getUrl('view', ['record' => $element]),
];
}
@@ -262,7 +264,7 @@ public function search(string $query, string $scope, int $exceptCompositionId):
/**
* @return array{items: list<array<string, string|null>>, more: bool}
*/
public function browse(string $query, string $kind, string $dimension, int $exceptCompositionId): array
public function browse(string $query, string $kind, string $dimension, int $exceptCompositionId, bool $elementsOnly = false): array
{
$query = trim($query);
$like = '%'.str_replace(['%', '_'], ['', ''], $query).'%';
@@ -294,7 +296,7 @@ public function browse(string $query, string $kind, string $dimension, int $exce
}
}
if (in_array($kind, ['alle', 'modul'], true)) {
if (! $elementsOnly && in_array($kind, ['alle', 'modul'], true)) {
$latestCompositions = CompositionVersion::query()
->selectRaw('MAX(id)')
->where('status', ContentVersionStatus::Bereit)
@@ -372,6 +374,8 @@ public function browse(string $query, string $kind, string $dimension, int $exce
}
}
$rows = $this->withVisibility($rows);
return [
'items' => array_slice($rows, 0, $limit),
'more' => count($rows) > $limit,
@@ -400,6 +404,42 @@ public function cardUrl(string $kind, int $id, ?string $path): ?string
return route('editorial.card', ['kind' => $kind, 'subject' => $id]);
}
/**
* @param list<array<string, mixed>> $rows
* @return list<array<string, mixed>>
*/
private function withVisibility(array $rows): array
{
$ids = [];
foreach ($rows as $row) {
if (isset($row['element_id'])) {
$ids[] = (int) $row['element_id'];
}
}
if ($ids === []) {
return $rows;
}
$reader = app(PublicMaterialReader::class);
$elements = ContentElement::query()
->with('editorialContentKind')
->whereIn('id', array_values(array_unique($ids)))
->get()
->keyBy('id');
foreach ($rows as $index => $row) {
$element = $elements->get((int) ($row['element_id'] ?? 0));
if ($element instanceof ContentElement) {
$rows[$index]['visibility'] = $reader->visibilityNote($element);
}
}
return $rows;
}
/**
* @param Builder<ContentElement> $builder
*/
@@ -408,6 +448,7 @@ private function constrainElement($builder, string $query, string $like, string
$outputs = match ($kind) {
'film' => ['film'],
'text' => ['text'],
'bild' => ['bild'],
'dokument' => ['pdf', 'document'],
default => null,
};
+21
View File
@@ -66,6 +66,27 @@ public function classifications(): array
return $options;
}
/**
* @param array<string, string> $filters
* @return list<array<string, mixed>>
*/
/**
* @return array<string, mixed>
*/
public function cardFor(ContentElement $element, bool $canEdit): array
{
$element->loadMissing(['versions', 'pillars']);
$versionIds = $element->versions->pluck('id')->all();
return $this->card(
$element,
$this->portrait($element),
$this->placements($versionIds)[$element->id] ?? [],
$this->licenses($versionIds)[$element->id] ?? [],
$canEdit,
);
}
/**
* @param array<string, string> $filters
* @return list<array<string, mixed>>
@@ -4,13 +4,15 @@
verkleinert. So greifen die Container-Abfragen der Widgets wie auf der Website.
--}}
@php
$bodyClass = $bodyClass ?? '';
$caption = $caption ?? 'Vorschau bei '.$width.' px Platzbreite, verkleinert. Gleiche Darstellung wie auf der Website.';
$document = '<!DOCTYPE html><html lang="de"><head><meta charset="utf-8"><base target="_blank">'
.$stylesheets
.'<style>html,body{background:#fff;overflow:hidden}html{scrollbar-gutter:auto}body{margin:0;padding:0;min-height:0}main{display:block}</style>'
.'</head><body><main class="sheet-preview"><div class="section-slot">'.$html.'</div></main></body></html>';
.'</head><body'.($bodyClass !== '' ? ' class="'.e($bodyClass).'"' : '').'><main class="sheet-preview"><div class="section-slot">'.$html.'</div></main></body></html>';
@endphp
<div class="luf-live-preview">
<p class="luf-live-preview-caption">Vorschau bei {{ $width }} px Platzbreite, verkleinert. Gleiche Darstellung wie auf der Website.</p>
<p class="luf-live-preview-caption">{{ $caption }}</p>
@if (trim($html) === '')
<p class="luf-widget-preview-empty">Dieses Widget zeigt mit den aktuellen Angaben öffentlich nichts an.</p>
@else
@@ -502,10 +502,15 @@
<input id="picker-suche" type="search" wire:model.live.debounce.250ms="pickerQuery" placeholder="Titel oder Beschreibung">
</div>
<div class="luf-scopes" role="group" aria-label="Inhaltsart">
@foreach (['alle' => 'Alle', 'film' => 'Filme', 'dokument' => 'Dokumente', 'text' => 'Texte', 'modul' => 'Module'] as $value => $label)
@foreach (['alle' => 'Alle', 'film' => 'Filme', 'bild' => 'Bilder', 'dokument' => 'Dokumente', 'text' => 'Texte', 'modul' => 'Module'] as $value => $label)
<button type="button" class="luf-quiet" wire:click="$set('pickerKind', '{{ $value }}')" aria-pressed="{{ $this->pickerKind === $value ? 'true' : 'false' }}">{{ $label }}</button>
@endforeach
</div>
<div class="luf-scopes" role="group" aria-label="Darstellung">
<button type="button" class="luf-quiet" wire:click="$set('pickerLayout', 'kacheln')" aria-pressed="{{ $this->pickerLayout === 'kacheln' ? 'true' : 'false' }}">Kacheln</button>
<button type="button" class="luf-quiet" wire:click="$set('pickerLayout', 'liste')" aria-pressed="{{ $this->pickerLayout === 'liste' ? 'true' : 'false' }}">Liste</button>
</div>
<p class="luf-note">Entwürfe bleiben sichtbar. So kann ein Modul sie weiterhin gemeinsam mit dem Aufbau freigeben. Eine nicht passende Art filterst du hier, ohne die übrigen Medien zu verstecken.</p>
<div class="luf-field">
<label for="picker-dimension">Fachliche Einordnung</label>
<select id="picker-dimension" wire:model.live="pickerDimension">
@@ -524,7 +529,7 @@
@if ($result['items'] === [])
<p class="luf-empty">Nichts gefunden. Ändere die Suche oder erstelle einen neuen Text.</p>
@else
<ul class="luf-cards">
<ul @class(['luf-cards', 'luf-cards-list' => $this->pickerLayout === 'liste'])>
@foreach ($result['items'] as $hit)
<li wire:key="treffer-{{ $hit['target'] }}">
<button type="button" class="luf-card luf-tone-{{ $hit['tone'] ?? 'text' }}" wire:click="$set('pickerSelected', '{{ $hit['target'] }}')" aria-pressed="{{ $this->pickerMatches((string) ($hit['identity'] ?? '')) ? 'true' : 'false' }}">
@@ -546,6 +551,9 @@
<span class="luf-summary">{{ \Illuminate\Support\Str::limit((string) $hit['summary'], 120) }}</span>
@endif
<span class="luf-meta">Aktueller Stand · {{ $hit['version_label'] }}</span>
@if (filled($hit['visibility'] ?? null))
<span class="luf-note">{{ $hit['visibility'] }}</span>
@endif
</span>
</button>
</li>
@@ -578,6 +586,9 @@
@else
<p class="luf-note">Das ist der aktuelle Stand. Eine weitere zulässige Fassung liegt nicht vor.</p>
@endif
@if (filled($detail['visibility'] ?? null))
<p class="luf-note">{{ $detail['visibility'] }}</p>
@endif
@if (($detail['version_label'] ?? '') === 'Entwurf')
<p class="luf-note">Übernehmen nimmt diesen Entwurf in den Aufbau. Eine Fassung entsteht erst, wenn du das Modul oder Programm freigibst und die gemeinsame Freigabe bestätigst.</p>
@else
@@ -587,6 +598,9 @@
@if ($detail['open_url'])
<a class="luf-link" href="{{ $detail['open_url'] }}" target="_blank" rel="noopener">Ansehen</a>
@endif
@if ($detail['edit_url'] ?? null)
<a class="luf-link" href="{{ $detail['edit_url'] }}">In der Verwaltung öffnen</a>
@endif
<button type="button" class="luf-primary" wire:click="addPart('{{ $detail['target'] }}')">Übernehmen</button>
</div>
@else
@@ -139,6 +139,9 @@
.luf-kicker { margin: 0; color: var(--luf-pine); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.78rem; }
.luf-blocks, .luf-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.luf-cards { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.luf-cards-list { grid-template-columns: 1fr; }
.luf-cards-list .luf-card { flex-direction: row; align-items: stretch; }
.luf-cards-list .luf-figure { width: 7.5rem; flex: none; }
.luf-block {
display: grid;
grid-template-columns: 1fr auto;
@@ -0,0 +1,190 @@
@php
$fokus = $this->bereich;
$editable = \App\Filament\Resources\ContentElements\ContentElementResource::editor();
$options = [
'kinds' => \App\Domain\Catalog\EditorialContentKind::selectOptions(),
'pillars' => \App\Domain\Catalog\Pillar::query()->orderBy('name')->get(['id', 'name']),
'dimensions' => \App\Domain\Catalog\EditorialDimension::query()->with('values')->orderBy('label')->get(),
];
@endphp
<div class="luf-ws">
@if ($this->editorialFeedback !== '')
<p role="status">{{ $this->editorialFeedback }}</p>
@endif
@if ($fokus === 'beschreibung')
<div class="luf-ws-grid">
<form class="luf-ws" wire:submit="saveEditorial">
<p>Diese Angaben gehören zum Medium. Speichern legt keine Film- oder Dokumentfassung an. Dieselben Texte nutzen Verwaltung, Mitgliederbereich und Website, soweit die jeweilige Oberfläche sie zeigt.</p>
<label>Arbeitstitel
<input type="text" wire:model.live.debounce.300ms="workingTitle" @disabled(! $editable) required>
<span class="luf-help">Nur in der Verwaltung. Auf Karten erscheint er, wenn kein Anzeigename gepflegt ist.</span>
</label>
<label>Anzeigename
<input type="text" wire:model.live.debounce.300ms="displayTitle" @disabled(! $editable)>
<span class="luf-help">Titel der Website-Karte und der Bibliothekskarte.</span>
</label>
<label>Kurzbeschreibung
<textarea wire:model.live.debounce.300ms="summary" @disabled(! $editable)></textarea>
<span class="luf-help">Text der Kacheln, auch auf schmalen Karten. Die Website zeigt diese Kurzbeschreibung, nicht die ausführliche Beschreibung.</span>
</label>
<label>Beschreibung
<textarea wire:model.live.debounce.300ms="descriptionText" @disabled(! $editable)></textarea>
<span class="luf-help">Ausführlicher Text in der Verwaltung. Er erscheint nicht auf der öffentlichen Karte.</span>
</label>
<label>Einsatzhinweis
<textarea wire:model.live.debounce.300ms="usageNote" @disabled(! $editable)></textarea>
<span class="luf-help">Interner Hinweis für die Redaktion. Keine Produktlizenz und nicht öffentlich.</span>
</label>
<label>Inhaltsart
<select wire:model.live="kindId" @disabled(! $editable)>
<option value="">Keine eigene Inhaltsart</option>
@foreach ($options['kinds'] as $id => $label)
<option value="{{ $id }}">{{ $label }}</option>
@endforeach
</select>
<span class="luf-help">Fachliche Art, zum Beispiel Traineranleitung. Traineranleitungen erscheinen nie öffentlich.</span>
</label>
<fieldset>
<legend>Fachliche Säulen</legend>
<div class="luf-ws-checks">
@foreach ($options['pillars'] as $pillar)
<label><input type="checkbox" value="{{ $pillar->id }}" wire:model="pillarIds" @disabled(! $editable)> {{ $pillar->name }}</label>
@endforeach
</div>
</fieldset>
@foreach ($options['dimensions'] as $dimension)
<fieldset>
<legend>{{ $dimension->label }}</legend>
<div class="luf-ws-checks">
@foreach ($dimension->values as $value)
<label><input type="checkbox" value="{{ $value->id }}" wire:model="dimensionIds" @disabled(! $editable)> {{ $value->label }}</label>
@endforeach
</div>
</fieldset>
@endforeach
@if ($editable)
<button type="submit">Angaben speichern</button>
@endif
</form>
@include('filament.media.preview-frame')
</div>
@endif
@if ($fokus === 'herkunft')
<form class="luf-ws" wire:submit="saveEditorial">
<p>Die Rechte am Medium sind von den Lizenzen zu unterscheiden, die später an Käufer vergeben werden. Eine freigegebene Fassung macht das Medium nicht öffentlich.</p>
<label>Interner Lizenzvermerk
<textarea wire:model="licenseNote" @disabled(! $editable)></textarea>
<span class="luf-help">Nur in der Verwaltung. Quelle, Urheber und Einschränkungen der Nutzung dieses Mediums.</span>
</label>
<label>Einsatzhinweis
<textarea wire:model="usageNote" @disabled(! $editable)></textarea>
</label>
@if ($editable)
<button type="submit">Herkunft speichern</button>
@endif
</form>
<h2>Änderungen an den Angaben</h2>
@php($history = $this->editorialHistory())
@if ($history === [])
<p>Noch keine protokollierte Änderung.</p>
@else
<ul>
@foreach ($history as $change)
<li>{{ $change['when'] }} · {{ $change['field'] }}@if ($change['after'] !== '') · {{ \Illuminate\Support\Str::limit($change['after'], 80) }}@endif</li>
@endforeach
</ul>
@endif
@endif
@if ($fokus === 'verwendung')
@php($card = $this->usageCard())
<p>Eine Verwendung verweist auf eine konkrete Fassung. Die Rolle steht an der Verwendung, nicht als Kopie des Mediums.</p>
@include('filament.media.usages', ['card' => $card])
@endif
@if ($fokus === 'auswahl')
<p>Dieselbe Auswahl wie im Modul und Programm. Der Zusammenhang bestimmt, was sinnvoll ist. Entwürfe bleiben im Modul sichtbar, damit die gemeinsame Freigabe weiter möglich ist.</p>
<div class="luf-scopes" role="group" aria-label="Zusammenhang">
@foreach (['modul' => 'Modul oder Programm', 'bild' => 'Vorschaubild', 'website' => 'Website'] as $value => $label)
<button type="button" class="luf-quiet" wire:click="$set('pickerContext', '{{ $value }}')" aria-pressed="{{ $this->pickerContext === $value ? 'true' : 'false' }}">{{ $label }}</button>
@endforeach
</div>
<div class="luf-scopes" role="group" aria-label="Darstellung">
<button type="button" class="luf-quiet" wire:click="$set('pickerLayout', 'kacheln')" aria-pressed="{{ $this->pickerLayout === 'kacheln' ? 'true' : 'false' }}">Kacheln</button>
<button type="button" class="luf-quiet" wire:click="$set('pickerLayout', 'liste')" aria-pressed="{{ $this->pickerLayout === 'liste' ? 'true' : 'false' }}">Liste</button>
</div>
<label>Suche
<input type="search" wire:model.live.debounce.250ms="pickerQuery" placeholder="Titel oder Beschreibung">
</label>
@if ($this->pickerContext === 'bild')
<p class="luf-note">Nur Bilder. Filme und Texte sind hier nicht wählbar, weil sie kein Vorschaubild des Bestands sind.</p>
@elseif ($this->pickerContext === 'website')
<p class="luf-note">Für die Website zählen nur freigegebene Präsentationsdaten. Eine Auswahl hier veröffentlicht nichts. Geschützte Dateien bleiben geschützt. Das Widget der Website nutzt dieselben Regeln.</p>
@else
<p class="luf-note">Filme, Texte, Dokumente und Module. Entwürfe sind dabei, eine freigegebene Fassung ist gekennzeichnet.</p>
@endif
@php($result = $this->selection())
<div class="luf-picker">
@if ($result['items'] === [])
<p class="luf-empty">Nichts gefunden.</p>
@else
<ul @class(['luf-cards', 'luf-cards-list' => $this->pickerLayout === 'liste'])>
@foreach ($result['items'] as $hit)
<li wire:key="auswahl-{{ $hit['target'] }}">
<button type="button" class="luf-card luf-tone-{{ $hit['tone'] ?? 'text' }}" wire:click="$set('pickerSelected', '{{ $hit['target'] }}')" aria-pressed="{{ $this->pickerSelected === $hit['target'] ? 'true' : 'false' }}">
<span class="luf-figure">
@if (! empty($hit['image']))
<img src="{{ $hit['image'] }}" alt="">
@else
<span class="luf-sr">Kein Titelbild</span>
@endif
</span>
<span class="luf-card-body">
<span class="luf-kind">{{ $hit['kind'] }}</span>
<strong>{{ $hit['title'] }}</strong>
<span class="luf-meta">{{ $hit['version_label'] }}</span>
@if (filled($hit['visibility'] ?? null))
<span class="luf-note">{{ $hit['visibility'] }}</span>
@endif
</span>
</button>
</li>
@endforeach
</ul>
@endif
<aside class="luf-detail">
@if ($detail = $this->selectionDetail())
<p class="luf-kicker">{{ $detail['kind'] }}</p>
<h3>{{ $detail['title'] }}</h3>
<p>{{ $detail['version_label'] }}</p>
@if (filled($detail['visibility'] ?? null))
<p>{{ $detail['visibility'] }}</p>
@endif
@if ($this->pickerContext === 'bild' && $editable)
<button type="button" wire:click="adoptLibraryImage">Als Vorschaubild übernehmen</button>
@if ($this->pictureFeedback !== '')
<p role="status">{{ $this->pictureFeedback }}</p>
@endif
@elseif ($this->pickerContext === 'website')
<p class="luf-note">Die Karte auf der Website liest Anzeigename und Kurzbeschreibung aus diesem Medium. Die Datei wird nicht verlinkt.</p>
@else
<p class="luf-note">Im Modul übernimmst du diese Fassung in den Aufbau. Hier wird nichts eingebaut.</p>
@endif
@if ($detail['edit_url'] ?? null)
<p><a href="{{ $detail['edit_url'] }}">In der Verwaltung öffnen</a></p>
@endif
@else
<p>Wähle einen Eintrag.</p>
@endif
</aside>
</div>
@endif
@if ($fokus === 'vorschau')
<p>Die Vorschau nutzt die Website-Karte und die Karte der Bibliothek. Ein Bibliotheksbild ist in der Vorschau sichtbar und damit nicht öffentlich freigegeben. Die ausführliche Beschreibung erscheint auf diesen Karten nicht.</p>
@include('filament.media.preview-frame')
@endif
</div>
@@ -256,4 +256,20 @@
@media (prefers-reduced-motion: reduce) {
.luf-media * { scroll-behavior: auto; }
}
.luf-ws-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; }
.luf-ws-tabs button { min-height: 2.75rem; padding: 0.35rem 0.8rem; border: 1px solid var(--luf-line); background: #fff; color: var(--luf-ink); }
.luf-ws-tabs button[aria-pressed="true"] { background: var(--luf-pine); color: #fff; border-color: var(--luf-pine); }
.luf-ws { display: grid; gap: 1rem; max-width: 72rem; }
.luf-ws-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 24rem); gap: 1.25rem; align-items: start; }
.luf-ws label { display: grid; gap: 0.25rem; font-weight: 600; }
.luf-ws input[type="text"], .luf-ws input[type="search"], .luf-ws textarea, .luf-ws select { font: inherit; width: 100%; min-height: 2.75rem; border: 1px solid var(--luf-line); background: #fff; padding: 0.4rem 0.6rem; }
.luf-ws textarea { min-height: 6rem; }
.luf-ws .luf-help { font-weight: 400; color: #3d4f45; }
.luf-ws-checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.luf-ws-checks label { font-weight: 400; grid-auto-flow: column; align-items: center; }
.luf-live-preview-stage { width: 100%; overflow: hidden; }
.luf-live-preview-frame { border: 0; transform-origin: top left; display: block; background: #fff; }
@media (max-width: 860px) {
.luf-ws-grid { grid-template-columns: 1fr; }
}
</style>
@@ -0,0 +1,20 @@
<div class="luf-ws">
<div class="luf-scopes" role="group" aria-label="Darstellung">
<button type="button" wire:click="$set('previewSurface', 'website')" aria-pressed="{{ $this->previewSurface === 'website' ? 'true' : 'false' }}">Website-Karte</button>
<button type="button" wire:click="$set('previewSurface', 'bibliothek')" aria-pressed="{{ $this->previewSurface === 'bibliothek' ? 'true' : 'false' }}">Bibliothek</button>
</div>
<div class="luf-scopes" role="group" aria-label="Breite">
<button type="button" wire:click="$set('previewWidth', '640')" aria-pressed="{{ $this->previewWidth === '640' ? 'true' : 'false' }}">Desktop</button>
<button type="button" wire:click="$set('previewWidth', '390')" aria-pressed="{{ $this->previewWidth === '390' ? 'true' : 'false' }}">Mobil</button>
</div>
<p class="luf-help">Die Website-Karte zeigt Anzeigename oder Arbeitstitel und die Kurzbeschreibung. Die Bibliothekskarte zeigt dieselben Angaben. Ob ein Mitglied sie öffnen darf, entscheidet die Lizenz, nicht diese Vorschau.</p>
@include('filament.cms.widget-live-preview', [
'html' => $this->previewHtml(),
'stylesheets' => \App\Filament\Support\WidgetEditor::previewStylesheets(),
'width' => (int) $this->previewWidth,
'bodyClass' => $this->previewSurface === 'bibliothek' ? 'member' : '',
'caption' => $this->previewSurface === 'bibliothek'
? 'Bibliothekskarte bei '.$this->previewWidth.' px. Dieselbe Karte wie im Mitgliederbereich.'
: 'Website-Karte bei '.$this->previewWidth.' px. Dieselbe Karte wie im öffentlichen Auftritt. Das Bibliotheksbild ist nur hier sichtbar.',
])
</div>
@@ -1,8 +1,30 @@
@php
use App\Domain\Catalog\ContentVersionStatus;
$fokus = $this->bereich;
@endphp
@include('filament.media.library-styles')
@include('filament.editorial.styles')
<nav class="luf-ws-tabs" aria-label="Bereiche des Mediums">
@foreach ([
'beschreibung' => 'Beschreibung',
'inhalt' => 'Inhalt',
'fassungen' => 'Fassungen',
'herkunft' => 'Herkunft',
'verwendung' => 'Verwendung',
'auswahl' => 'Auswahl',
'vorschau' => 'Vorschau',
] as $value => $label)
<button type="button" wire:click="$set('bereich', '{{ $value }}')" aria-pressed="{{ $fokus === $value ? 'true' : 'false' }}">{{ $label }}</button>
@endforeach
</nav>
@if (in_array($fokus, ['beschreibung', 'herkunft', 'verwendung', 'auswahl', 'vorschau'], true))
@include('filament.media.editor-panels')
@else
<div style="display: grid; gap: 1.5rem;">
@if ($fokus !== 'fassungen')
<section style="display: grid; gap: 0.75rem;">
<h2 style="font-size: 1.125rem; font-weight: 600;">{{ $element->working_title }}</h2>
@if (filled($element->description))
@@ -60,6 +82,7 @@
@endif
</section>
@endif
@endif
<section style="display: grid; gap: 0.75rem;">
@if ($shown === null)
@@ -127,7 +150,7 @@
@endif
</section>
@if ($usage !== [])
@if ($fokus !== 'fassungen' && $usage !== [])
<section style="display: grid; gap: 0.35rem;">
<h2 style="font-size: 1.125rem; font-weight: 600;">Verwendung</h2>
@foreach ($usage as $line)
@@ -136,3 +159,30 @@
</section>
@endif
</div>
@endif
<script>
window.lufLivePreview = window.lufLivePreview || function (frame) {
const stage = frame.parentElement;
const width = Number(frame.dataset.width) || 640;
const fit = () => {
const doc = frame.contentDocument;
if (!doc || !doc.documentElement || !stage) return;
const scale = Math.min(1, stage.clientWidth / width);
frame.style.width = width + 'px';
const height = doc.documentElement.scrollHeight;
frame.style.height = height + 'px';
frame.style.transform = 'scale(' + scale + ')';
stage.style.height = Math.ceil(height * scale) + 'px';
};
fit();
try {
const doc = frame.contentDocument;
doc.fonts?.ready.then(fit);
if (window.ResizeObserver) {
new ResizeObserver(fit).observe(doc.body);
new ResizeObserver(fit).observe(stage);
}
} catch (error) {}
};
</script>
+142
View File
@@ -0,0 +1,142 @@
<?php
namespace Tests\Feature;
use App\Domain\Catalog\CompositionKind;
use App\Domain\Catalog\ContentService;
use App\Domain\Catalog\IdentityChange;
use App\Domain\Cms\Catalog\PublicMaterialReader;
use App\Filament\Resources\ContentElements\Pages\ViewContentElement;
use App\Filament\Resources\Exercises\Pages\EditExercise;
use App\Filament\Support\EditorialCatalog;
use App\Models\User;
use Filament\Facades\Filament;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Livewire\Livewire;
use Tests\TestCase;
class MediaEditorTest extends TestCase
{
use RefreshDatabase;
protected function setUp(): void
{
parent::setUp();
Filament::setCurrentPanel(Filament::getPanel('verwaltung'));
}
public function test_editorial_text_is_saved_without_a_new_version_and_previewed_on_the_real_cards(): void
{
$content = app(ContentService::class);
$element = $content->createElement('film', 'film', 'Lara im Park');
$version = $content->publishElementVersion($element, 'Film');
$editor = $this->editor();
$this->actingAs($editor, 'staff');
Livewire::test(ViewContentElement::class, ['record' => $element->getKey()])
->set('bereich', 'beschreibung')
->set('displayTitle', 'Lara im Park, neu')
->set('summary', 'Ein kurzer Teaser für die Karte')
->set('descriptionText', 'Ausführliche Beschreibung nur in der Verwaltung')
->call('saveEditorial')
->assertSee('Gespeichert. Es gibt keine neue Fassung.')
->assertSee('Ein kurzer Teaser für die Karte')
->assertSee('lf-pc');
$element->refresh();
$this->assertSame(1, $element->versions()->count());
$this->assertSame($version->id, $element->versions()->first()->id);
$this->assertSame('Lara im Park, neu', $element->display_title);
$this->assertSame('Ein kurzer Teaser für die Karte', $element->summary);
$this->assertTrue(
IdentityChange::query()->where('subject_id', $element->id)->where('field', 'summary')->exists()
);
$draft = app(PublicMaterialReader::class)->subject($element->id, true, [
'summary' => 'Noch nicht gespeichert',
]);
$this->assertSame('Noch nicht gespeichert', $draft->summary);
$this->assertSame('Ein kurzer Teaser für die Karte', $element->fresh()->summary);
Livewire::test(ViewContentElement::class, ['record' => $element->getKey()])
->set('bereich', 'vorschau')
->set('summary', 'Noch nicht gespeichert')
->set('previewSurface', 'bibliothek')
->assertSee('media-card')
->assertSee('Noch nicht gespeichert');
}
public function test_the_picker_keeps_drafts_for_modules_and_limits_images_and_website_choices(): void
{
$content = app(ContentService::class);
$film = $content->publishElementVersion($content->createElement('film', 'film', 'Lara im Park'), 'Film');
$draft = $content->draftElementVersion($content->createElement('text', 'text', 'Offener Entwurf'), 'Text');
$image = $content->createElement('bild', 'bild', 'Szenenbild');
$image->thumbnail_path = 'vorschau/szenenbild.jpg';
$image->save();
$content->publishElementVersion($image, null, ['file' => 'inhalte/szenenbild.jpg']);
$module = $content->createComposition('Abstand', CompositionKind::Uebung);
$editor = $this->editor();
$this->actingAs($editor, 'staff');
$modulePicker = Livewire::test(EditExercise::class, ['record' => $module->id])
->call('openPicker')
->set('pickerQuery', 'Offener');
$titles = array_column($modulePicker->instance()->pickerResult()['items'], 'title');
$this->assertContains('Offener Entwurf', $titles);
$modulePicker->assertSee('Entwürfe bleiben sichtbar');
$page = Livewire::test(ViewContentElement::class, ['record' => $film->element->getKey()])
->set('bereich', 'auswahl')
->set('pickerContext', 'bild');
$imageTitles = array_column($page->instance()->selection()['items'], 'title');
$this->assertContains('Szenenbild', $imageTitles);
$this->assertNotContains('Lara im Park', $imageTitles);
$page->assertSee('Nur Bilder');
$page->set('pickerContext', 'website');
$websiteTitles = array_column($page->instance()->selection()['items'], 'title');
$this->assertContains('Offener Entwurf', $websiteTitles);
$this->assertNotContains('Abstand', $websiteTitles);
$page->assertSee('veröffentlicht nichts');
$target = null;
foreach ($page->instance()->selection()['items'] as $item) {
if ($item['title'] === 'Szenenbild') {
$target = $item['target'];
}
}
$page->set('pickerContext', 'bild')
->set('pickerSelected', $target)
->call('adoptLibraryImage')
->assertSee('keine neue Fassung');
$film->element->refresh();
$this->assertSame('vorschau/szenenbild.jpg', $film->element->thumbnail_path);
$this->assertSame(1, $film->element->versions()->count());
$this->assertSame($draft->id, $draft->fresh()->id);
}
public function test_browsing_images_does_not_return_films(): void
{
$content = app(ContentService::class);
$content->publishElementVersion($content->createElement('film', 'film', 'Nur ein Film'), 'Film');
$content->publishElementVersion($content->createElement('bild', 'bild', 'Nur ein Bild'), null, ['file' => 'inhalte/bild.jpg']);
$titles = array_column(
app(EditorialCatalog::class)->browse('', 'bild', '', 0)['items'],
'title',
);
$this->assertSame(['Nur ein Bild'], $titles);
}
private function editor(): User
{
$editor = User::factory()->redakteur()->create();
$editor->saveAppAuthenticationSecret('JBSWY3DPEHPK3PXP');
return $editor;
}
}