@extends('site.layouts.new.app') @php $summaryText = $documentSummary ?: 'Nenhuma ementa informada para este documento.'; $summaryCardPreview = \Illuminate\Support\Str::limit($summaryText, 900, '...'); $summaryCardIsLong = \Illuminate\Support\Str::length($summaryText) > 900; $hasAttachments = $attachments->isNotEmpty(); $hasProcessing = $processingItems->isNotEmpty(); $hasMeetings = $meetingItems->isNotEmpty(); $primaryGridClass = $hasAttachments ? 'sl-document-details__grid' : 'sl-document-details__grid is-single'; $secondaryGridClass = match (true) { $hasProcessing && $hasMeetings => 'sl-document-details__grid is-secondary', $hasProcessing || $hasMeetings => 'sl-document-details__grid is-secondary is-single', default => null, }; @endphp @section('site_content')
@include('site.components.materials-tab', [ 'label' => 'Voltar para matérias', 'href' => $backUrl, 'active' => false, ]) @include('site.components.materials-tab', [ 'label' => 'Detalhes do documento', 'href' => request()->fullUrl(), 'active' => true, ])

{{ $documentTitle }}

{{ $documentHeadline }}

{{ $document->date ?? '-' }} @if ($authorNames->isNotEmpty()) {{ $authorNames->implode(', ') }} @endif

@if ($hasLongSummary)
{{ $documentSummaryPreview }} Mostrar menos
{!! nl2br(e($summaryText)) !!}
@else
{!! nl2br(e($summaryText)) !!}
@endif
Protocolo: {{ $protocolLabel }} @if ($approvalLabel) {{ $approvalLabel }} @endif
Abrir documento
Tipo {{ $documentTitle }}
Número {{ $documentNumber }}
Última movimentação {{ $updatedLabel }}
Responsável {{ $primaryAuthor }}
@component('site.components.panel', ['title' => 'Resumo do documento', 'className' => 'sl-document-card'])
Ementa @if ($summaryCardIsLong)
{{ $summaryCardPreview }} Ver menos
{!! nl2br(e($summaryText)) !!}
@else

{!! nl2br(e($summaryText)) !!}

@endif
Destinatário final @if ($destinationNames->isNotEmpty())
@foreach ($destinationNames as $destinationName) {{ $destinationName }} @endforeach
@else

Nenhum destinatário final informado.

@endif
Caixas vinculadas @if ($document->boxes->isNotEmpty())
@foreach ($document->boxes as $box) {{ $box->description ?? ('Caixa #' . $box->id) }} @endforeach
@else

Documento sem caixa vinculada.

@endif
@endcomponent @if ($hasAttachments) @component('site.components.panel', ['title' => 'Arquivos e anexos', 'className' => 'sl-document-card'])
@foreach ($attachments as $attachment) @endforeach
@endcomponent @endif
@if ($secondaryGridClass)
@if ($hasProcessing) @component('site.components.panel', ['title' => 'Tramitação', 'className' => 'sl-document-card'])
@foreach ($processingItems as $processingItem)
{{ $processingItem['status'] }} {{ $processingItem['date'] ?: '-' }}
@if (!empty($processingItem['destination_path']))

{{ $processingItem['destination_path']->implode(' -> ') }}

@endif @if ($processingItem['description']) {{ $processingItem['description'] }} @endif @if ($processingItem['observation'])
@if ($processingItem['observation_is_long'])
{{ $processingItem['observation_preview'] }} Ver menos
{!! nl2br(e($processingItem['observation'])) !!}
@else {!! nl2br(e($processingItem['observation'])) !!} @endif
@endif
@endforeach
@endcomponent @endif @if ($hasMeetings) @component('site.components.panel', ['title' => 'Sessões relacionadas', 'className' => 'sl-document-card'])
@foreach ($meetingItems as $meetingItem)
{{ $meetingItem['title'] }} @if ($meetingItem['subtitle_is_long'])
{{ $meetingItem['subtitle_preview'] }} Ver menos
{!! nl2br(e($meetingItem['subtitle'])) !!}
@else

{{ $meetingItem['subtitle'] }}

@endif {{ $meetingItem['date'] }}
{{ $meetingItem['action_label'] }} @if (!empty($meetingItem['secondary_action_href']) && !empty($meetingItem['secondary_action_label'])) {{ $meetingItem['secondary_action_label'] }} @endif
@endforeach
@endcomponent @endif
@endif
@endsection