@extends('layouts.app') @section('title', $recruitment->title) @section('page-title','Recruitment') @section('content') {{-- Pipeline bar --}} @php $allApps = $applications->getCollection(); $pipeline = ['applied'=>['Applied','#64748b'],'screening'=>['Screening','#6366f1'],'shortlisted'=>['Shortlisted','#059669'],'interview'=>['Interview','#f59e0b'],'recommended'=>['Recommended','#0284c7'],'offered'=>['Offered','#0E2A47'],'hired'=>['Hired','#065f46'],'rejected'=>['Rejected','#dc2626']]; @endphp
Pipeline
@foreach($pipeline as $key => [$label,$color]) @php $cnt = $allApps->where('stage',$key)->count(); @endphp @if($cnt)
{{$cnt}} {{$label}}
@endif @endforeach
{{ $applications->total() }} total
{{-- Left sidebar --}}
Posting Details
Reference
{{ $recruitment->reference }}
Department
{{ $recruitment->department?->name ?? '—' }}
Type
{{ ucfirst(str_replace('_',' ',$recruitment->employment_type)) }}
Positions
{{ $recruitment->positions_available }}
Deadline
{{ $recruitment->application_deadline?->format('M d, Y') ?? '—' }}
@if($recruitment->salary_min || $recruitment->salary_max)
Salary
${{ number_format($recruitment->salary_min,0) }} – ${{ number_format($recruitment->salary_max,0) }}
@endif
Status
{{ ucfirst($recruitment->status) }}
Rec. Threshold
{{ $recruitment->recommendation_threshold }}%
Grading Criteria
@forelse($recruitment->criteria as $crit)
{{ $crit->name }}
{{ $crit->category_label }} · Max {{ $crit->max_score }} · Wt {{ $crit->weight }}
@empty
No criteria defined.
@endforelse
How the Pipeline Works
@foreach([ ['1','Score applicants','primary'], ['2','Shortlist after interview — notifies applicant','success'], ['3','Record final outcome — offer or decline','warning'], ['4','Hire the successful candidate','dark'], ] as [$n,$desc,$col])
{{$n}} {{$desc}}
@endforeach
{{-- Main content --}}
{{-- Shortlisted panel (always shown prominently when there are shortlisted applicants) --}} @php $shortlistedApps = $allApps->where('stage','shortlisted'); @endphp @if($shortlistedApps->count())
Shortlisted for Final Interview {{ $shortlistedApps->count() }} All notified by email
@foreach($shortlistedApps as $app)
{{ $app->applicant->full_name }}
{{ $app->applicant->applicant_number }} @if($app->weighted_score !== null) · Score: {{ round($app->weighted_score) }}% @endif
@if($app->interview_date)
{{ $app->interview_date->format('l, d M Y') }} @if($app->interview_notes) · {{ Str::limit($app->interview_notes, 60) }} @endif
@else
Interview date not yet set
@endif
@if(!$app->applicant->employee_id) Hire @endif
{{-- Final Outcome Modal --}} @endforeach
@endif {{-- All applications --}}
All Applications ({{ $applications->total() }})
@forelse($applications as $app) {{-- Shortlist Modal --}} @if(!in_array($app->stage, ['hired','rejected','withdrawn','shortlisted'])) @endif @empty @endforelse
Applicant Score Stage Applied Actions
{{ $app->applicant->full_name }}
{{ $app->applicant->applicant_number }}
@if($app->auto_recommended) Recommended @endif
@if($app->weighted_score !== null) @php $sc=$app->weighted_score; $col=$sc>=$recruitment->recommendation_threshold?'#059669':($sc>=50?'#f59e0b':'#dc2626'); @endphp {{ round($sc) }}% @else@endif {{ ucfirst(str_replace('_',' ',$app->stage)) }} @if(in_array($app->stage,['shortlisted','offered','hired']))
Notified
@endif
{{ $app->application_date?->format('d M') }}
@if(!in_array($app->stage, ['hired','rejected','withdrawn','shortlisted'])) @endif @if(!in_array($app->stage, ['hired','rejected','withdrawn','shortlisted']) && $app->weighted_score !== null) @endif @if(in_array($app->stage,['recommended','offered','shortlisted']) && !$app->applicant->employee_id) @endif
No applications yet.
@if($applications->hasPages())
{{ $applications->links('pagination::bootstrap-5') }}
@endif
@endsection @push('scripts') @endpush