Führe die gemeinsame Bestandsliste für Arbeitsplatz, Module, Programme und Medien ein.
Dokument 14 §3 und §9: eine gepflegte Liste statt Kartenwand, Filterwand und Filament-Tabellen. - Gemeinsamer Eintrag x-vw.eintrag (Vorschau, Titel, Typzeile), genutzt vom Picker und von allen Listen. - Ansicht verwaltung/bestand mit Trait ShowsBestand: Suche, wenige sichtbare Filter, „Weitere Filter“, aktive Filter als entfernbare Chips mit „Alle zurücksetzen“, Trefferzahl, Zeilen mit Zustand und benannten Aktionen, Kacheln als Option, „Weitere anzeigen“ in Schritten von 50, Leerzustand und eigener Dialogbereich (sonst öffnen „… anlegen“-Dialoge nicht). - Arbeitsplatz, „Module“ und „Programme“ zeigen dieselben Zeilen (ListsCompositions); die Listen mit festem Typ. Ein Anlegedialog für Module und Programme statt Inline-Feldern und eines zweiten Filament-Dialogs; die Anlage nutzt wie bisher EditorialCatalog::create. - Medien: Suche, Technische Art, Freigabe und Verwendung sichtbar, die übrigen acht Filter unter „Weitere Filter“; alle Adressnamen bleiben. Grundansicht ist jetzt die Liste (Dokument 14: kompakte Listen), Kacheln bleiben wählbar. - Hauptknöpfe im Filament-Seitenkopf im Verwaltungsgrün. - Entfernt: media/library, media/card, media/mark (ersetzt). Tests bewusst angepasst: Die Medienliste öffnet als Liste; das Ersatzsymbol nennt die Art über data-symbol. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f846c0b2ee
commit
532979aa86
19 files changed
+948
-557
No files matched your search
@@ -2,20 +2,21 @@
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Domain\Catalog\Composition;
|
||||
use App\Domain\Catalog\CompositionKind;
|
||||
use App\Domain\Catalog\ContentVersionStatus;
|
||||
use App\Domain\Catalog\EditorialDimension;
|
||||
use App\Domain\Catalog\IdentityDimensionValue;
|
||||
use App\Filament\Resources\ContentElements\ContentElementResource;
|
||||
use App\Filament\Support\EditorialCatalog;
|
||||
use App\Filament\Support\ListsCompositions;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Support\Enums\Width;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
use Livewire\Attributes\Url;
|
||||
|
||||
/**
|
||||
* Arbeitsplatz: Programme und Module in der gemeinsamen Bestandsliste. Die Listen „Module“ und „Programme“ zeigen
|
||||
* dieselben Zeilen mit festem Typ (ListsCompositions).
|
||||
*/
|
||||
class EditorialDesk extends Page
|
||||
{
|
||||
use ListsCompositions;
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Inhalte';
|
||||
|
||||
protected static ?string $navigationLabel = 'Arbeitsplatz';
|
||||
@@ -28,24 +29,6 @@ class EditorialDesk extends Page
|
||||
|
||||
protected string $view = 'filament.editorial.desk-page';
|
||||
|
||||
#[Url]
|
||||
public string $query = '';
|
||||
|
||||
#[Url]
|
||||
public string $kindFilter = 'alle';
|
||||
|
||||
#[Url]
|
||||
public string $pillar = '';
|
||||
|
||||
#[Url]
|
||||
public string $visibility = 'alle';
|
||||
|
||||
public string $programName = '';
|
||||
|
||||
public string $moduleName = '';
|
||||
|
||||
public string $feedback = '';
|
||||
|
||||
public function getHeading(): string|Htmlable|null
|
||||
{
|
||||
return 'Programme und Module';
|
||||
@@ -53,7 +36,7 @@ public function getHeading(): string|Htmlable|null
|
||||
|
||||
public function getSubheading(): string|Htmlable|null
|
||||
{
|
||||
return 'Vorhandene Einträge öffnen oder einen neuen anlegen. Technische Kennungen sind dafür nicht nötig.';
|
||||
return 'Vorhandene Einträge öffnen oder einen neuen anlegen. Ein Programm ordnet Module; ein Modul ordnet Medien und Texte.';
|
||||
}
|
||||
|
||||
public function getMaxContentWidth(): Width|string|null
|
||||
@@ -66,185 +49,11 @@ public static function canAccess(): bool
|
||||
return ContentElementResource::editor();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{label: string, values: list<array{id: int, label: string}>}>
|
||||
*/
|
||||
public function dimensionFilters(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
$groups = [];
|
||||
|
||||
foreach (EditorialDimension::query()->with('values')->orderBy('label')->get() as $dimension) {
|
||||
$values = [];
|
||||
|
||||
foreach ($dimension->values as $value) {
|
||||
$values[] = ['id' => $value->id, 'label' => $value->label];
|
||||
}
|
||||
|
||||
if ($values !== []) {
|
||||
$groups[] = ['label' => $dimension->label, 'values' => $values];
|
||||
}
|
||||
}
|
||||
|
||||
return $groups;
|
||||
}
|
||||
|
||||
public function resetFilters(): void
|
||||
{
|
||||
$this->query = '';
|
||||
$this->kindFilter = 'alle';
|
||||
$this->pillar = '';
|
||||
$this->visibility = 'alle';
|
||||
}
|
||||
|
||||
public function hasActiveFilters(): bool
|
||||
{
|
||||
return trim($this->query) !== '' || $this->kindFilter !== 'alle' || $this->pillar !== '' || $this->visibility !== 'alle';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array<string, mixed>>
|
||||
*/
|
||||
public function entries(): array
|
||||
{
|
||||
$query = trim($this->query);
|
||||
$needle = mb_strtolower($query);
|
||||
$catalog = app(EditorialCatalog::class);
|
||||
$offered = $catalog->offeredCompositionIds();
|
||||
$pillarIds = $this->pillar === '' ? null : $this->pillarSubjects((int) $this->pillar);
|
||||
$rows = [];
|
||||
|
||||
$compositions = Composition::query()
|
||||
->whereIn('kind', [CompositionKind::Kurs, CompositionKind::Uebung])
|
||||
->with(['editorialContentKind', 'versions.members.contentElementVersion.element'])
|
||||
->orderBy('designation')
|
||||
->get();
|
||||
|
||||
foreach ($compositions as $composition) {
|
||||
$kind = $composition->kind instanceof CompositionKind
|
||||
? $composition->kind
|
||||
: CompositionKind::from((string) $composition->kind);
|
||||
|
||||
if ($this->kindFilter === 'programm' && $kind !== CompositionKind::Kurs) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($this->kindFilter === 'modul' && $kind !== CompositionKind::Uebung) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($pillarIds !== null && ! in_array($composition->id, $pillarIds, true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$stand = $catalog->stand($composition);
|
||||
|
||||
if (! $this->matchesVisibility($stand)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$title = $catalog->compositionTitle($composition);
|
||||
$summary = (string) ($composition->summary ?? '');
|
||||
$haystack = mb_strtolower($title.' '.$composition->designation.' '.$summary.' '.(string) $composition->description);
|
||||
|
||||
if ($needle !== '' && ! str_contains($haystack, $needle)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$cover = $catalog->cover($composition, $this->coverMembers($composition));
|
||||
$rows[] = [
|
||||
'title' => $title,
|
||||
'kind' => $kind->deskLabel(),
|
||||
'tone' => $kind === CompositionKind::Kurs ? 'programm' : 'modul',
|
||||
'summary' => $summary,
|
||||
'url' => EditorialCatalog::editUrl($composition),
|
||||
'image' => $cover['url'],
|
||||
'image_note' => $cover['note'],
|
||||
'chips' => $catalog->statusChips($composition, in_array($composition->id, $offered, true)),
|
||||
];
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{target: string}>
|
||||
*/
|
||||
private function coverMembers(Composition $composition): array
|
||||
{
|
||||
$draft = $composition->working_draft;
|
||||
|
||||
if (is_array($draft) && is_array($draft['members'] ?? null) && $draft['members'] !== []) {
|
||||
return $draft['members'];
|
||||
}
|
||||
|
||||
$version = $composition->versions
|
||||
->filter(fn ($item): bool => $item->status === ContentVersionStatus::Bereit)
|
||||
->sortByDesc('number')
|
||||
->first();
|
||||
|
||||
if ($version === null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$members = [];
|
||||
|
||||
foreach ($version->members as $member) {
|
||||
$target = $member->content_element_version_id
|
||||
? 'element:'.$member->content_element_version_id
|
||||
: 'composition:'.$member->nested_composition_version_id;
|
||||
$members[] = ['target' => $target];
|
||||
}
|
||||
|
||||
return $members;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<int>
|
||||
*/
|
||||
private function pillarSubjects(int $valueId): array
|
||||
{
|
||||
return IdentityDimensionValue::query()
|
||||
->where('subject_type', (new Composition)->getMorphClass())
|
||||
->where('editorial_dimension_value_id', $valueId)
|
||||
->pluck('subject_id')
|
||||
->map(fn (mixed $id): int => (int) $id)
|
||||
->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array{text: string, number: int|null, released_number: int|null} $stand
|
||||
*/
|
||||
private function matchesVisibility(array $stand): bool
|
||||
{
|
||||
return match ($this->visibility) {
|
||||
'bibliothek' => $stand['released_number'] !== null,
|
||||
'verborgen' => $stand['number'] !== null && $stand['released_number'] === null,
|
||||
'entwurf' => $stand['number'] === null,
|
||||
default => true,
|
||||
};
|
||||
}
|
||||
|
||||
public function createProgram(): void
|
||||
{
|
||||
$this->create(CompositionKind::Kurs, $this->programName);
|
||||
}
|
||||
|
||||
public function createModule(): void
|
||||
{
|
||||
$this->create(CompositionKind::Uebung, $this->moduleName);
|
||||
}
|
||||
|
||||
private function create(CompositionKind $kind, string $name): void
|
||||
{
|
||||
$name = trim($name);
|
||||
|
||||
if ($name === '') {
|
||||
$this->feedback = 'Der Name fehlt.';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$composition = app(EditorialCatalog::class)->create($name, $kind);
|
||||
$this->redirect(EditorialCatalog::editUrl($composition), navigate: false);
|
||||
return [
|
||||
$this->createCompositionAction(CompositionKind::Uebung),
|
||||
$this->createCompositionAction(CompositionKind::Kurs),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -4,38 +4,68 @@
|
||||
|
||||
use App\Domain\Catalog\CompositionKind;
|
||||
use App\Domain\Catalog\ContentService;
|
||||
use App\Domain\Catalog\EditorialContentKind;
|
||||
use App\Filament\Resources\ContentElements\ContentElementResource;
|
||||
use App\Filament\Support\ListsCompositions;
|
||||
use App\Filament\Support\ReportsDomainRules;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
use Filament\Schemas\Components\View;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Enums\Width;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
|
||||
/**
|
||||
* Listen „Module“ und „Programme“: dieselbe Bestandsliste wie der Arbeitsplatz, mit festem Typ. Fachliche
|
||||
* Kombinationen behalten vorerst ihre Tabelle (Teil B, Abschnitt 3).
|
||||
*/
|
||||
abstract class ListCompositionKind extends ListRecords
|
||||
{
|
||||
use ListsCompositions;
|
||||
use ReportsDomainRules;
|
||||
|
||||
abstract protected function kind(): CompositionKind;
|
||||
|
||||
protected function fixedKind(): ?CompositionKind
|
||||
{
|
||||
return $this->kind();
|
||||
}
|
||||
|
||||
private function usesBestand(): bool
|
||||
{
|
||||
return in_array($this->kind(), [CompositionKind::Kurs, CompositionKind::Uebung], true);
|
||||
}
|
||||
|
||||
public function getSubheading(): string|Htmlable|null
|
||||
{
|
||||
$desk = in_array($this->kind(), [CompositionKind::Kurs, CompositionKind::Uebung], true)
|
||||
? ' Programme und Module liegen gemeinsam auf dem Arbeitsplatz.'
|
||||
: '';
|
||||
$desk = $this->usesBestand() ? ' Programme und Module stehen gemeinsam auch auf dem Arbeitsplatz.' : '';
|
||||
|
||||
return $this->kind()->deskExplanation().$desk;
|
||||
}
|
||||
|
||||
public function getMaxContentWidth(): Width|string|null
|
||||
{
|
||||
return $this->usesBestand() ? Width::Full : parent::getMaxContentWidth();
|
||||
}
|
||||
|
||||
public function content(Schema $schema): Schema
|
||||
{
|
||||
if (! $this->usesBestand()) {
|
||||
return parent::content($schema);
|
||||
}
|
||||
|
||||
return $schema->components([View::make('filament.verwaltung.bestand')]);
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
if ($this->usesBestand()) {
|
||||
return [$this->createCompositionAction($this->kind())];
|
||||
}
|
||||
|
||||
return [
|
||||
Action::make('create')
|
||||
->label(match ($this->kind()) {
|
||||
CompositionKind::Kurs => 'Programm anlegen',
|
||||
CompositionKind::Uebung => 'Modul anlegen',
|
||||
default => $this->kind()->createLabel(),
|
||||
})
|
||||
->label($this->kind()->createLabel())
|
||||
->visible(fn (): bool => ContentElementResource::editor())
|
||||
->schema([
|
||||
TextInput::make('designation')->label('Bezeichnung')->required(),
|
||||
@@ -44,16 +74,6 @@ protected function getHeaderActions(): array
|
||||
$composition = null;
|
||||
$this->report(function () use ($data, &$composition): void {
|
||||
$composition = app(ContentService::class)->createComposition($data['designation'], $this->kind());
|
||||
$slug = match ($this->kind()) {
|
||||
CompositionKind::Kurs => 'programm',
|
||||
CompositionKind::Uebung => 'modul',
|
||||
default => null,
|
||||
};
|
||||
$editorial = $slug === null ? null : EditorialContentKind::query()->where('slug', $slug)->first();
|
||||
if ($editorial !== null) {
|
||||
$composition->editorial_content_kind_id = $editorial->id;
|
||||
$composition->save();
|
||||
}
|
||||
}, $this->kind()->label().' ist angelegt.');
|
||||
|
||||
if ($composition !== null) {
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
|
||||
use App\Domain\Catalog\EditorialContentKind;
|
||||
use App\Filament\Resources\ContentElements\ContentElementResource;
|
||||
use App\Filament\Support\Bestand;
|
||||
use App\Filament\Support\MediaLibrary;
|
||||
use App\Filament\Support\MediumForm;
|
||||
use App\Filament\Support\ReportsDomainRules;
|
||||
use App\Filament\Support\ShowsBestand;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
use Filament\Schemas\Components\RenderHook;
|
||||
@@ -20,14 +22,16 @@
|
||||
class ListContentElements extends ListRecords
|
||||
{
|
||||
use ReportsDomainRules;
|
||||
use ShowsBestand;
|
||||
|
||||
protected static string $resource = ContentElementResource::class;
|
||||
|
||||
#[Url(as: 'suche', except: '')]
|
||||
public string $suche = '';
|
||||
|
||||
#[Url(as: 'ansicht', except: 'kacheln')]
|
||||
public string $ansicht = 'kacheln';
|
||||
/** Dokument 14 §3: kompakte Liste als Grundansicht; Kacheln bleiben wählbar. */
|
||||
#[Url(as: 'ansicht', except: 'liste')]
|
||||
public string $ansicht = 'liste';
|
||||
|
||||
#[Url(as: 'art', except: '')]
|
||||
public string $art = '';
|
||||
@@ -72,9 +76,8 @@ public function getMaxContentWidth(): Width|string|null
|
||||
public function content(Schema $schema): Schema
|
||||
{
|
||||
return $schema->components([
|
||||
$this->getTabsContentComponent(),
|
||||
RenderHook::make(PanelsRenderHook::RESOURCE_PAGES_LIST_RECORDS_TABLE_BEFORE),
|
||||
View::make('filament.media.library'),
|
||||
View::make('filament.verwaltung.bestand'),
|
||||
RenderHook::make(PanelsRenderHook::RESOURCE_PAGES_LIST_RECORDS_TABLE_AFTER),
|
||||
]);
|
||||
}
|
||||
@@ -152,6 +155,101 @@ public function resetFilters(): void
|
||||
$this->inhaltsart = '';
|
||||
$this->verarbeitung = '';
|
||||
$this->archiv = 'aktiv';
|
||||
$this->bestandGrenze = Bestand::SCHRITT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gemeinsame Bestandsliste: Suche und häufige Filter sichtbar, die übrigen unter „Weitere Filter“.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function bestand(): array
|
||||
{
|
||||
$optionen = fn (array $liste, string $wert, string $label): array => collect($liste)
|
||||
->mapWithKeys(fn (array $eintrag): array => [(string) $eintrag[$wert] => $eintrag[$label]])
|
||||
->all();
|
||||
$weitere = [
|
||||
['eigenschaft' => 'inhaltsart', 'label' => 'Fachliche Materialart', 'vorgabe' => '', 'alle' => 'Alle Materialarten', 'optionen' => $this->contentKindOptions()],
|
||||
['eigenschaft' => 'entwurf', 'label' => 'Entwurf', 'vorgabe' => '', 'alle' => 'Entwurf egal', 'optionen' => ['offen' => 'Offener Entwurf', 'keiner' => 'Kein offener Entwurf']],
|
||||
['eigenschaft' => 'fassung', 'label' => 'Deaktivierte Fassungen', 'vorgabe' => '', 'alle' => 'Regulärer Bestand', 'optionen' => ['mit' => 'Mit deaktivierter Fassung', 'nur' => 'Nur deaktivierte Fassungen']],
|
||||
];
|
||||
|
||||
if (($pillars = $this->pillarOptions()) !== []) {
|
||||
$weitere[] = ['eigenschaft' => 'saeule', 'label' => 'Fachliche Säule', 'vorgabe' => '', 'alle' => 'Alle Säulen', 'optionen' => $optionen($pillars, 'id', 'name')];
|
||||
}
|
||||
|
||||
if (($classes = $this->classificationOptions()) !== []) {
|
||||
$weitere[] = ['eigenschaft' => 'einordnung', 'label' => 'Einordnung', 'vorgabe' => '', 'alle' => 'Alle Einordnungen', 'optionen' => $optionen($classes, 'id', 'label')];
|
||||
}
|
||||
|
||||
$weitere[] = ['eigenschaft' => 'verarbeitung', 'label' => 'Verarbeitung', 'vorgabe' => '', 'alle' => 'Verarbeitung egal', 'optionen' => ['fehler' => 'Verarbeitungsfehler', 'uebernahme' => 'Datei wird übernommen']];
|
||||
$weitere[] = ['eigenschaft' => 'archiv', 'label' => 'Archiv', 'vorgabe' => 'aktiv', 'optionen' => ['aktiv' => 'Aktive Medien', 'archiviert' => 'Archivierte Medien', 'alle' => 'Auch archivierte']];
|
||||
|
||||
return [
|
||||
'suche' => ['eigenschaft' => 'suche', 'label' => 'Suche', 'platzhalter' => 'Titel, Beschreibung oder Suchbegriff'],
|
||||
'filter' => [
|
||||
['eigenschaft' => 'art', 'label' => 'Technische Art', 'vorgabe' => '', 'alle' => 'Alle Arten', 'optionen' => $optionen($this->typeOptions(), 'value', 'label')],
|
||||
['eigenschaft' => 'freigabe', 'label' => 'Freigabe', 'vorgabe' => '', 'alle' => 'Alle Freigaben', 'optionen' => ['freigegeben' => 'Freigegebene Fassung', 'entwurf' => 'Nur offener Entwurf', 'ohne' => 'Keine freigegebene Fassung']],
|
||||
['eigenschaft' => 'nutzung', 'label' => 'Verwendung', 'vorgabe' => '', 'alle' => 'Verwendung egal', 'optionen' => ['verwendet' => 'Verwendet', 'unbenutzt' => 'Nicht verwendet']],
|
||||
],
|
||||
'weitere' => $weitere,
|
||||
'hinweis' => 'Freigabe meint die Fassung des Mediums, nicht die Website und keinen Zugriff. Materialart und Einordnung sind die redaktionelle Klassifikation; Verwendung zeigt, wo das Medium tatsächlich eingebunden ist. Deaktivierte und archivierte Medien bleiben über „Weitere Filter“ auffindbar.',
|
||||
'zeilen' => array_map($this->zeile(...), $this->cards()),
|
||||
'einheit' => ['Medium', 'Medien'],
|
||||
'leer' => ['titel' => 'Noch keine Medien', 'text' => 'Mit „Medium anlegen“ oben lädst du eine Datei hoch oder schreibst einen Text.'],
|
||||
'ansicht' => 'ansicht',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $card
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
private function zeile(array $card): array
|
||||
{
|
||||
$chips = [['label' => $card['stand'], 'ton' => match ($card['standTone']) {
|
||||
'ready' => 'gut',
|
||||
'draft' => 'offen',
|
||||
'blocked' => 'achtung',
|
||||
default => 'leise',
|
||||
}]];
|
||||
|
||||
foreach ([['draftNote', 'offen'], ['blockedNote', 'achtung'], ['processing', 'offen'], ['versionLabel', 'leise']] as [$feld, $ton]) {
|
||||
if (filled($card[$feld] ?? null)) {
|
||||
$chips[] = ['label' => (string) $card[$feld], 'ton' => $ton];
|
||||
}
|
||||
}
|
||||
|
||||
if ($card['archived']) {
|
||||
$chips[] = ['label' => 'Archiviert', 'ton' => 'leise'];
|
||||
}
|
||||
|
||||
return [
|
||||
'schluessel' => 'm'.$card['id'],
|
||||
'titel' => $card['title'],
|
||||
'meta' => $card['type'].(filled($card['editorialKind'] ?? null) ? ' · '.$card['editorialKind'] : ''),
|
||||
'text' => $card['description'],
|
||||
'bild' => $card['image'],
|
||||
'bildAlt' => $card['imageAlt'],
|
||||
'symbol' => match ($card['typeKey']) {
|
||||
'film' => 'film',
|
||||
'bild' => 'bild',
|
||||
'audio' => 'audio',
|
||||
default => 'dokument',
|
||||
},
|
||||
'url' => $card['url'],
|
||||
'chips' => $chips,
|
||||
'hinweise' => array_values(array_filter([
|
||||
$card['imageNote'] ? 'Vorschaubild: '.$card['imageNote'] : null,
|
||||
$card['usageNote'] ? 'Einsatz: '.$card['usageNote'] : null,
|
||||
$card['licenseNote'] ? 'Interner Lizenzvermerk: '.$card['licenseNote'] : null,
|
||||
])),
|
||||
'zusatz' => ['view' => 'filament.media.usages', 'daten' => ['card' => $card]],
|
||||
'aktionen' => array_values(array_filter([
|
||||
['label' => 'Ansehen', 'href' => $card['url'], 'icon' => 'auge'],
|
||||
$card['editUrl'] ? ['label' => 'Redaktion', 'href' => $card['editUrl'], 'icon' => 'stift'] : null,
|
||||
])),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Support;
|
||||
|
||||
/**
|
||||
* Werte der gemeinsamen Bestandsliste (ShowsBestand, Ansicht filament.verwaltung.bestand).
|
||||
*/
|
||||
final class Bestand
|
||||
{
|
||||
/** So viele Einträge zeigt eine Liste zunächst und je „Weitere anzeigen“. */
|
||||
public const SCHRITT = 50;
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Support;
|
||||
|
||||
use App\Domain\Catalog\Composition;
|
||||
use App\Domain\Catalog\CompositionKind;
|
||||
use App\Domain\Catalog\ContentVersionStatus;
|
||||
use App\Domain\Catalog\EditorialDimension;
|
||||
use App\Domain\Catalog\IdentityDimensionValue;
|
||||
use App\Filament\Resources\ContentElements\ContentElementResource;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Livewire\Attributes\Url;
|
||||
|
||||
/**
|
||||
* Eine Liste für Programme und Module (Arbeitsplatz, „Module“, „Programme“): dieselben Zeilen, Filter und derselbe
|
||||
* Anlegedialog. Seiten mit festem Typ setzen fixedKind(); der Arbeitsplatz zeigt beide Arten mit Umschalter.
|
||||
*/
|
||||
trait ListsCompositions
|
||||
{
|
||||
use ShowsBestand;
|
||||
|
||||
#[Url]
|
||||
public string $query = '';
|
||||
|
||||
#[Url]
|
||||
public string $kindFilter = 'alle';
|
||||
|
||||
#[Url]
|
||||
public string $pillar = '';
|
||||
|
||||
#[Url]
|
||||
public string $visibility = 'alle';
|
||||
|
||||
protected function fixedKind(): ?CompositionKind
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function resetFilters(): void
|
||||
{
|
||||
$this->query = '';
|
||||
$this->kindFilter = 'alle';
|
||||
$this->pillar = '';
|
||||
$this->visibility = 'alle';
|
||||
$this->bestandGrenze = Bestand::SCHRITT;
|
||||
}
|
||||
|
||||
public function hasActiveFilters(): bool
|
||||
{
|
||||
return trim($this->query) !== '' || $this->kindFilter !== 'alle' || $this->pillar !== '' || $this->visibility !== 'alle';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function bestand(): array
|
||||
{
|
||||
$fixed = $this->fixedKind();
|
||||
$einheit = match ($fixed) {
|
||||
CompositionKind::Kurs => ['Programm', 'Programme'],
|
||||
CompositionKind::Uebung => ['Modul', 'Module'],
|
||||
default => ['Programm oder Modul', 'Programme und Module'],
|
||||
};
|
||||
$gruppen = [];
|
||||
|
||||
foreach ($this->dimensionFilters() as $gruppe) {
|
||||
$optionen = [];
|
||||
|
||||
foreach ($gruppe['values'] as $value) {
|
||||
$optionen[(string) $value['id']] = $value['label'];
|
||||
}
|
||||
|
||||
$gruppen[] = ['label' => $gruppe['label'], 'optionen' => $optionen];
|
||||
}
|
||||
|
||||
return [
|
||||
'suche' => ['eigenschaft' => 'query', 'label' => 'Suche', 'platzhalter' => 'Titel oder Kurzbeschreibung'],
|
||||
'segmente' => $fixed === null ? [[
|
||||
'eigenschaft' => 'kindFilter', 'label' => 'Art', 'vorgabe' => 'alle',
|
||||
'optionen' => ['alle' => 'Alle', 'programm' => 'Programme', 'modul' => 'Module'],
|
||||
]] : [],
|
||||
'filter' => [[
|
||||
'eigenschaft' => 'visibility', 'label' => 'Stand', 'vorgabe' => 'alle',
|
||||
'optionen' => ['alle' => 'Jeder Stand', 'bibliothek' => 'In der Mitgliederbibliothek', 'verborgen' => 'Nicht in der Mitgliederbibliothek', 'entwurf' => 'Noch ohne Fassung'],
|
||||
]],
|
||||
'weitere' => $gruppen === [] ? [] : [[
|
||||
'eigenschaft' => 'pillar', 'label' => 'Fachliche Einordnung', 'vorgabe' => '', 'alle' => 'Alle Einordnungen', 'gruppen' => $gruppen,
|
||||
]],
|
||||
'zeilen' => $this->entries(),
|
||||
'einheit' => $einheit,
|
||||
'leer' => [
|
||||
'titel' => 'Noch keine '.$einheit[1],
|
||||
'text' => 'Mit „'.($fixed === CompositionKind::Kurs ? 'Programm' : 'Modul').' anlegen“ oben entsteht der erste Eintrag. Der Name genügt.',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{label: string, values: list<array{id: int, label: string}>}>
|
||||
*/
|
||||
public function dimensionFilters(): array
|
||||
{
|
||||
$groups = [];
|
||||
|
||||
foreach (EditorialDimension::query()->with('values')->orderBy('label')->get() as $dimension) {
|
||||
$values = [];
|
||||
|
||||
foreach ($dimension->values as $value) {
|
||||
$values[] = ['id' => $value->id, 'label' => $value->label];
|
||||
}
|
||||
|
||||
if ($values !== []) {
|
||||
$groups[] = ['label' => $dimension->label, 'values' => $values];
|
||||
}
|
||||
}
|
||||
|
||||
return $groups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Zeilen der gemeinsamen Bestandsliste.
|
||||
*
|
||||
* @return list<array<string, mixed>>
|
||||
*/
|
||||
public function entries(): array
|
||||
{
|
||||
$needle = mb_strtolower(trim($this->query));
|
||||
$catalog = app(EditorialCatalog::class);
|
||||
$offered = $catalog->offeredCompositionIds();
|
||||
$pillarIds = $this->pillar === '' ? null : $this->pillarSubjects((int) $this->pillar);
|
||||
$fixed = $this->fixedKind();
|
||||
$kinds = $fixed !== null ? [$fixed] : match ($this->kindFilter) {
|
||||
'programm' => [CompositionKind::Kurs],
|
||||
'modul' => [CompositionKind::Uebung],
|
||||
default => [CompositionKind::Kurs, CompositionKind::Uebung],
|
||||
};
|
||||
$canEdit = ContentElementResource::editor();
|
||||
$rows = [];
|
||||
|
||||
$compositions = Composition::query()
|
||||
->whereIn('kind', $kinds)
|
||||
->with(['editorialContentKind', 'versions.members.contentElementVersion.element'])
|
||||
->orderBy('designation')
|
||||
->get();
|
||||
|
||||
foreach ($compositions as $composition) {
|
||||
$kind = $composition->kind instanceof CompositionKind
|
||||
? $composition->kind
|
||||
: CompositionKind::from((string) $composition->kind);
|
||||
|
||||
if ($pillarIds !== null && ! in_array($composition->id, $pillarIds, true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$stand = $catalog->stand($composition);
|
||||
|
||||
if (! $this->matchesVisibility($stand)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$title = $catalog->compositionTitle($composition);
|
||||
$summary = trim((string) ($composition->summary ?? ''));
|
||||
$haystack = mb_strtolower($title.' '.$composition->designation.' '.$summary.' '.(string) $composition->description);
|
||||
|
||||
if ($needle !== '' && ! str_contains($haystack, $needle)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$cover = $catalog->cover($composition, $this->coverMembers($composition));
|
||||
$url = EditorialCatalog::editUrl($composition);
|
||||
$rows[] = [
|
||||
'schluessel' => 'c'.$composition->id,
|
||||
'titel' => $title,
|
||||
'meta' => $kind->deskLabel().($title !== $composition->designation ? ' · '.$composition->designation : ''),
|
||||
'text' => $summary,
|
||||
'bild' => $cover['url'],
|
||||
'bildFehlt' => 'Kein Titelbild',
|
||||
'hinweise' => filled($cover['note']) ? ['Bild: '.$cover['note']] : [],
|
||||
'symbol' => 'modul',
|
||||
'url' => $url,
|
||||
'chips' => array_map(fn (array $chip): array => [
|
||||
'label' => $chip['label'],
|
||||
'ton' => match ($chip['tone']) {
|
||||
'pine' => 'gut',
|
||||
'yellow' => 'offen',
|
||||
'quiet' => 'leise',
|
||||
default => 'neutral',
|
||||
},
|
||||
], $catalog->statusChips($composition, in_array($composition->id, $offered, true))),
|
||||
'aktionen' => array_values(array_filter([
|
||||
['label' => 'Aufbau', 'href' => $url, 'icon' => 'modul'],
|
||||
$canEdit ? ['label' => 'Redaktion', 'href' => $url.'?redaktion=1', 'icon' => 'stift'] : null,
|
||||
])),
|
||||
];
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Anlegedialog für Module und Programme; derselbe auf dem Arbeitsplatz und in den Listen.
|
||||
*/
|
||||
protected function createCompositionAction(CompositionKind $kind): Action
|
||||
{
|
||||
$label = $kind === CompositionKind::Kurs ? 'Programm' : 'Modul';
|
||||
|
||||
return Action::make($kind === CompositionKind::Kurs ? 'createProgram' : 'createModule')
|
||||
->label($label.' anlegen')
|
||||
->modalHeading('Neues '.$label)
|
||||
->modalDescription('Der Name genügt. Danach öffnet sich der Aufbau; Texte, Bilder und Einordnung folgen dort und in der Redaktion.')
|
||||
->modalSubmitActionLabel($label.' anlegen')
|
||||
->modalWidth('lg')
|
||||
->visible(fn (): bool => ContentElementResource::editor())
|
||||
->schema([
|
||||
TextInput::make('designation')->label('Name')->required()->maxLength(255),
|
||||
])
|
||||
->action(function (array $data) use ($kind): void {
|
||||
abort_unless(ContentElementResource::editor(), 403);
|
||||
$composition = app(EditorialCatalog::class)->create(trim((string) $data['designation']), $kind);
|
||||
$this->redirect(EditorialCatalog::editUrl($composition), navigate: false);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{target: string}>
|
||||
*/
|
||||
private function coverMembers(Composition $composition): array
|
||||
{
|
||||
$draft = $composition->working_draft;
|
||||
|
||||
if (is_array($draft) && is_array($draft['members'] ?? null) && $draft['members'] !== []) {
|
||||
return $draft['members'];
|
||||
}
|
||||
|
||||
$version = $composition->versions
|
||||
->filter(fn ($item): bool => $item->status === ContentVersionStatus::Bereit)
|
||||
->sortByDesc('number')
|
||||
->first();
|
||||
|
||||
if ($version === null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$members = [];
|
||||
|
||||
foreach ($version->members as $member) {
|
||||
$members[] = ['target' => $member->content_element_version_id
|
||||
? 'element:'.$member->content_element_version_id
|
||||
: 'composition:'.$member->nested_composition_version_id];
|
||||
}
|
||||
|
||||
return $members;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<int>
|
||||
*/
|
||||
private function pillarSubjects(int $valueId): array
|
||||
{
|
||||
return IdentityDimensionValue::query()
|
||||
->where('subject_type', (new Composition)->getMorphClass())
|
||||
->where('editorial_dimension_value_id', $valueId)
|
||||
->pluck('subject_id')
|
||||
->map(fn (mixed $id): int => (int) $id)
|
||||
->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array{text: string, number: int|null, released_number: int|null} $stand
|
||||
*/
|
||||
private function matchesVisibility(array $stand): bool
|
||||
{
|
||||
return match ($this->visibility) {
|
||||
'bibliothek' => $stand['released_number'] !== null,
|
||||
'verborgen' => $stand['number'] !== null && $stand['released_number'] === null,
|
||||
'entwurf' => $stand['number'] === null,
|
||||
default => true,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Support;
|
||||
|
||||
/**
|
||||
* Gemeinsame Bestandsliste (Ansicht filament.verwaltung.bestand). Die Seite beschreibt Suche, Filter und Zeilen in
|
||||
* bestand() und setzt alle Filter in resetFilters() zurück. Die Liste zeigt zunächst Bestand::SCHRITT Einträge; jede
|
||||
* Filteränderung beginnt wieder oben.
|
||||
*/
|
||||
trait ShowsBestand
|
||||
{
|
||||
public int $bestandGrenze = Bestand::SCHRITT;
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
abstract public function bestand(): array;
|
||||
|
||||
abstract public function resetFilters(): void;
|
||||
|
||||
public function mehrAnzeigen(): void
|
||||
{
|
||||
$this->bestandGrenze += Bestand::SCHRITT;
|
||||
}
|
||||
|
||||
public function updatedShowsBestand(string $name): void
|
||||
{
|
||||
if ($name !== 'bestandGrenze') {
|
||||
$this->bestandGrenze = Bestand::SCHRITT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{{--
|
||||
Gemeinsamer Eintrag (Dokument 14 §3 und §9): kleine Vorschau, Titel, Typzeile. Genutzt vom Picker und von allen
|
||||
Bestandslisten. Das ganze Element ist ein Link oder Knopf ($as), damit Bild und Titel dieselbe Handlung auslösen.
|
||||
Weitere Inhalte (Kurztext, Chips) kommen über den Slot in den Textbereich.
|
||||
--}}
|
||||
@props([
|
||||
'titel',
|
||||
'meta' => null,
|
||||
'bild' => null,
|
||||
'bildNotiz' => null,
|
||||
'bildFehlt' => null,
|
||||
'bildAlt' => '',
|
||||
'symbol' => 'dokument',
|
||||
'titelId' => null,
|
||||
'as' => 'a',
|
||||
])
|
||||
<{{ $as }} {{ $attributes->class('vw-eintrag') }}>
|
||||
<span class="vw-bild">
|
||||
@if (filled($bild))
|
||||
<img src="{{ $bild }}" alt="{{ $bildAlt }}" loading="lazy">
|
||||
@else
|
||||
<span class="vw-bild-ersatz" data-symbol="{{ $symbol }}">@include('filament.verwaltung.icon', ['name' => $symbol])@if (filled($bildFehlt))<span class="vw-sr">{{ $bildFehlt }}</span>@endif</span>
|
||||
@endif
|
||||
@if (filled($bildNotiz))
|
||||
<span class="vw-bild-art">{{ $bildNotiz }}</span>
|
||||
@endif
|
||||
</span>
|
||||
<span class="vw-eintrag-text">
|
||||
<strong @if (filled($titelId)) id="{{ $titelId }}" @endif>{{ $titel }}</strong>
|
||||
@if (filled($meta))
|
||||
<span class="vw-eintrag-meta">{{ $meta }}</span>
|
||||
@endif
|
||||
{{ $slot }}
|
||||
</span>
|
||||
</{{ $as }}>
|
||||
@@ -1,73 +1,3 @@
|
||||
<x-filament-panels::page>
|
||||
@include('filament.editorial.styles')
|
||||
<div class="luf-work">
|
||||
@if ($this->feedback !== '')
|
||||
<p class="luf-feedback" role="status">{{ $this->feedback }}</p>
|
||||
@endif
|
||||
<div class="luf-desk-create">
|
||||
<form wire:submit="createModule" class="luf-inline">
|
||||
<label for="neues-modul">Neues Modul</label>
|
||||
<input id="neues-modul" type="text" wire:model="moduleName" placeholder="Name" required>
|
||||
<button class="luf-primary" type="submit">Modul anlegen</button>
|
||||
</form>
|
||||
<form wire:submit="createProgram" class="luf-inline">
|
||||
<label for="neues-programm">Neues Programm</label>
|
||||
<input id="neues-programm" type="text" wire:model="programName" placeholder="Name" required>
|
||||
<button class="luf-primary" type="submit">Programm anlegen</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="luf-toolbar">
|
||||
<div class="luf-field">
|
||||
<label for="redaktion-suche">Suche</label>
|
||||
<input id="redaktion-suche" type="search" wire:model.live.debounce.300ms="query" placeholder="Titel oder Kurzbeschreibung">
|
||||
</div>
|
||||
<div class="luf-scopes" role="group" aria-label="Art">
|
||||
<button type="button" class="luf-quiet" wire:click="$set('kindFilter', 'alle')" aria-pressed="{{ $this->kindFilter === 'alle' ? 'true' : 'false' }}">Alle</button>
|
||||
<button type="button" class="luf-quiet" wire:click="$set('kindFilter', 'programm')" aria-pressed="{{ $this->kindFilter === 'programm' ? 'true' : 'false' }}">Programme</button>
|
||||
<button type="button" class="luf-quiet" wire:click="$set('kindFilter', 'modul')" aria-pressed="{{ $this->kindFilter === 'modul' ? 'true' : 'false' }}">Module</button>
|
||||
</div>
|
||||
<div class="luf-scopes" role="group" aria-label="Sichtbarkeit">
|
||||
<button type="button" class="luf-quiet" wire:click="$set('visibility', 'alle')" aria-pressed="{{ $this->visibility === 'alle' ? 'true' : 'false' }}">Jeder Stand</button>
|
||||
<button type="button" class="luf-quiet" wire:click="$set('visibility', 'bibliothek')" aria-pressed="{{ $this->visibility === 'bibliothek' ? 'true' : 'false' }}">In der Bibliothek</button>
|
||||
<button type="button" class="luf-quiet" wire:click="$set('visibility', 'verborgen')" aria-pressed="{{ $this->visibility === 'verborgen' ? 'true' : 'false' }}">Nicht in der Bibliothek</button>
|
||||
<button type="button" class="luf-quiet" wire:click="$set('visibility', 'entwurf')" aria-pressed="{{ $this->visibility === 'entwurf' ? 'true' : 'false' }}">Nur Entwürfe</button>
|
||||
</div>
|
||||
@if ($this->dimensionFilters() !== [])
|
||||
<div class="luf-field">
|
||||
<label for="redaktion-saeule">Fachliche Einordnung</label>
|
||||
<select id="redaktion-saeule" wire:model.live="pillar">
|
||||
<option value="">Alle Einordnungen</option>
|
||||
@foreach ($this->dimensionFilters() as $group)
|
||||
<optgroup label="{{ $group['label'] }}">
|
||||
@foreach ($group['values'] as $value)
|
||||
<option value="{{ $value['id'] }}">{{ $value['label'] }}</option>
|
||||
@endforeach
|
||||
</optgroup>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if ($this->hasActiveFilters())
|
||||
<p class="luf-note">Aktive Filter grenzen die Liste ein.
|
||||
<button type="button" class="luf-quiet" wire:click="resetFilters">Filter zurücksetzen</button>
|
||||
</p>
|
||||
@endif
|
||||
@if ($this->entries() === [])
|
||||
<div class="luf-empty">
|
||||
@if ($this->hasActiveFilters())
|
||||
<p>Nichts gefunden. Prüfe die Schreibweise oder setze die Filter zurück.</p>
|
||||
<button type="button" class="luf-quiet" wire:click="resetFilters">Filter zurücksetzen</button>
|
||||
@else
|
||||
<p>Noch keine Programme oder Module. Der Name oben genügt, um das erste anzulegen.</p>
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
<ul class="luf-catalogs">
|
||||
@foreach ($this->entries() as $entry)
|
||||
<li>@include('filament.editorial.catalog-card', ['card' => $entry])</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
</div>
|
||||
@include('filament.verwaltung.bestand')
|
||||
</x-filament-panels::page>
|
||||
@@ -1,50 +0,0 @@
|
||||
<article class="luf-medium luf-tone-{{ $card['typeKey'] }} {{ $list ? 'is-list' : 'is-tile' }}">
|
||||
<a class="luf-medium-figure" href="{{ $card['url'] }}" aria-label="{{ $card['title'] }} ansehen">
|
||||
@if ($card['image'])
|
||||
<img src="{{ $card['image'] }}" alt="{{ $card['imageAlt'] }}">
|
||||
@else
|
||||
@include('filament.media.mark', ['typeKey' => $card['typeKey'], 'type' => $card['type']])
|
||||
@endif
|
||||
@if ($card['imageNote'])
|
||||
<span class="luf-medium-figure-note">{{ $card['imageNote'] }}</span>
|
||||
@endif
|
||||
</a>
|
||||
<div class="luf-medium-body">
|
||||
<p class="luf-medium-kind">{{ $card['type'] }}@if (! empty($card['editorialKind'])) · {{ $card['editorialKind'] }}@endif</p>
|
||||
<a class="luf-medium-title" href="{{ $card['url'] }}">{{ $card['title'] }}</a>
|
||||
@if ($card['description'])
|
||||
<p class="luf-medium-copy">{{ $card['description'] }}</p>
|
||||
@endif
|
||||
@if ($card['usageNote'])
|
||||
<p class="luf-medium-copy luf-medium-note"><span class="luf-medium-kicker">Einsatz</span> {{ $card['usageNote'] }}</p>
|
||||
@endif
|
||||
@if ($card['licenseNote'])
|
||||
<p class="luf-medium-copy luf-medium-note"><span class="luf-medium-kicker">Interner Lizenzvermerk</span> {{ $card['licenseNote'] }}</p>
|
||||
@endif
|
||||
<div class="luf-medium-flags">
|
||||
<span class="luf-flag luf-flag-{{ $card['standTone'] }}">{{ $card['stand'] }}</span>
|
||||
@if ($card['draftNote'])
|
||||
<span class="luf-flag luf-flag-draft">{{ $card['draftNote'] }}</span>
|
||||
@endif
|
||||
@if ($card['blockedNote'])
|
||||
<span class="luf-flag luf-flag-blocked">{{ $card['blockedNote'] }}</span>
|
||||
@endif
|
||||
@if ($card['processing'])
|
||||
<span class="luf-flag luf-flag-wait">{{ $card['processing'] }}</span>
|
||||
@endif
|
||||
@if ($card['archived'])
|
||||
<span class="luf-flag luf-flag-quiet">Archiviert</span>
|
||||
@endif
|
||||
@if ($card['versionLabel'])
|
||||
<span class="luf-flag luf-flag-quiet">{{ $card['versionLabel'] }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@include('filament.media.usages', ['card' => $card])
|
||||
<div class="luf-medium-actions">
|
||||
<a class="luf-medium-link" href="{{ $card['url'] }}">Ansehen</a>
|
||||
@if ($card['editUrl'])
|
||||
<a class="luf-medium-link" href="{{ $card['editUrl'] }}">Redaktion</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
@@ -1,146 +0,0 @@
|
||||
@php
|
||||
$cards = $this->cards();
|
||||
$list = $this->showingList();
|
||||
$count = count($cards);
|
||||
@endphp
|
||||
|
||||
@include('filament.media.library-styles')
|
||||
|
||||
<div class="luf-media">
|
||||
<div class="luf-media-bar">
|
||||
<div class="luf-media-switch" role="group" aria-label="Ansicht">
|
||||
<button type="button" class="luf-media-quiet" wire:click="$set('ansicht', 'kacheln')" aria-pressed="{{ $list ? 'false' : 'true' }}">Kacheln</button>
|
||||
<button type="button" class="luf-media-quiet" wire:click="$set('ansicht', 'liste')" aria-pressed="{{ $list ? 'true' : 'false' }}">Liste</button>
|
||||
</div>
|
||||
<p class="luf-media-count" aria-live="polite">{{ $count === 1 ? '1 Medium' : $count.' Medien' }}</p>
|
||||
</div>
|
||||
|
||||
<div class="luf-media-filters">
|
||||
<div class="luf-media-field is-wide">
|
||||
<label for="medien-suche">Suche</label>
|
||||
<input id="medien-suche" type="search" wire:model.live.debounce.300ms="suche" placeholder="Titel oder Beschreibung">
|
||||
</div>
|
||||
<div class="luf-media-field">
|
||||
<label for="medien-art">Technische Art</label>
|
||||
<select id="medien-art" wire:model.live="art">
|
||||
<option value="">Alle Arten</option>
|
||||
@foreach ($this->typeOptions() as $type)
|
||||
<option value="{{ $type['value'] }}">{{ $type['label'] }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="luf-media-field">
|
||||
<label for="medien-inhaltsart">Fachliche Materialart</label>
|
||||
<select id="medien-inhaltsart" wire:model.live="inhaltsart">
|
||||
<option value="">Alle Materialarten</option>
|
||||
@foreach ($this->contentKindOptions() as $id => $label)
|
||||
<option value="{{ $id }}">{{ $label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="luf-media-field">
|
||||
<label for="medien-freigabe">Freigabe</label>
|
||||
<select id="medien-freigabe" wire:model.live="freigabe">
|
||||
<option value="">Alle Freigaben</option>
|
||||
<option value="freigegeben">Freigegebene Fassung</option>
|
||||
<option value="entwurf">Nur offener Entwurf</option>
|
||||
<option value="ohne">Keine freigegebene Fassung</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="luf-media-field">
|
||||
<label for="medien-entwurf">Entwurf</label>
|
||||
<select id="medien-entwurf" wire:model.live="entwurf">
|
||||
<option value="">Entwurf egal</option>
|
||||
<option value="offen">Offener Entwurf</option>
|
||||
<option value="keiner">Kein offener Entwurf</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="luf-media-field">
|
||||
<label for="medien-fassung">Deaktivierte Fassungen</label>
|
||||
<select id="medien-fassung" wire:model.live="fassung">
|
||||
<option value="">Regulärer Bestand</option>
|
||||
<option value="mit">Mit deaktivierter Fassung</option>
|
||||
<option value="nur">Nur deaktivierte Fassungen</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="luf-media-field">
|
||||
<label for="medien-nutzung">Verwendung</label>
|
||||
<select id="medien-nutzung" wire:model.live="nutzung">
|
||||
<option value="">Verwendung egal</option>
|
||||
<option value="verwendet">Verwendet</option>
|
||||
<option value="unbenutzt">Nicht verwendet</option>
|
||||
</select>
|
||||
</div>
|
||||
@if ($pillars = $this->pillarOptions())
|
||||
<div class="luf-media-field">
|
||||
<label for="medien-saeule">Fachliche Säule</label>
|
||||
<select id="medien-saeule" wire:model.live="saeule">
|
||||
<option value="">Alle Säulen</option>
|
||||
@foreach ($pillars as $pillar)
|
||||
<option value="{{ $pillar['id'] }}">{{ $pillar['name'] }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@endif
|
||||
@if ($classes = $this->classificationOptions())
|
||||
<div class="luf-media-field">
|
||||
<label for="medien-einordnung">Einordnung</label>
|
||||
<select id="medien-einordnung" wire:model.live="einordnung">
|
||||
<option value="">Alle Einordnungen</option>
|
||||
@foreach ($classes as $class)
|
||||
<option value="{{ $class['id'] }}">{{ $class['label'] }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@endif
|
||||
<div class="luf-media-field">
|
||||
<label for="medien-verarbeitung">Verarbeitung</label>
|
||||
<select id="medien-verarbeitung" wire:model.live="verarbeitung">
|
||||
<option value="">Verarbeitung egal</option>
|
||||
<option value="fehler">Verarbeitungsfehler</option>
|
||||
<option value="uebernahme">Datei wird übernommen</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="luf-media-field">
|
||||
<label for="medien-archiv">Archiv</label>
|
||||
<select id="medien-archiv" wire:model.live="archiv">
|
||||
<option value="aktiv">Aktive Medien</option>
|
||||
<option value="archiviert">Archivierte Medien</option>
|
||||
<option value="alle">Auch archivierte</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="luf-media-hint">Freigabe meint die Fassung des Mediums. Sie ist weder die Veröffentlichung auf der Website noch ein Nachweis, dass jemand das Medium öffnen darf. Die Materialart und die Einordnung sind die redaktionelle Klassifikation. Verwendung zeigt, wo das Medium tatsächlich referenziert ist, und ist keine Klassifikation. Medien, die nur noch deaktivierte Fassungen haben, und archivierte Medien bleiben über die Filter auffindbar.</p>
|
||||
|
||||
@if ($this->filtersActive())
|
||||
<p class="luf-media-reset">
|
||||
<button type="button" class="luf-media-quiet" wire:click="resetFilters">Filter zurücksetzen</button>
|
||||
</p>
|
||||
@endif
|
||||
|
||||
<p class="luf-media-loading" wire:loading.delay role="status">Die Übersicht wird aktualisiert.</p>
|
||||
|
||||
<div wire:loading.delay.class="is-pending" aria-busy="false">
|
||||
@if ($cards === [])
|
||||
<div class="luf-media-empty">
|
||||
@if ($this->filtersActive())
|
||||
<p>Keine Medien entsprechen der Auswahl.</p>
|
||||
<button type="button" class="luf-media-quiet" wire:click="resetFilters">Filter zurücksetzen</button>
|
||||
@else
|
||||
<p>Noch keine Medien im regulären Bestand.</p>
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
<ul class="{{ $list ? 'luf-media-rows' : 'luf-media-grid' }}" data-ansicht="{{ $list ? 'liste' : 'kacheln' }}">
|
||||
@foreach ($cards as $card)
|
||||
<li wire:key="medium-{{ $card['id'] }}">
|
||||
@include('filament.media.card', ['card' => $card, 'list' => $list])
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
</div>
|
||||
{{-- Die Liste ersetzt die Filament-Tabelle, die sonst den Dialogbereich der Seite ausgibt (z. B. „Medium anlegen“). --}}
|
||||
<x-filament-actions::modals />
|
||||
</div>
|
||||
@@ -1,34 +0,0 @@
|
||||
<span class="luf-medium-mark" data-fallback="{{ $typeKey }}" aria-hidden="true">
|
||||
@switch($typeKey)
|
||||
@case('film')
|
||||
<svg viewBox="0 0 160 90">
|
||||
<rect x="18" y="22" width="124" height="46" fill="none" stroke="currentColor" stroke-width="3"/>
|
||||
<path d="M72 35 L98 45 L72 55 Z" fill="currentColor"/>
|
||||
</svg>
|
||||
@break
|
||||
@case('audio')
|
||||
<svg viewBox="0 0 160 90">
|
||||
<path d="M30 45 H46 L66 28 V62 L46 45 Z" fill="none" stroke="currentColor" stroke-width="3"/>
|
||||
<path d="M80 34 Q96 45 80 56 M96 26 Q122 45 96 64" fill="none" stroke="currentColor" stroke-width="3"/>
|
||||
</svg>
|
||||
@break
|
||||
@case('bild')
|
||||
<svg viewBox="0 0 160 90">
|
||||
<rect x="22" y="18" width="116" height="54" fill="none" stroke="currentColor" stroke-width="3"/>
|
||||
<circle cx="58" cy="38" r="7" fill="none" stroke="currentColor" stroke-width="3"/>
|
||||
<path d="M34 62 L62 44 L84 58 L104 40 L126 62" fill="none" stroke="currentColor" stroke-width="3"/>
|
||||
</svg>
|
||||
@break
|
||||
@case('document')
|
||||
<svg viewBox="0 0 160 90">
|
||||
<path d="M58 16 H96 L112 32 V74 H58 Z" fill="none" stroke="currentColor" stroke-width="3"/>
|
||||
<path d="M96 16 V32 H112 M70 46 H100 M70 58 H100" fill="none" stroke="currentColor" stroke-width="3"/>
|
||||
</svg>
|
||||
@break
|
||||
@default
|
||||
<svg viewBox="0 0 160 90">
|
||||
<path d="M36 28 H124 M36 45 H124 M36 62 H96" fill="none" stroke="currentColor" stroke-width="3"/>
|
||||
</svg>
|
||||
@endswitch
|
||||
<span class="luf-sr">{{ $type }}</span>
|
||||
</span>
|
||||
@@ -1,21 +1,22 @@
|
||||
<div class="luf-medium-usage">
|
||||
{{-- Verwendung eines Mediums in der Bestandsliste: Zahl, aufklappbar zu Modul/Programm mit Fassung und Rolle. --}}
|
||||
<div class="vw-verwendung-kurz">
|
||||
@if ($card['usages'] === [])
|
||||
<p class="luf-medium-unused">{{ $card['usageLabel'] }}</p>
|
||||
<p class="vw-feld-hilfe">{{ $card['usageLabel'] }}</p>
|
||||
@else
|
||||
<details>
|
||||
<summary>{{ $card['usageLabel'] }}</summary>
|
||||
<ul>
|
||||
@foreach ($card['usages'] as $usage)
|
||||
<li>
|
||||
<span class="luf-medium-kicker">{{ $usage['type'] }}</span>
|
||||
<a href="{{ $usage['url'] }}">{{ $usage['name'] }}</a>
|
||||
<span>Medium {{ $usage['mediumVersion'] }}, eingesetzt in {{ $usage['hostVersion'] }}@if ($usage['roles'] !== []) · {{ implode(', ', $usage['roles']) }}@endif</span>
|
||||
<span class="vw-feld-hilfe">{{ $usage['type'] }}</span>
|
||||
<a class="vw-link" href="{{ $usage['url'] }}">{{ $usage['name'] }}</a>
|
||||
<span class="vw-feld-hilfe">Medium {{ $usage['mediumVersion'] }}, eingesetzt in {{ $usage['hostVersion'] }}@if ($usage['roles'] !== []) · {{ implode(', ', $usage['roles']) }}@endif</span>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</details>
|
||||
@endif
|
||||
@if ($card['licenseText'])
|
||||
<p class="luf-medium-license">{{ $card['licenseText'] }}</p>
|
||||
<p class="vw-feld-hilfe">{{ $card['licenseText'] }}</p>
|
||||
@endif
|
||||
</div>
|
||||
@@ -0,0 +1,27 @@
|
||||
{{-- Ein Auswahlfilter der Bestandsliste: ['eigenschaft', 'label', 'vorgabe', 'optionen' | 'gruppen', 'alle' => Text der Vorgabe]. --}}
|
||||
@php
|
||||
$feldId = 'filter-'.str_replace('.', '-', $f['eigenschaft']);
|
||||
@endphp
|
||||
<div class="vw-bestand-filter">
|
||||
<label class="vw-feldlabel" for="{{ $feldId }}">{{ $f['label'] }}</label>
|
||||
<select id="{{ $feldId }}" class="vw-auswahlfeld" wire:model.live="{{ $f['eigenschaft'] }}">
|
||||
@if (isset($f['alle']))
|
||||
<option value="{{ $f['vorgabe'] }}">{{ $f['alle'] }}</option>
|
||||
@endif
|
||||
@if (isset($f['optionen']))
|
||||
@foreach ($f['optionen'] as $wert => $label)
|
||||
@if (! isset($f['alle']) || (string) $wert !== (string) $f['vorgabe'])
|
||||
<option value="{{ $wert }}">{{ $label }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@else
|
||||
@foreach ($f['gruppen'] ?? [] as $gruppe)
|
||||
<optgroup label="{{ $gruppe['label'] }}">
|
||||
@foreach ($gruppe['optionen'] as $wert => $label)
|
||||
<option value="{{ $wert }}">{{ $label }}</option>
|
||||
@endforeach
|
||||
</optgroup>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
@@ -0,0 +1,161 @@
|
||||
{{--
|
||||
Gemeinsame Bestandsliste (Dokument 14 §3): Suche, wenige sichtbare Filter, „Weitere Filter“, aktive Filter als
|
||||
entfernbare Chips, Trefferzahl, Zeilen (oder Kacheln) mit Vorschau, Zustand und passenden Aktionen, Leerzustand,
|
||||
„Weitere anzeigen“. Die Seite liefert die Beschreibung über bestand() (Trait ShowsBestand):
|
||||
|
||||
suche ['eigenschaft', 'label', 'platzhalter']
|
||||
segmente / filter / weitere Liste ['eigenschaft', 'label', 'vorgabe', 'optionen' => [wert => label]
|
||||
oder 'gruppen' => [['label', 'optionen' => [wert => label]]]]
|
||||
zeilen Liste ['schluessel', 'titel', 'meta', 'text', 'bild', 'bildNotiz', 'symbol', 'url',
|
||||
'chips' => [['label', 'ton' => gut|offen|achtung|leise|neutral]], 'hinweise' => [string],
|
||||
'aktionen' => [['label', 'href']], 'zusatz' => ['view', 'daten']]
|
||||
einheit [Einzahl, Mehrzahl]; leer ['titel', 'text']; ansicht Name der Eigenschaft für Liste/Kacheln oder null
|
||||
--}}
|
||||
@php
|
||||
$b = $this->bestand();
|
||||
$zeilen = $b['zeilen'];
|
||||
$gesamt = count($zeilen);
|
||||
$sichtbar = array_slice($zeilen, 0, $this->bestandGrenze);
|
||||
$einheit = $b['einheit'] ?? ['Eintrag', 'Einträge'];
|
||||
$optionenVon = function (array $f): array {
|
||||
if (isset($f['optionen'])) {
|
||||
return $f['optionen'];
|
||||
}
|
||||
$alle = [];
|
||||
foreach ($f['gruppen'] ?? [] as $gruppe) {
|
||||
$alle += $gruppe['optionen'];
|
||||
}
|
||||
|
||||
return $alle;
|
||||
};
|
||||
$aktiv = [];
|
||||
$suchEigenschaft = $b['suche']['eigenschaft'];
|
||||
if (trim((string) data_get($this, $suchEigenschaft)) !== '') {
|
||||
$aktiv[] = ['label' => 'Suche: „'.trim((string) data_get($this, $suchEigenschaft)).'“', 'eigenschaft' => $suchEigenschaft, 'vorgabe' => ''];
|
||||
}
|
||||
foreach ([...($b['segmente'] ?? []), ...($b['filter'] ?? []), ...($b['weitere'] ?? [])] as $f) {
|
||||
$wert = (string) data_get($this, $f['eigenschaft']);
|
||||
if ($wert !== (string) $f['vorgabe']) {
|
||||
$aktiv[] = ['label' => $f['label'].': '.($optionenVon($f)[$wert] ?? $wert), 'eigenschaft' => $f['eigenschaft'], 'vorgabe' => (string) $f['vorgabe']];
|
||||
}
|
||||
}
|
||||
$weitereAktiv = collect($b['weitere'] ?? [])->filter(fn ($f) => (string) data_get($this, $f['eigenschaft']) !== (string) $f['vorgabe'])->count();
|
||||
$ansichtEigenschaft = $b['ansicht'] ?? null;
|
||||
$kacheln = $ansichtEigenschaft !== null && data_get($this, $ansichtEigenschaft) === 'kacheln';
|
||||
@endphp
|
||||
<div class="vw vw-bestandsseite">
|
||||
<div class="vw-bestand-werkzeuge" role="search">
|
||||
<div class="vw-bestand-suche">
|
||||
<label class="vw-feldlabel" for="bestand-suche">{{ $b['suche']['label'] ?? 'Suche' }}</label>
|
||||
<span class="vw-suchfeld">
|
||||
@include('filament.verwaltung.icon', ['name' => 'suche'])
|
||||
<input id="bestand-suche" class="vw-eingabe" type="search" wire:model.live.debounce.300ms="{{ $suchEigenschaft }}" placeholder="{{ $b['suche']['platzhalter'] ?? '' }}" autocomplete="off">
|
||||
</span>
|
||||
</div>
|
||||
@foreach ($b['segmente'] ?? [] as $f)
|
||||
<div class="vw-bestand-filter">
|
||||
<span class="vw-feldlabel" id="segment-{{ $f['eigenschaft'] }}">{{ $f['label'] }}</span>
|
||||
<div class="vw-segment" role="group" aria-labelledby="segment-{{ $f['eigenschaft'] }}">
|
||||
@foreach ($f['optionen'] as $wert => $label)
|
||||
<button type="button" wire:click="$set('{{ $f['eigenschaft'] }}', '{{ $wert }}')" aria-pressed="{{ (string) data_get($this, $f['eigenschaft']) === (string) $wert ? 'true' : 'false' }}">{{ $label }}</button>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@foreach ($b['filter'] ?? [] as $f)
|
||||
@include('filament.verwaltung.bestand-auswahl', ['f' => $f])
|
||||
@endforeach
|
||||
@if (($b['weitere'] ?? []) !== [])
|
||||
<details class="vw-weitere-filter" @if ($weitereAktiv > 0) open @endif>
|
||||
<summary>@include('filament.verwaltung.icon', ['name' => 'filter'])Weitere Filter @if ($weitereAktiv > 0)<span class="vw-zahl">{{ $weitereAktiv }}</span>@endif</summary>
|
||||
<div class="vw-weitere-filter-felder">
|
||||
@foreach ($b['weitere'] as $f)
|
||||
@include('filament.verwaltung.bestand-auswahl', ['f' => $f])
|
||||
@endforeach
|
||||
</div>
|
||||
</details>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if ($b['hinweis'] ?? null)
|
||||
<p class="vw-feld-hilfe vw-bestand-hinweis">{{ $b['hinweis'] }}</p>
|
||||
@endif
|
||||
|
||||
<div class="vw-bestand-leiste">
|
||||
<p class="vw-bestand-zahl" role="status">
|
||||
<strong>{{ $gesamt }}</strong> {{ $gesamt === 1 ? $einheit[0] : $einheit[1] }}@if ($aktiv !== []) gefunden @endif
|
||||
</p>
|
||||
@if ($aktiv !== [])
|
||||
<ul class="vw-aktive-filter" aria-label="Aktive Filter">
|
||||
@foreach ($aktiv as $chip)
|
||||
<li><button type="button" wire:click="$set('{{ $chip['eigenschaft'] }}', '{{ $chip['vorgabe'] }}')" aria-label="Filter entfernen: {{ $chip['label'] }}">{{ $chip['label'] }} @include('filament.verwaltung.icon', ['name' => 'x'])</button></li>
|
||||
@endforeach
|
||||
<li><button type="button" class="vw-link is-quiet" wire:click="resetFilters">Alle zurücksetzen</button></li>
|
||||
</ul>
|
||||
@endif
|
||||
@if ($ansichtEigenschaft !== null)
|
||||
<div class="vw-segment vw-bestand-ansicht" role="group" aria-label="Darstellung">
|
||||
<button type="button" wire:click="$set('{{ $ansichtEigenschaft }}', 'liste')" aria-pressed="{{ $kacheln ? 'false' : 'true' }}">Liste</button>
|
||||
<button type="button" wire:click="$set('{{ $ansichtEigenschaft }}', 'kacheln')" aria-pressed="{{ $kacheln ? 'true' : 'false' }}">Kacheln</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div wire:loading.class="vw-laedt" wire:target="{{ implode(',', array_filter([$suchEigenschaft, ...array_column([...($b['segmente'] ?? []), ...($b['filter'] ?? []), ...($b['weitere'] ?? [])], 'eigenschaft'), 'resetFilters'])) }}">
|
||||
@if ($zeilen === [])
|
||||
<div class="vw-leer vw-leer-breit">
|
||||
@if ($aktiv !== [])
|
||||
<strong>Nichts gefunden</strong>
|
||||
<p>Prüfe die Schreibweise oder entferne einen Filter.</p>
|
||||
<button type="button" class="vw-btn" wire:click="resetFilters">Alle Filter zurücksetzen</button>
|
||||
@else
|
||||
<strong>{{ $b['leer']['titel'] ?? 'Noch nichts angelegt' }}</strong>
|
||||
<p>{{ $b['leer']['text'] ?? '' }}</p>
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
<ul @class(['vw-bestand', 'is-kacheln' => $kacheln]) data-ansicht="{{ $kacheln ? 'kacheln' : 'liste' }}" aria-label="{{ $einheit[1] }}">
|
||||
@foreach ($sichtbar as $z)
|
||||
<li wire:key="bestand-{{ $z['schluessel'] }}" class="vw-bestand-zeile">
|
||||
<x-vw.eintrag :href="$z['url']" :titel="$z['titel']" :meta="$z['meta'] ?? null" :bild="$z['bild'] ?? null" :bild-notiz="$z['bildNotiz'] ?? null" :bild-fehlt="$z['bildFehlt'] ?? null" :bild-alt="$z['bildAlt'] ?? ''" :symbol="$z['symbol'] ?? 'dokument'">
|
||||
@if (filled($z['text'] ?? null))
|
||||
<span class="vw-eintrag-kurz">{{ $z['text'] }}</span>
|
||||
@endif
|
||||
</x-vw.eintrag>
|
||||
<div class="vw-bestand-zustand">
|
||||
@if (($z['chips'] ?? []) !== [])
|
||||
<ul class="vw-zustaende" aria-label="Zustand">
|
||||
@foreach ($z['chips'] as $chip)
|
||||
<li @class(['vw-zustand', 'is-'.($chip['ton'] ?? 'neutral')])>{{ $chip['label'] }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@foreach ($z['hinweise'] ?? [] as $hinweis)
|
||||
<p class="vw-feld-hilfe">{{ $hinweis }}</p>
|
||||
@endforeach
|
||||
@if (! empty($z['zusatz']))
|
||||
@include($z['zusatz']['view'], $z['zusatz']['daten'] ?? [])
|
||||
@endif
|
||||
</div>
|
||||
@if (($z['aktionen'] ?? []) !== [])
|
||||
<div class="vw-bestand-aktionen">
|
||||
@foreach ($z['aktionen'] as $aktion)
|
||||
<a class="vw-btn is-small" href="{{ $aktion['href'] }}" aria-label="{{ $aktion['label'] }}: {{ $z['titel'] }}">@if (! empty($aktion['icon']))@include('filament.verwaltung.icon', ['name' => $aktion['icon']])@endif{{ $aktion['label'] }}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@if ($gesamt > count($sichtbar))
|
||||
<div class="vw-bestand-mehr">
|
||||
<span class="vw-feld-hilfe">{{ count($sichtbar) }} von {{ $gesamt }} angezeigt</span>
|
||||
<button type="button" class="vw-btn" wire:click="mehrAnzeigen">Weitere {{ min(\App\Filament\Support\Bestand::SCHRITT, $gesamt - count($sichtbar)) }} anzeigen</button>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Listen ersetzen die Filament-Tabelle, die sonst den Dialogbereich der Seite ausgibt (z. B. „… anlegen“). --}}
|
||||
<x-filament-actions::modals />
|
||||
</div>
|
||||
@@ -20,6 +20,7 @@
|
||||
'audio' => '<path d="M9 18V6l10-2v12"/><circle cx="6.5" cy="18" r="2.5"/><circle cx="16.5" cy="16" r="2.5"/>',
|
||||
'extern' => '<path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/>',
|
||||
'modul' => '<rect x="2.5" y="4.5" width="19" height="15" rx="1.5"/><path d="M6 16v-6h3.5v6M10.5 16V8H14v8M15 16v-4.5h3.5V16"/>',
|
||||
'filter' => '<path d="M4 5h16l-6.2 7.4V19l-3.6-1.8v-4.8z"/>',
|
||||
'zuruecksetzen' => '<path d="M4 12a8 8 0 1 0 2.4-5.7L4 8.5M4 4v4.5h4.5"/>',
|
||||
];
|
||||
$name = $name ?? 'info';
|
||||
|
||||
@@ -93,17 +93,9 @@
|
||||
<input type="{{ $mehrfach ? 'checkbox' : 'radio' }}" name="picker-auswahl" @checked($istMarkiert) wire:click="markPicker(@js($ziel), {{ $istMarkiert ? 'false' : 'true' }})" aria-labelledby="{{ $zielId }}">
|
||||
<span class="vw-sr">{{ $istMarkiert ? 'Ausgewählt' : 'Auswählen' }}</span>
|
||||
</label>
|
||||
<span class="vw-bild">
|
||||
@if (! empty($treffer['image']))
|
||||
<img src="{{ $treffer['image'] }}" alt="" loading="lazy">
|
||||
@else
|
||||
<span class="vw-bild-ersatz">@include('filament.verwaltung.icon', ['name' => $symbol($treffer['output'] ?? null)])</span>
|
||||
@endif
|
||||
</span>
|
||||
<button type="button" class="vw-treffer-text" wire:click="inspectPicker(@js($ziel))" aria-pressed="{{ $betrachtet ? 'true' : 'false' }}">
|
||||
<strong id="{{ $zielId }}">{{ $treffer['title'] }}</strong>
|
||||
<span>{{ $treffer['kind'] }}@if (filled($treffer['version_label'] ?? null)) · {{ $treffer['version_label'] }}@endif</span>
|
||||
</button>
|
||||
<x-vw.eintrag as="button" type="button" class="vw-treffer-text" wire:click="inspectPicker('{{ $ziel }}')" aria-pressed="{{ $betrachtet ? 'true' : 'false' }}"
|
||||
:titel="$treffer['title']" :titel-id="$zielId" :bild="$treffer['image'] ?? null" :symbol="$symbol($treffer['output'] ?? null)"
|
||||
:meta="$treffer['kind'].(filled($treffer['version_label'] ?? null) ? ' · '.$treffer['version_label'] : '')" />
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
@@ -346,7 +346,7 @@
|
||||
.vw-picker-detail { min-height: 0; overflow: auto; padding: 1rem 1.5rem 1.25rem; border-left: 1px solid var(--vw-line); background: #fbfbf9; }
|
||||
.vw-treffer { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
|
||||
.vw-treffer li {
|
||||
display: grid; grid-template-columns: var(--vw-target) var(--vw-thumb-small) minmax(0, 1fr); gap: 0.25rem 0.75rem; align-items: center;
|
||||
display: grid; grid-template-columns: var(--vw-target) minmax(0, 1fr); gap: 0.25rem 0.5rem; align-items: center;
|
||||
padding: 0.35rem 0.5rem 0.35rem 0.25rem; border: 1px solid transparent; border-radius: var(--vw-radius); border-bottom-color: var(--vw-line);
|
||||
}
|
||||
.vw-treffer li:hover { background: var(--vw-paper); }
|
||||
@@ -355,9 +355,7 @@
|
||||
.vw-haken { display: grid; place-items: center; width: var(--vw-target); height: var(--vw-target); cursor: pointer; }
|
||||
.vw-haken input { width: 1.25rem; height: 1.25rem; accent-color: var(--vw-pine); cursor: pointer; }
|
||||
.vw-treffer .vw-bild { width: var(--vw-thumb-small); }
|
||||
.vw-treffer-text { display: grid; gap: 0.1rem; min-width: 0; padding: 0.25rem 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
|
||||
.vw-treffer-text strong { font-size: 1.02rem; line-height: 1.3; overflow-wrap: anywhere; }
|
||||
.vw-treffer-text span { color: var(--vw-quiet); font-size: var(--vw-small); }
|
||||
.vw-treffer-text { padding: 0.25rem 0; }
|
||||
.vw-detail { display: grid; gap: 0.85rem; }
|
||||
.vw-detail h3 { font-size: 1.35rem; }
|
||||
.vw-detail-medium { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--vw-radius); overflow: hidden; background: #e4ebe5; }
|
||||
@@ -383,6 +381,79 @@
|
||||
.vw-ersetzt .vw-bild { width: 5rem; }
|
||||
.vw-pruefen-buehne { padding: 1rem; border-radius: var(--vw-radius); background: var(--vw-paper); }
|
||||
|
||||
/* Gemeinsamer Eintrag (Picker und Bestandslisten) */
|
||||
.vw-eintrag { display: grid; grid-template-columns: var(--vw-thumb-small) minmax(0, 1fr); gap: 0.75rem; align-items: center; min-width: 0; padding: 0.15rem; border: 0; border-radius: var(--vw-radius-small); background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
|
||||
.vw-eintrag .vw-bild { width: var(--vw-thumb-small); }
|
||||
.vw-eintrag-text { display: grid; gap: 0.15rem; min-width: 0; }
|
||||
.vw-eintrag-text strong { font-size: 1.02rem; line-height: 1.3; overflow-wrap: anywhere; color: var(--vw-ink); }
|
||||
a.vw-eintrag:hover .vw-eintrag-text strong { text-decoration: underline; text-underline-offset: 0.15em; }
|
||||
.vw-eintrag-meta { color: var(--vw-quiet); font-size: var(--vw-small); }
|
||||
.vw-eintrag-kurz { color: var(--vw-quiet); font-size: var(--vw-small); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
||||
|
||||
/* Gemeinsame Bestandsliste */
|
||||
.vw-bestandsseite { display: grid; gap: 1rem; }
|
||||
.vw-bestand-werkzeuge { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-end; }
|
||||
.vw-bestand-suche { flex: 1 1 20rem; display: grid; gap: 0.3rem; max-width: 30rem; }
|
||||
.vw-suchfeld { position: relative; display: block; }
|
||||
.vw-suchfeld svg { position: absolute; left: 0.75rem; top: 50%; width: 1.15rem; height: 1.15rem; transform: translateY(-50%); color: var(--vw-quiet); pointer-events: none; }
|
||||
.vw-suchfeld .vw-eingabe { width: 100%; padding-left: 2.4rem; }
|
||||
.vw-bestand-filter { display: grid; gap: 0.3rem; flex: 0 1 13rem; min-width: 11rem; }
|
||||
.vw-bestand-filter .vw-segment { min-height: var(--vw-target); }
|
||||
.vw-weitere-filter { flex: 0 0 auto; }
|
||||
.vw-weitere-filter[open] { flex-basis: 100%; }
|
||||
.vw-weitere-filter summary { display: inline-flex; align-items: center; gap: 0.45rem; min-height: var(--vw-target); padding: 0.3rem 0.85rem; border: 1px solid var(--vw-line-strong); border-radius: var(--vw-radius); background: var(--vw-surface); font-weight: 650; cursor: pointer; list-style: none; }
|
||||
.vw-weitere-filter summary::-webkit-details-marker { display: none; }
|
||||
.vw-weitere-filter summary svg { width: 1.05rem; height: 1.05rem; }
|
||||
.vw-weitere-filter summary .vw-zahl { min-width: 1.4rem; padding: 0 0.35rem; border-radius: 999px; background: var(--vw-pine); color: #fff; font-size: var(--vw-tiny); text-align: center; }
|
||||
.vw-weitere-filter[open] summary { border-color: var(--vw-pine); }
|
||||
.vw-weitere-filter-felder { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.75rem 1rem; margin-top: 0.75rem; padding: 1rem; border: 1px solid var(--vw-line); border-radius: var(--vw-radius); background: var(--vw-surface); }
|
||||
.vw-bestand-hinweis { max-width: 60rem; }
|
||||
.vw-bestand-leiste { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; padding-top: 0.75rem; border-top: 1px solid var(--vw-line); }
|
||||
.vw-bestand-zahl { color: var(--vw-quiet); }
|
||||
.vw-bestand-zahl strong { color: var(--vw-ink); }
|
||||
.vw-aktive-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0; padding: 0; list-style: none; }
|
||||
.vw-aktive-filter button:not(.vw-link) { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2rem; padding: 0.15rem 0.6rem; border: 1px solid var(--vw-pine); border-radius: 999px; background: var(--vw-pine-soft); color: var(--vw-pine-dark); font: inherit; font-size: var(--vw-small); font-weight: 600; cursor: pointer; }
|
||||
.vw-aktive-filter button svg { width: 0.9rem; height: 0.9rem; }
|
||||
.vw-bestand-ansicht { margin-left: auto; }
|
||||
.vw-bestand { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--vw-line); }
|
||||
.vw-bestand-zeile { display: grid; grid-template-columns: minmax(16rem, 1.3fr) minmax(12rem, 1fr) auto; gap: 0.5rem 1.25rem; align-items: center; padding: 0.6rem 0.25rem; border-bottom: 1px solid var(--vw-line); }
|
||||
.vw-bestand-zeile:hover { background: var(--vw-surface); }
|
||||
.vw-bestand-zustand { display: grid; gap: 0.3rem; min-width: 0; }
|
||||
.vw-zustaende { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
|
||||
.vw-zustand { padding: 0.1rem 0.5rem; border: 1px solid var(--vw-line-strong); border-radius: var(--vw-radius-small); background: var(--vw-surface); color: var(--vw-quiet); font-size: var(--vw-tiny); font-weight: 600; white-space: nowrap; }
|
||||
.vw-zustand.is-gut { border-color: #b9d6a3; background: var(--vw-pine-soft); color: var(--vw-pine-dark); }
|
||||
.vw-zustand.is-offen { border-color: #efd9a4; background: var(--vw-warn-soft); color: var(--vw-warn); }
|
||||
.vw-zustand.is-achtung { border-color: #e7b3ab; background: #fdf0ee; color: #9b2c1f; }
|
||||
.vw-zustand.is-neutral { color: var(--vw-ink); }
|
||||
.vw-bestand-aktionen { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
|
||||
.vw-verwendung-kurz { display: grid; gap: 0.2rem; font-size: var(--vw-small); }
|
||||
.vw-verwendung-kurz summary { width: fit-content; color: var(--vw-ink); font-weight: 600; cursor: pointer; }
|
||||
.vw-verwendung-kurz ul { display: grid; gap: 0.3rem; margin: 0.35rem 0 0; padding: 0; list-style: none; }
|
||||
.vw-verwendung-kurz li { display: flex; flex-wrap: wrap; gap: 0.1rem 0.4rem; align-items: baseline; }
|
||||
.vw-bestand-mehr { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: center; padding: 1rem 0; }
|
||||
.vw-laedt { opacity: 0.6; transition: opacity 0.15s; }
|
||||
.vw-bestand.is-kacheln { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; border-top: 0; }
|
||||
.vw-bestand.is-kacheln .vw-bestand-zeile { grid-template-columns: minmax(0, 1fr); align-content: start; padding: 0 0 0.85rem; border: 1px solid var(--vw-line); border-radius: var(--vw-radius); background: var(--vw-surface); overflow: hidden; }
|
||||
.vw-bestand.is-kacheln .vw-eintrag { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; padding: 0; border-radius: 0; }
|
||||
.vw-bestand.is-kacheln .vw-eintrag .vw-bild { width: 100%; border-radius: 0; }
|
||||
.vw-bestand.is-kacheln .vw-eintrag-text, .vw-bestand.is-kacheln .vw-bestand-zustand, .vw-bestand.is-kacheln .vw-bestand-aktionen { padding: 0 0.85rem; }
|
||||
.vw-bestand.is-kacheln .vw-bestand-aktionen { justify-content: flex-start; }
|
||||
@media (max-width: 64rem) {
|
||||
.vw-bestand-zeile { grid-template-columns: minmax(0, 1fr) auto; }
|
||||
.vw-bestand-zustand { grid-column: 1 / -1; padding-left: calc(var(--vw-thumb-small) + 0.9rem); }
|
||||
.vw-bestand.is-kacheln .vw-bestand-zustand { padding-left: 0.85rem; }
|
||||
}
|
||||
@media (max-width: 40rem) {
|
||||
.vw-bestand-zeile { grid-template-columns: minmax(0, 1fr); }
|
||||
.vw-bestand-zustand { padding-left: 0; }
|
||||
.vw-bestand-aktionen { justify-content: flex-start; }
|
||||
.vw-bestand-filter, .vw-bestand-suche { flex-basis: 100%; }
|
||||
.vw-bestand-ansicht { margin-left: 0; }
|
||||
}
|
||||
/* Filament-Kopfaktionen (z. B. „… anlegen“) wie .vw-btn.is-primary */
|
||||
.fi-header .fi-ac .fi-btn.fi-color-primary, .fi-header .fi-btn.fi-color-primary { background: var(--vw-pine); color: #fff; }
|
||||
.fi-header .fi-btn.fi-color-primary:hover { background: var(--vw-pine-dark); color: #fff; }
|
||||
|
||||
@container (max-width: 52rem) {
|
||||
.vw-zeile { grid-template-columns: 1.5rem var(--vw-thumb-small) minmax(0, 1fr); grid-template-areas: "griff bild text" "griff aktionen aktionen"; }
|
||||
.vw-zeile .vw-bild { width: var(--vw-thumb-small); }
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Domain\Catalog\Composition;
|
||||
use App\Domain\Catalog\CompositionKind;
|
||||
use App\Domain\Catalog\ContentService;
|
||||
use App\Filament\Pages\EditorialDesk;
|
||||
use App\Filament\Resources\ContentElements\Pages\ListContentElements;
|
||||
use App\Filament\Resources\Courses\Pages\ListCourses;
|
||||
use App\Filament\Resources\Exercises\ExerciseResource;
|
||||
use App\Filament\Resources\Exercises\Pages\ListExercises;
|
||||
use App\Filament\Support\Bestand;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Livewire\Livewire;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Gemeinsame Bestandsliste (Teil B): Arbeitsplatz, Module, Programme und Medien nutzen dieselbe Liste.
|
||||
*/
|
||||
class BestandslisteTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_the_module_list_shows_the_same_rows_as_the_desk_with_a_fixed_type(): void
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
$content->createComposition('Modul Abstand', CompositionKind::Uebung);
|
||||
$content->createComposition('Programm Abstand', CompositionKind::Kurs);
|
||||
$editor = $this->editor();
|
||||
|
||||
Livewire::actingAs($editor, 'staff')
|
||||
->test(ListExercises::class)
|
||||
->assertSee('Modul Abstand')
|
||||
->assertDontSee('Programm Abstand')
|
||||
->assertDontSeeHtml('aria-labelledby="segment-kindFilter"')
|
||||
->assertSeeHtml('wire:partial="action-modals"')
|
||||
->assertSee('Aufbau')
|
||||
->assertSee('Redaktion');
|
||||
|
||||
Livewire::actingAs($editor, 'staff')
|
||||
->test(ListCourses::class)
|
||||
->assertSee('Programm Abstand')
|
||||
->assertDontSee('Modul Abstand');
|
||||
|
||||
Livewire::actingAs($editor, 'staff')
|
||||
->test(EditorialDesk::class)
|
||||
->assertSee('Programm Abstand')
|
||||
->assertSee('Modul Abstand')
|
||||
->assertSeeHtml('wire:partial="action-modals"')
|
||||
->set('kindFilter', 'modul')
|
||||
->assertSee('Art: Module')
|
||||
->assertDontSee('Programm Abstand')
|
||||
->call('resetFilters')
|
||||
->assertSee('Programm Abstand');
|
||||
}
|
||||
|
||||
public function test_desk_and_lists_create_modules_and_programs_through_one_dialog(): void
|
||||
{
|
||||
$editor = $this->editor();
|
||||
|
||||
Livewire::actingAs($editor, 'staff')
|
||||
->test(EditorialDesk::class)
|
||||
->callAction('createModule', ['designation' => 'Neues Modul vom Arbeitsplatz'])
|
||||
->assertHasNoActionErrors()
|
||||
->assertRedirect();
|
||||
|
||||
Livewire::actingAs($editor, 'staff')
|
||||
->test(ListExercises::class)
|
||||
->callAction('createModule', ['designation' => 'Neues Modul aus der Liste'])
|
||||
->assertHasNoActionErrors();
|
||||
|
||||
Livewire::actingAs($editor, 'staff')
|
||||
->test(EditorialDesk::class)
|
||||
->callAction('createProgram', ['designation' => ''])
|
||||
->assertHasActionErrors(['designation' => 'required']);
|
||||
|
||||
$this->assertSame(2, Composition::query()->where('kind', CompositionKind::Uebung)->count());
|
||||
$this->assertSame(0, Composition::query()->where('kind', CompositionKind::Kurs)->count());
|
||||
$created = Composition::query()->where('designation', 'Neues Modul aus der Liste')->firstOrFail();
|
||||
$this->assertSame('modul', $created->editorialContentKind?->slug);
|
||||
}
|
||||
|
||||
public function test_active_filters_are_named_and_removable_and_the_list_grows_in_steps(): void
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
|
||||
foreach (range(1, Bestand::SCHRITT + 3) as $nummer) {
|
||||
$content->createComposition(sprintf('Modul %02d', $nummer), CompositionKind::Uebung);
|
||||
}
|
||||
|
||||
Livewire::actingAs($this->editor(), 'staff')
|
||||
->test(ListExercises::class)
|
||||
->assertSeeText('53 Module')
|
||||
->assertSee('50 von 53 angezeigt')
|
||||
->assertSee('Modul 50')
|
||||
->assertDontSee('Modul 51')
|
||||
->call('mehrAnzeigen')
|
||||
->assertSee('Modul 53')
|
||||
->set('query', 'Modul 5')
|
||||
->assertSet('bestandGrenze', Bestand::SCHRITT)
|
||||
->assertSee('Suche: „Modul 5“')
|
||||
->assertSee('Alle zurücksetzen')
|
||||
->set('visibility', 'entwurf')
|
||||
->assertSee('Stand: Noch ohne Fassung')
|
||||
->set('query', '')
|
||||
->assertDontSee('Suche: „')
|
||||
->call('resetFilters')
|
||||
->assertDontSee('Alle zurücksetzen');
|
||||
}
|
||||
|
||||
public function test_media_filters_keep_their_address_names_and_rarely_used_ones_sit_under_more_filters(): void
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
$content->publishElementVersion($content->createElement('film', 'film', 'Lara im Park'), 'Film');
|
||||
$content->publishElementVersion($content->createElement('text', 'text', 'Trainerhinweis'), 'Text');
|
||||
|
||||
Livewire::withQueryParams(['art' => 'film', 'archiv' => 'alle'])
|
||||
->actingAs($this->editor(), 'staff')
|
||||
->test(ListContentElements::class)
|
||||
->assertSet('art', 'film')
|
||||
->assertSet('archiv', 'alle')
|
||||
->assertSee('Lara im Park')
|
||||
->assertDontSee('Trainerhinweis')
|
||||
->assertSee('Technische Art: Film')
|
||||
->assertSee('Archiv: Auch archivierte')
|
||||
->assertSee('Weitere Filter')
|
||||
->assertSeeHtml('wire:partial="action-modals"')
|
||||
->set('art', '')
|
||||
->assertSee('Trainerhinweis');
|
||||
}
|
||||
|
||||
public function test_only_editors_reach_the_composition_lists(): void
|
||||
{
|
||||
$keeper = User::factory()->katalogverwalter()->create();
|
||||
$keeper->saveAppAuthenticationSecret('JBSWY3DPEHPK3PXP');
|
||||
|
||||
$this->actingAs($keeper, 'staff')->get(ExerciseResource::getUrl('index'))->assertForbidden();
|
||||
$this->actingAs($keeper, 'staff')->get(EditorialDesk::getUrl())->assertForbidden();
|
||||
}
|
||||
|
||||
private function editor(): User
|
||||
{
|
||||
$editor = User::factory()->redakteur()->create();
|
||||
$editor->saveAppAuthenticationSecret('JBSWY3DPEHPK3PXP');
|
||||
|
||||
return $editor;
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ protected function setUp(): void
|
||||
Filament::setCurrentPanel(Filament::getPanel('verwaltung'));
|
||||
}
|
||||
|
||||
public function test_the_library_opens_as_tiles_and_keeps_filters_when_the_view_changes(): void
|
||||
public function test_the_library_opens_as_a_list_and_keeps_filters_when_the_view_changes(): void
|
||||
{
|
||||
$content = app(ContentService::class);
|
||||
$film = $content->createElement('film', 'film', 'Lara im Park');
|
||||
@@ -47,8 +47,8 @@ public function test_the_library_opens_as_tiles_and_keeps_filters_when_the_view_
|
||||
Livewire::actingAs($this->editor(), 'staff')
|
||||
->test(ListContentElements::class)
|
||||
->assertOk()
|
||||
->assertSee('data-ansicht="kacheln"', false)
|
||||
->assertDontSee('data-ansicht="liste"', false)
|
||||
->assertSee('data-ansicht="liste"', false)
|
||||
->assertDontSee('data-ansicht="kacheln"', false)
|
||||
->assertDontSee('Arbeitstitel')
|
||||
->assertSee('Lara im Park')
|
||||
->assertSee('Film')
|
||||
@@ -61,17 +61,17 @@ public function test_the_library_opens_as_tiles_and_keeps_filters_when_the_view_
|
||||
->set('suche', 'Park')
|
||||
->assertSee('Lara im Park')
|
||||
->assertDontSee('Trainerhinweis')
|
||||
->set('ansicht', 'liste')
|
||||
->set('ansicht', 'kacheln')
|
||||
->assertSet('suche', 'Park')
|
||||
->assertSee('data-ansicht="liste"', false)
|
||||
->assertDontSee('data-ansicht="kacheln"', false)
|
||||
->assertSee('data-ansicht="kacheln"', false)
|
||||
->assertDontSee('data-ansicht="liste"', false)
|
||||
->assertSee('Lara im Park')
|
||||
->assertDontSee('Trainerhinweis')
|
||||
->assertSee('Ansehen')
|
||||
->assertSee('Redaktion')
|
||||
->call('resetFilters')
|
||||
->assertSet('suche', '')
|
||||
->assertSet('ansicht', 'liste')
|
||||
->assertSet('ansicht', 'kacheln')
|
||||
->assertSee('Trainerhinweis');
|
||||
}
|
||||
|
||||
@@ -86,7 +86,8 @@ public function test_a_text_medium_is_not_shown_as_a_film_or_as_a_released_versi
|
||||
->assertSee('Felix beim Onkel')
|
||||
->assertSee('Text')
|
||||
->assertSee('Entwurf, noch nicht freigegeben')
|
||||
->assertSee('data-fallback="text"', false)
|
||||
->assertSee('data-symbol="dokument"', false)
|
||||
->assertDontSee('data-symbol="film"', false)
|
||||
->assertDontSee('Fassung 1 freigegeben')
|
||||
->assertDontSee('/redaktion/karte/', false);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user