@php /** @var \V2\Modules\Publicacoes\Noticias\Models\News $news */ /** @var string $htmlContent */ /** @var bool $previewMode */ $authorName = $news->author ? ($news->author->name ?? $news->author->email ?? '') : ($news->responsible_name ?? ''); $monthsPt = ['JAN', 'FEV', 'MAR', 'ABR', 'MAI', 'JUN', 'JUL', 'AGO', 'SET', 'OUT', 'NOV', 'DEZ']; @endphp Preview — {{ $news->title }} @include('v2-service-contentricheditor::components.partials.viewer-styles') @if($previewMode)
Modo Preview. Esta notícia não está publicada.
@endif {{-- Capa --}} @if($news->cover_image_id && $news->coverImage)
{{ $news->getCoverImageAlt() }}
@endif {{-- Metadados --}}
@if($news->published_at) {{ $news->published_at->format('d/m/Y H:i') }} @elseif($news->created_at) {{ $news->created_at->format('d/m/Y H:i') }} @endif @if($authorName) {{ $authorName }} @endif @if($news->category) {{ $news->category->name }} @endif @if($news->content_date) Conteúdo: {{ $news->content_date instanceof \Carbon\Carbon ? $news->content_date->format('d/m/Y') : $news->content_date }} @endif
{{-- Corpo --}}
@if(!empty($htmlContent))
{!! $htmlContent !!}
@elseif($news->summary)

{{ $news->summary }}

@elseif($news->subtitle)

{{ $news->subtitle }}

@else

Nenhum conteúdo disponível.

@endif
{{-- Fonte --}} @if($news->source)
Fonte: {{ $news->source }}
@endif {{-- Tags --}} @if($news->relationLoaded('tags') && $news->tags->count() > 0)
@foreach($news->tags as $tag) {{ $tag->name }} @endforeach
@endif {{-- Galeria --}} @if($news->relationLoaded('gallery') && $news->gallery->count() > 0) @php $isFilename = function($text) { return !empty($text) && (bool) preg_match('/\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?|pdf)$/i', $text); }; $galleryIframeItems = $news->gallery->map(function($m) use ($isFilename) { $alt = $m->alt_text; if (empty($alt) || $isFilename($alt)) { $alt = 'Imagem da galeria'; } return [ 'src' => v2_storage_url($m->file_path), 'alt' => $alt, ]; })->values()->toArray(); @endphp {{-- Lightbox overlay simples (sem dependência de Bootstrap) --}} @endif