33 lines
1.5 KiB
PHP
33 lines
1.5 KiB
PHP
@php
|
|
$metadata = is_array($version->metadata) ? $version->metadata : [];
|
|
$class = $version->element->output_class;
|
|
$poster = \App\Domain\Media\ThumbnailRef::url('editorial.card', 'element', $version->element->id, $version->element->thumbnail_path);
|
|
$playback = $class === 'film' ? app(\App\Http\Controllers\ContentPreviewController::class)->playback($version) : null;
|
|
@endphp
|
|
|
|
@if ($class === 'film' && $playback)
|
|
@include('content.video', ['playback' => $playback, 'poster' => $poster, 'style' => 'width: 100%; max-height: 70vh; background: #111;'])
|
|
@if ($fileUrl)
|
|
<p><a href="{{ $fileUrl }}">Datei öffnen</a></p>
|
|
@endif
|
|
@elseif ($fileUrl)
|
|
@if ($class === 'audio')
|
|
<audio controls preload="metadata" src="{{ $fileUrl }}" style="width: 100%;"></audio>
|
|
@elseif ($class === 'bild')
|
|
<img src="{{ $fileUrl }}" alt="{{ $version->element->working_title }}" style="max-width: 100%; height: auto;">
|
|
@else
|
|
<iframe src="{{ $fileUrl }}" title="Fassung {{ $version->number }}" style="width: 100%; height: 70vh; border: 0;"></iframe>
|
|
@endif
|
|
<p><a href="{{ $fileUrl }}">Datei öffnen</a></p>
|
|
@elseif ($pending)
|
|
<p>Die Datei wird noch übernommen.</p>
|
|
@elseif (is_string($metadata['file'] ?? null))
|
|
<p>Für Fassung {{ $version->number }} ist eine Datei vorgemerkt, sie liegt aber nicht vor.</p>
|
|
@endif
|
|
|
|
@if (filled($version->body))
|
|
<article class="prose">
|
|
{!! nl2br(e($version->body)) !!}
|
|
</article>
|
|
@endif
|