{{-- ============================================================ MULTIPLE APPLICATIONS Used by Student Dashboard - Recent Application Activity ============================================================= --}} @if(isset($applications) && $applications && $applications->count())
@foreach($applications as $application)
{{-- ================================================= COMPANY / JOB HEADER ================================================== --}}
{{ $application->job?->companyRec?->name ?? 'Company' }}
@if($application->job?->reqid) Job Post: {{ $application->job->reqid }} @endif
@if($application->updated_at) {{ $application->updated_at }} @endif
{{-- ================================================= STEPPER ================================================== --}}
@foreach($application->stepper as $index => $step) @php $isCompleted = $step['completed'] ?? false; $isRejected = $step['rejected'] ?? false; $isCurrent = !$isCompleted && !$isRejected && collect($application->stepper) ->take($index) ->every(fn($s) => $s['completed'] ?? false); @endphp {{-- STEP --}}
{{-- Circle --}}
{{-- Applied --}} @if($index === 0) {{-- Final --}} @elseif($step['final'] ?? false) @if(in_array($step['final_status'] ?? null, [ 'intern-offered', 'job-offered', 'ppo' ])) @elseif(($step['final_status'] ?? null) === 'not-selected') @else ● @endif {{-- Rejected --}} @elseif($isRejected) {{-- Completed --}} @elseif($isCompleted) {{-- Current --}} @elseif($isCurrent) {{-- Pending --}} @else ● @endif
{{-- Label --}} {{ $step['label'] }} {{-- Date --}} @if(!empty($step['date'])) {{ $step['date'] }} @endif {{-- Rejected --}} @if($isRejected) @if(in_array($step['slug'] ?? null, [ '1st-shortlist', '2nd-shortlist' ])) Not Shortlisted @elseif(($step['slug'] ?? null) === 'interview') Not Selected @endif @endif {{-- Final result --}} @if( ($step['final'] ?? false) && ($step['completed'] ?? false) ) {{ in_array($step['final_status'] ?? null, [ 'intern-offered', 'job-offered', 'ppo' ]) ? 'Selected' : 'Position Closed' }} @endif
{{-- Connector --}} @if(!$loop->last) @php $nextStep = $application->stepper[$index + 1] ?? null; $lineCompleted = ($isCompleted || $isRejected) && ( ($nextStep['completed'] ?? false) || ($nextStep['rejected'] ?? false) ); @endphp
@endif @endforeach
@endforeach
{{-- ============================================================ SINGLE APPLICATION Existing usage: ============================================================= --}} @elseif($application)
@foreach($application->stepper as $index => $step) @php $isCompleted = $step['completed'] ?? false; $isRejected = $step['rejected'] ?? false; $isCurrent = !$isCompleted && !$isRejected && collect($application->stepper) ->take($index) ->every( fn($s) => $s['completed'] ?? false ); @endphp
{{-- ================================================= STEP CIRCLE ================================================== --}}
{{-- APPLIED --}} @if($index === 0) {{-- FINAL --}} @elseif($step['final'] ?? false) @if(in_array($step['final_status'] ?? null, [ 'intern-offered', 'job-offered', 'ppo' ])) @elseif(($step['final_status'] ?? null) === 'not-selected') @else ● @endif {{-- REJECTED --}} @elseif($isRejected) {{-- COMPLETED --}} @elseif($isCompleted) {{-- CURRENT --}} @elseif($isCurrent) {{-- PENDING --}} @else ● @endif
{{-- LABEL --}} {{ $step['label'] }} {{-- DATE --}} @if(!empty($step['date'])) {{ $step['date'] }} @endif {{-- REJECTED MESSAGE --}} @if($isRejected) @if(in_array($step['slug'] ?? null, [ '1st-shortlist', '2nd-shortlist' ])) Not Shortlisted @elseif(($step['slug'] ?? null) === 'interview') Not Selected @endif @endif {{-- FINAL RESULT TEXT --}} @if( ($step['final'] ?? false) && ($step['completed'] ?? false) ) {{ in_array($step['final_status'] ?? null, [ 'intern-offered', 'job-offered', 'ppo' ]) ? 'Selected' : 'Position Closed' }} @endif
{{-- CONNECTOR --}} @if(!$loop->last) @php $nextStep = $application->stepper[$index + 1] ?? null; $lineCompleted = ($isCompleted || $isRejected) && ( ($nextStep['completed'] ?? false) || ($nextStep['rejected'] ?? false) ); @endphp
@endif @endforeach
{{-- ============================================================ EMPTY ============================================================= --}} @else
{{ $emptyMessage }}
@endif