@php
$monthsPt = ['JAN', 'FEV', 'MAR', 'ABR', 'MAI', 'JUN', 'JUL', 'AGO', 'SET', 'OUT', 'NOV', 'DEZ'];
$nacionalSlug = 'nacional';
$regionaisSlug = 'regionais';
@endphp
@extends('v2-portal::app-layout', [
'pageTitle' => 'Notícias — ' . config('app.name'),
'pageDescription' => 'Acompanhe as últimas notícias e comunicados oficiais.',
'gtag' => ['page_context' => 'noticias'],
'schemas' => [
[
'@context' => 'https://schema.org',
'@type' => 'CollectionPage',
'name' => 'Notícias',
'description' => 'Acompanhe as últimas notícias e comunicados oficiais.',
'url' => route('v2.noticias.portal.index', [], false)
]
],
'fullWidthMain' => true,
'showHeader' => false,
'showMainHeader' => false,
'showMainFooter' => false,
'showFooter' => false,
'showAccessibilityBar' => false,
'showMainLeftArea' => false,
'showMainRightArea' => false,
])
@section('main-section-area')
{{-- HERO BREADCRUMB --}}
{{-- BUSCA + FILTROS (sempre visíveis, operam client-side) --}}
{{-- RESULTADOS (indexados client-side) --}}
Últimas notícias
@forelse($allNews as $item)
@php
$date = $item->published_at ?? $item->created_at;
$day = $date->format('d');
$mon = $monthsPt[$date->format('n') - 1];
$coverUrl = $item->getCoverImageUrl();
$catSlug = $item->category ? $item->category->slug : '';
$catParent = ($item->category && $item->category->parent) ? $item->category->parent->slug : $catSlug;
$regSlug = '';
$regAcronym = '';
if (isset($item->unidadeRegional) && $item->unidadeRegional && strtolower($item->unidadeRegional->acronym) !== 'nac') {
$regSlug = $item->unidadeRegional->slug;
$regAcronym = $item->unidadeRegional->acronym;
}
$searchText = mb_strtolower(trim(
($item->title ?? '') . ' ' .
($item->subtitle ?? '') . ' ' .
($item->summary ?? '') . ' ' .
($catParent ?? '') . ' ' .
($catSlug ?? '') . ' ' .
($regAcronym ?? '')
));
@endphp
@if($coverUrl)
@include('v2-service-media::components.picture', [
'originalPath' => $item->coverImage->file_path,
'variants' => $item->getCoverImageVariants(),
'alt' => $item->getCoverImageAlt(),
'class' => 'img-fluid',
'lazy' => true,
])
@else
 }})
@endif
@php
$ur = $item->unidadeRegional ?? null;
$isNacional = !$ur || strtolower($ur->acronym) === 'nac';
@endphp
@if($isNacional)
Nacional
@else
{{ $ur->name }}
@endif
{{ $day }}{{ $mon }}
{{ str_limit(strip_tags($item->summary ?? $item->subtitle ?? ''), 150) }}
Leia Mais
@empty
Nenhuma notícia publicada
@endforelse
Nenhuma notícia encontrada
Tente ajustar os filtros ou a busca.
@endsection
@push('head-styles')
@endpush
@push('scripts')
@endpush