@if ($task->justificaciones && $task->justificaciones->count() > 0)
@foreach ($task->justificaciones as $justificacion)

{{ $justificacion->motivo }}

@if ($justificacion->estado === 'sin_revisar') Pendiente @else Revisada @endif
{{ ($justificacion->usuario->name ?? '') . ' ' . ($justificacion->usuario->last_name ?? '') ?: 'Usuario' }} · {{ \Carbon\Carbon::parse($justificacion->fecha_justificacion)->format('d/m/Y H:i') }} · {{ \Carbon\Carbon::parse($justificacion->fecha_justificacion)->diffForHumans() }}
@if ($justificacion->estado === 'sin_revisar')
@csrf
@endif
@if ($justificacion->evidencia)
Evidencia Adjunta
@php $filePath = $justificacion->evidencia; if (str_contains($filePath, 'http')) { $filePath = parse_url($filePath, PHP_URL_PATH); $filePath = ltrim($filePath, '/'); } $extension = pathinfo($filePath, PATHINFO_EXTENSION); @endphp @if ($extension === 'pdf') @elseif(in_array($extension, ['docx', 'doc'])) @elseif(in_array($extension, ['jpg', 'jpeg', 'png', 'gif'])) @else @endif

{{ Str::limit(basename($filePath), 40) }}

Documento de justificación

@if ($justificacion->observacion_admin)
Observación del Administrador:

{{ $justificacion->observacion_admin }}

@endif
@endif
@endforeach
@else

No hay justificaciones registradas

El usuario no ha enviado justificaciones para esta tarea

@endif