@extends('admin.layouts.app') @section('title', 'Publicaciones') @section('styles') @endsection @section('content') {{-- ═══════ HERO ═══════ --}}

Publicaciones

Gestiona noticias, comunicados, convocatorias y logros

{{ $noticias->count() }}
TOTAL
{{ $noticias->where('activo',true)->count() }}
ACTIVOS
{{ $noticias->where('destacado',true)->count() }}
DESTACADOS
Nueva Publicación
{{-- ═══════ STATS ═══════ --}} @php $porTipo = [ 'noticia' => ['Noticias', '#1d4ed8', 'bi-newspaper'], 'comunicado' => ['Comunicados', '#7e22ce', 'bi-megaphone-fill'], 'convocatoria' => ['Convocatorias', '#c2410c', 'bi-file-earmark-text-fill'], 'logro' => ['Logros', '#15803d', 'bi-trophy-fill'], ]; @endphp
@foreach($porTipo as $tipo => [$label, $color, $icon])
{{ $noticias->where('tipo',$tipo)->count() }}
{{ strtoupper($label) }}
@endforeach
{{ $noticias->where('mostrar_popup',true)->count() }}
EN POPUP
{{-- ═══════ TOOLBAR ═══════ --}}
{{ $noticias->count() }} publicación(es)
{{-- ═══════ TABLE ═══════ --}}
Todas las Publicaciones {{ $noticias->count() }} registros
@forelse($noticias as $noticia) @empty @endforelse
# Imagen Título Tipo Fecha Destacado Estado Popup Botones Acciones
{{ $noticia->id }}
@if($noticia->imagen) @else @endif
{{ $noticia->titulo }}
@if($noticia->resumen)
{{ $noticia->resumen }}
@endif
@php $tipoClass = match($noticia->tipo) { 'noticia' => 'tipo-noticia', 'comunicado' => 'tipo-comunicado', 'convocatoria' => 'tipo-convocatoria', 'logro' => 'tipo-logro', default => 'tipo-noticia', }; $tipoIcon = match($noticia->tipo) { 'noticia' => 'bi-newspaper', 'comunicado' => 'bi-megaphone-fill', 'convocatoria' => 'bi-file-earmark-text-fill', 'logro' => 'bi-trophy-fill', default => 'bi-circle', }; @endphp {{ $noticia->tipo_label }}
{{ $noticia->fecha_publicacion->format('d/m/Y') }}
@if($noticia->destacado) @else @endif {{ $noticia->activo ? 'Activo' : 'Inactivo' }} @if($noticia->mostrar_popup) ON @else @endif @if($noticia->botones && count($noticia->botones) > 0)
@foreach($noticia->botones as $btn) {{ Str::limit($btn['texto'] ?? 'Ver', 12) }} @endforeach
@else @endif
@csrf @method('DELETE')

Sin publicaciones aún

Crea la primera noticia, comunicado o convocatoria.

Crear primera publicación
@endsection @section('scripts') @endsection