@extends('layouts.app') @section('styles') @endsection @section('content') @if(Auth::check())
{{-- Breadcrumb --}}

{{ __('site.exoneration.form_title') }}

{{ __('site.download_pdf') ?? 'تحميل PDF' }}
{{ __('site.exoneration.status.current_label') }}
@php $statutLabel = trans_field($document->statut, 'statut') ?? $document->statut?->statut_ar ?? __('site.formation.status.pending'); @endphp {{ $statutLabel }}
@php // select the document-specific comment field according to current statut $docComment = null; if ($document->id_statut == 3) { $docComment = $document->commentaire_motif; } elseif ($document->id_statut == 4) { $docComment = $document->commentaire_acceptation; } elseif ($document->id_statut == 5) { $docComment = $document->commentaire_avis; } // prefer the document's comment; otherwise fallback to the relevant history comment $currentComment = !empty($docComment) ? $docComment : ($relevantHistory->commentaire ?? null); // detect whether the displayed comment came from history (so we can show metadata) $commentFromHistory = empty($docComment) && isset($relevantHistory) && !empty($relevantHistory->commentaire); $historyAuthor = $relevantHistory->changer->name ?? $relevantHistory->changed_by ?? null; $historyAt = isset($relevantHistory->created_at) ? $relevantHistory->created_at->format('Y-m-d H:i') : null; // label class by status (adjust if you use different styling) $labelClass = ''; if ($document->id_statut == 3) $labelClass = 'text-danger'; if ($document->id_statut == 4) $labelClass = 'text-warning'; if ($document->id_statut == 5) $labelClass = 'text-primary'; @endphp @if(!empty($currentComment))

{{ $currentComment }}

@endif

{{ __('site.exoneration.identity.title') }}

{{ __('site.exoneration.documents.title') }}

@php $files = [ 'copie_cahier_des_charges','copie_originale','facture','contrat', 'fichier_arrivage','fichier_colisage','copie_registre_fiscal', 'copie_registre_national_institutions','copie_certificat_propriete', 'engagement','exemple_projet' ]; @endphp @foreach($files as $file)
{{-- Label --}}
{{ __('site.exoneration_label.documents.labels.' . $file) }}
{{-- Affichage fichier --}} @if(!empty($document->$file) && file_exists($document->$file)) {{ __('site.exoneration.actions.view_current_file') }} @else {{ __('site.exoneration_label.actions.none') }} @endif
@endforeach
@else @endif @endsection @section('scripts') @endsection