Zeigt die Mitgliederbibliothek eine ältere Fassung, stand „In der Mitgliederbibliothek“ neben „Fassung 2“ und las sich, als wäre Fassung 2 sichtbar. Der Chip heißt dann nur „Bibliothek zeigt Fassung 1“ (Arbeitsplatz- karten und Register „Fassungen und Verwendung“). Das Menü im Detailbereich des Aufbaus trägt einen eigenen zugänglichen Namen, damit es sich vom Seitenmenü „Weitere Aktionen“ unterscheidet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
221 lines
17 KiB
PHP
221 lines
17 KiB
PHP
{{-- Aufbauarbeitsplatz: kompakte Struktur links, ausgewählte Verwendung rechts (Dokument 06, kombinierter Entwurf). --}}
|
|
@php
|
|
$members = $this->members;
|
|
$anzahl = count($members);
|
|
$auswahl = $this->selected !== null && isset($members[$this->selected]) ? $this->selected : null;
|
|
$gewaehlt = $auswahl !== null ? $members[$auswahl] : null;
|
|
$symbol = fn (?string $tone): string => match ($tone) { 'film' => 'film', 'audio' => 'audio', 'dokument' => 'dokument', 'modul', 'programm' => 'modul', default => 'dokument' };
|
|
$istKomposition = fn (array $m): bool => (bool) preg_match('/^composition(-draft)?:/', (string) ($m['target'] ?? ''));
|
|
$ort = ($this->isProgram() ? 'im Programm' : 'im Modul');
|
|
@endphp
|
|
<div class="vw-aufbau">
|
|
<section class="vw-struktur" aria-labelledby="struktur-titel">
|
|
<div class="vw-struktur-kopf">
|
|
<h2 id="struktur-titel">Aufbau <span class="vw-rolle-zahl">· {{ $anzahl }} {{ $anzahl === 1 ? 'Bestandteil' : 'Bestandteile' }}</span></h2>
|
|
<button type="button" class="vw-btn is-line is-small" wire:click="openPicker">@include('filament.verwaltung.icon', ['name' => 'plus'])Hinzufügen</button>
|
|
</div>
|
|
|
|
@if ($members === [])
|
|
<div class="vw-leer">
|
|
<strong>Noch kein Bestandteil</strong>
|
|
<p>{{ $this->isProgram() ? 'Füge Module oder Medien hinzu.' : 'Füge vorhandene Medien hinzu, erstelle einen Text oder lege ein Medium an. Ein Film ist nicht nötig.' }} Es wird nur verwiesen, nichts kopiert.</p>
|
|
<button type="button" class="vw-btn is-line" wire:click="openPicker">@include('filament.verwaltung.icon', ['name' => 'plus'])Bestandteil hinzufügen</button>
|
|
</div>
|
|
@else
|
|
<ol class="vw-struktur-liste" x-data="{ von: null, ueber: null }" aria-label="Bestandteile in Reihenfolge, sortierbar">
|
|
@foreach ($members as $index => $member)
|
|
@php
|
|
$aktiv = $auswahl === $index;
|
|
$offen = in_array((string) $member['target'], $this->expanded, true);
|
|
$komposition = $istKomposition($member);
|
|
@endphp
|
|
<li wire:key="baustein-{{ $member['target'] }}-{{ $index }}"
|
|
@class(['vw-baustein', 'is-gewaehlt' => $aktiv])
|
|
draggable="true"
|
|
x-on:dragstart="von = {{ $index }}; $event.dataTransfer.effectAllowed = 'move'"
|
|
x-on:dragend="von = null; ueber = null"
|
|
x-on:dragover.prevent="ueber = {{ $index }}"
|
|
x-on:drop.prevent="if (von !== null && von !== {{ $index }}) { $wire.moveTo(von, {{ $index }}) } von = null; ueber = null"
|
|
x-bind:class="{ 'is-ziehen': von === {{ $index }}, 'is-ziel': ueber === {{ $index }} && von !== {{ $index }} }">
|
|
<div class="vw-baustein-zeile">
|
|
<span class="vw-griff" title="Ziehen zum Sortieren. Ohne Ziehen: Alt+Pfeil oder die Knöpfe unter der Liste.">@include('filament.verwaltung.icon', ['name' => 'griff'])<span class="vw-sr">Ziehgriff</span></span>
|
|
<span class="vw-position" aria-hidden="true">{{ $index + 1 }}</span>
|
|
<button type="button" class="vw-baustein-haupt" wire:click="selectPart({{ $index }})"
|
|
@if ($aktiv) aria-current="true" @endif
|
|
aria-label="{{ $member['title'] }}, Stelle {{ $index + 1 }} von {{ $anzahl }}"
|
|
x-on:keydown.alt.arrow-up.prevent="$wire.movePart({{ $index }}, -1)"
|
|
x-on:keydown.alt.arrow-down.prevent="$wire.movePart({{ $index }}, 1)">
|
|
<span class="vw-bild is-klein">
|
|
@if (! empty($member['image']))
|
|
<img src="{{ $member['image'] }}" alt="" loading="lazy">
|
|
@else
|
|
<span class="vw-bild-ersatz">@include('filament.verwaltung.icon', ['name' => $symbol($member['tone'] ?? null)])</span>
|
|
@endif
|
|
</span>
|
|
<span class="vw-baustein-text">
|
|
<strong>{{ $member['title'] }}</strong>
|
|
<span>{{ $member['kind'] }} · {{ $member['version_label'] }}@if (filled($member['role'] ?? null)) · {{ $member['role'] }}@endif</span>
|
|
</span>
|
|
</button>
|
|
@if ($komposition)
|
|
<button type="button" class="vw-btn is-small is-icon vw-aufklapp" wire:click="toggleExpanded({{ $index }})" aria-expanded="{{ $offen ? 'true' : 'false' }}" aria-label="Inhalt von {{ $member['title'] }} {{ $offen ? 'zuklappen' : 'anzeigen' }}">
|
|
@include('filament.verwaltung.icon', ['name' => $offen ? 'hoch' : 'runter'])
|
|
</button>
|
|
@endif
|
|
</div>
|
|
@if ($komposition && $offen)
|
|
@php $kinder = $this->childrenRows((string) $member['target']); @endphp
|
|
<div class="vw-quelleninhalt">
|
|
<p><strong>Inhalt der Quelle</strong> · Nur zur Ansicht</p>
|
|
@forelse ($kinder as $kind)
|
|
<div class="vw-quellenzeile">
|
|
<span class="vw-bild is-mini">
|
|
@if (! empty($kind['image']))<img src="{{ $kind['image'] }}" alt="" loading="lazy">@else<span class="vw-bild-ersatz">@include('filament.verwaltung.icon', ['name' => $symbol($kind['tone'])])</span>@endif
|
|
</span>
|
|
<span><strong>{{ $kind['title'] }}</strong><br><span class="vw-feld-hilfe">{{ $kind['kind'] }}@if ($kind['role'] !== '') · {{ $kind['role'] }}@endif</span></span>
|
|
</div>
|
|
@empty
|
|
<p class="vw-feld-hilfe">Die Quelle hat noch keinen Inhalt.</p>
|
|
@endforelse
|
|
</div>
|
|
@endif
|
|
</li>
|
|
@endforeach
|
|
</ol>
|
|
<div class="vw-struktur-fuss" role="group" aria-label="Reihenfolge der ausgewählten Verwendung">
|
|
<span>@if ($auswahl !== null) Position {{ $auswahl + 1 }} von {{ $anzahl }} @else Keine Verwendung ausgewählt @endif</span>
|
|
<span class="vw-sortierer">
|
|
<button type="button" class="vw-btn is-small is-icon" wire:click="movePart({{ $auswahl ?? 0 }}, -1)" @disabled($auswahl === null || $auswahl === 0) aria-label="Ausgewählte Verwendung nach oben">@include('filament.verwaltung.icon', ['name' => 'hoch'])</button>
|
|
<button type="button" class="vw-btn is-small is-icon" wire:click="movePart({{ $auswahl ?? 0 }}, 1)" @disabled($auswahl === null || $auswahl === $anzahl - 1) aria-label="Ausgewählte Verwendung nach unten">@include('filament.verwaltung.icon', ['name' => 'runter'])</button>
|
|
</span>
|
|
</div>
|
|
@endif
|
|
</section>
|
|
|
|
<section class="vw-detailbereich" aria-label="Ausgewählte Verwendung">
|
|
@if ($gewaehlt === null)
|
|
<div class="vw-leer">
|
|
<strong>Keine Verwendung ausgewählt</strong>
|
|
<p>Wähle links einen Bestandteil. Hier bearbeitest du seine Rolle und seinen Hinweis an dieser Stelle.</p>
|
|
</div>
|
|
@else
|
|
@php
|
|
$alternativen = $this->selectedAlternatives();
|
|
$editUrl = ! empty($gewaehlt['edit_url']) ? $gewaehlt['edit_url'].(str_contains($gewaehlt['edit_url'], '?') ? '&' : '?').'zurueck='.urlencode($this->selfUrl()) : null;
|
|
$istText = ($gewaehlt['output'] ?? '') === 'text';
|
|
@endphp
|
|
<div class="vw-detail-kopf">
|
|
<div>
|
|
<h2>{{ $gewaehlt['title'] }}</h2>
|
|
<p class="vw-kopf-typ">Verwendung {{ $ort }} „{{ trim($this->displayTitle) !== '' ? $this->displayTitle : $this->designation }}“ · Stelle {{ $auswahl + 1 }}</p>
|
|
</div>
|
|
<div class="vw-mehr" x-data="{ offen: false }" x-on:keydown.escape.stop="offen = false; $refs.knopf.focus()" x-on:click.outside="offen = false">
|
|
<button type="button" class="vw-btn" x-ref="knopf" x-on:click="offen = ! offen" x-bind:aria-expanded="offen" aria-haspopup="true" aria-label="Weitere Aktionen für {{ $gewaehlt['title'] }} an dieser Stelle">Weitere Aktionen @include('filament.verwaltung.icon', ['name' => 'runter'])</button>
|
|
<div class="vw-mehr-menue" x-show="offen" x-cloak>
|
|
@if (! empty($gewaehlt['open_url']))
|
|
<a href="{{ $gewaehlt['open_url'] }}" target="_blank" rel="noopener" x-on:click="offen = false"><span>Inhaltsvorschau in neuem Tab</span></a>
|
|
@endif
|
|
@if ($editUrl)
|
|
<a href="{{ $editUrl }}" x-on:click="offen = false"><span>Quelle bearbeiten<small>Öffnet {{ $istKomposition($gewaehlt) ? 'das Modul' : 'das Medium' }} selbst. Ungespeicherte Änderungen am Aufbau vorher speichern.</small></span></a>
|
|
@endif
|
|
<hr>
|
|
<button type="button" wire:click="askConfirmation('removePart', {{ $auswahl }})" x-on:click="offen = false" style="color: var(--vw-error)"><span>Aus diesem Aufbau entfernen<small>Das Quellobjekt bleibt im Bestand.</small></span></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="vw-segment" role="tablist" aria-label="Ansicht der Verwendung">
|
|
@foreach (['stelle' => 'An dieser Stelle', 'quelle' => 'Quelle', 'vorschau' => 'Inhaltsvorschau'] as $wert => $label)
|
|
<button type="button" role="tab" aria-pressed="{{ $this->detailTab === $wert ? 'true' : 'false' }}" aria-selected="{{ $this->detailTab === $wert ? 'true' : 'false' }}" wire:click="$set('detailTab', '{{ $wert }}')">{{ $label }}</button>
|
|
@endforeach
|
|
</div>
|
|
|
|
@if ($this->detailTab === 'quelle')
|
|
<div class="vw-detail-inhalt">
|
|
<p class="vw-band">@include('filament.verwaltung.icon', ['name' => 'info'])<span>Angaben der Quelle. Sie gelten überall, wo {{ $istKomposition($gewaehlt) ? 'dieses Modul' : 'dieses Medium' }} verwendet wird.</span></p>
|
|
<dl class="vw-angaben">
|
|
<dt>Quelle</dt><dd>{{ $gewaehlt['title'] }} · {{ $gewaehlt['kind'] }}</dd>
|
|
<dt>Fassung</dt><dd>{{ $gewaehlt['version_label'] }}</dd>
|
|
@if (filled($gewaehlt['summary'] ?? null))<dt>Kurzbeschreibung</dt><dd>{{ $gewaehlt['summary'] }}</dd>@endif
|
|
@if (filled($gewaehlt['medium_description'] ?? null))<dt>Beschreibung</dt><dd>{{ \Illuminate\Support\Str::limit($gewaehlt['medium_description'], 400) }}</dd>@endif
|
|
@if (filled($gewaehlt['usage_note'] ?? null))<dt>Hinweise für den Einsatz</dt><dd>{{ $gewaehlt['usage_note'] }}</dd>@endif
|
|
@if (filled($gewaehlt['license_note'] ?? null))<dt>Interner Lizenzvermerk</dt><dd>{{ $gewaehlt['license_note'] }}</dd>@endif
|
|
</dl>
|
|
@if ($istText)
|
|
<div class="vw-karte-box">
|
|
<h3>Wortlaut des Textes</h3>
|
|
<label class="vw-feldlabel">Titel
|
|
<input class="vw-eingabe" type="text" wire:model="partTitle">
|
|
</label>
|
|
<label class="vw-feldlabel">Inhalt
|
|
<textarea class="vw-eingabe" rows="8" wire:model="partBody"></textarea>
|
|
</label>
|
|
<p class="vw-feld-hilfe">
|
|
@if (! empty($gewaehlt['committed']))
|
|
Diese Fassung ist freigegeben und wird verwendet. Speichern legt eine neue Fassung an; die bisherige bleibt in den freigegebenen Aufbauten.
|
|
@else
|
|
Dieser Text ist noch nicht freigegeben und verwendet. Speichern schreibt dieselbe Fassung fort.
|
|
@endif
|
|
</p>
|
|
<div><button type="button" class="vw-btn" wire:click="saveSourceText">Text an der Quelle speichern</button></div>
|
|
</div>
|
|
@endif
|
|
@if ($istKomposition($gewaehlt))
|
|
@php $kinder = $this->childrenRows((string) $gewaehlt['target']); @endphp
|
|
<div class="vw-quelleninhalt">
|
|
<p><strong>Inhalt der Quelle</strong> · {{ count($kinder) }} {{ count($kinder) === 1 ? 'Bestandteil' : 'Bestandteile' }}</p>
|
|
@foreach ($kinder as $kind)
|
|
<div class="vw-quellenzeile">
|
|
<span class="vw-bild is-mini">@if (! empty($kind['image']))<img src="{{ $kind['image'] }}" alt="">@else<span class="vw-bild-ersatz">@include('filament.verwaltung.icon', ['name' => $symbol($kind['tone'])])</span>@endif</span>
|
|
<span><strong>{{ $kind['title'] }}</strong><br><span class="vw-feld-hilfe">{{ $kind['kind'] }}@if ($kind['role'] !== '') · {{ $kind['role'] }}@endif</span></span>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
@if ($editUrl)
|
|
<p><a class="vw-link" href="{{ $editUrl }}">@include('filament.verwaltung.icon', ['name' => 'extern'])Quelle bearbeiten</a>
|
|
@if ($aufbauOffen)<span class="vw-feld-hilfe"> Der Aufbau hat ungespeicherte Änderungen; vorher „Entwurf speichern“.</span>@endif</p>
|
|
@endif
|
|
</div>
|
|
@elseif ($this->detailTab === 'vorschau')
|
|
<div class="vw-detail-inhalt">
|
|
@if (! empty($gewaehlt['open_url']))
|
|
<p class="vw-feld-hilfe">Zeigt {{ $gewaehlt['version_label'] }} so, wie Trainer den Inhalt sehen. Die Ansicht ist schreibgeschützt.</p>
|
|
<iframe class="vw-inhaltsvorschau" src="{{ $gewaehlt['open_url'] }}" title="Inhaltsvorschau: {{ $gewaehlt['title'] }}" loading="lazy"></iframe>
|
|
<a class="vw-link" href="{{ $gewaehlt['open_url'] }}" target="_blank" rel="noopener">@include('filament.verwaltung.icon', ['name' => 'extern'])In neuem Tab öffnen</a>
|
|
@else
|
|
<div class="vw-leer"><p>Für diesen Bestandteil gibt es keine Inhaltsvorschau.</p></div>
|
|
@endif
|
|
</div>
|
|
@else
|
|
<div class="vw-detail-inhalt">
|
|
<p class="vw-band">@include('filament.verwaltung.icon', ['name' => 'info'])<span>Gilt nur hier. Die Quelle bleibt unverändert.</span></p>
|
|
<label class="vw-feldlabel">Rolle {{ $ort }}
|
|
<input class="vw-eingabe" type="text" wire:model.live.blur="roleDraft" placeholder="z. B. Einstieg, Film, Unterlage">
|
|
</label>
|
|
<label class="vw-feldlabel">Hinweis an dieser Stelle
|
|
<textarea class="vw-eingabe" rows="4" wire:model.live.blur="noteDraft" placeholder="Was Trainer an dieser Stelle beachten sollen"></textarea>
|
|
</label>
|
|
@if (count($alternativen) > 1)
|
|
<fieldset class="vw-chipgruppe">
|
|
<legend>Verwendete Fassung</legend>
|
|
<div class="vw-chips">
|
|
@foreach ($alternativen as $alternative)
|
|
<label>
|
|
<input type="radio" name="fassung-an-dieser-stelle" @checked($gewaehlt['target'] === $alternative['target']) wire:click="useVersion({{ $auswahl }}, '{{ $alternative['target'] }}')">
|
|
<span>{{ $alternative['label'] }}</span>
|
|
</label>
|
|
@endforeach
|
|
</div>
|
|
<span class="vw-feld-hilfe">Gilt nur in diesem Aufbau. Eine neuere Fassung wird nicht automatisch übernommen.</span>
|
|
</fieldset>
|
|
@endif
|
|
<p class="vw-feld-hilfe" style="border-top: 1px solid var(--vw-line); padding-top: 0.75rem;">Änderungen werden mit dem Aufbau gespeichert („Entwurf speichern“).</p>
|
|
<p>Quelle: <strong>{{ $gewaehlt['title'] }}</strong> · {{ $gewaehlt['version_label'] }}
|
|
<button type="button" class="vw-link" wire:click="$set('detailTab', 'quelle')">Quelle ansehen</button></p>
|
|
</div>
|
|
@endif
|
|
@endif
|
|
</section>
|
|
</div>
|