@extends('partials.app') @section('content')

Training Checklist: {{ $user->name }}

@if (session('error')) @endif {{-- Steps stay locked until the trainee has cleared the assessment: enrol -> attendance -> read documents -> attempt exam -> pass. --}} @unless($eligibility['can_log_steps'])
Steps are locked

{{ $eligibility['reason'] }}

    @foreach($eligibilityChecklist as $check)
  • @if($check['done']) @else @endif {{ $check['label'] }}
  • @endforeach
@endunless
{{ $program->name }}
{{ $program->steps->count() }} Steps
@foreach($program->steps as $step)
Step {{ $step->step_number }}: {{ $step->name }}
@if(in_array($step->id, $completedIds)) Completed @elseif(! $eligibility['can_log_steps']) @else {{-- Using both BS4 and BS5 data attributes for safety --}} @endif
@endforeach
{{-- MODALS LOOP: Keep this at the bottom, just before @endsection --}} @foreach($eligibility['can_log_steps'] ? $program->steps : collect() as $step) @endforeach @endsection