@extends('layouts.app') @section('title', 'Available Posts') @section('breadcrumb') Dashboard Available posts @endsection @push('styles') @endpush @section('content') @if(!$profile || !$profile->isApproved())
@if(!$profile)

Profile required

Your profile isn't complete yet. Complete your profile to apply for posts.

@elseif($profile->isPending())

Profile under review

You'll be able to apply once an admin approves your profile.

@else

Profile rejected

Please update your profile and resubmit for approval.

@endif
@endif @if(!$activePosts->isEmpty())
@endif @if($activePosts->isEmpty())
No active posts
There are no open recruitment posts at the moment. Please check back later.
@else
@foreach($activePosts as $post) @php $appStatus = $applicationStatusByPost[$post->id] ?? null; $isRejected = $appStatus === 'rejected'; $isLocked = $appStatus !== null && !$isRejected; $statusPill = match (true) { $appStatus === 'approved' => ['s-success', 'Approved'], $appStatus === 'pending' => ['s-warning', 'Pending'], $isRejected => ['s-danger', 'Rejected'], default => ['s-info', 'Active'], }; @endphp
{{-- ─── HERO header (Style 3 only) ─────────────────────────── --}}
{{ $statusPill[1] }}
{{ $post->code }}

{{ $post->title }}

{{ $post->bps }} BPS
{{-- ─── CLASSIC head (default + Badge style) ───────────── --}}
{{ $post->code }}

{{ $post->title }}

@if($appStatus === 'approved') @endif {{ $statusPill[1] }}
{{-- ─── BADGE row (Style 2 only) ───────────────────────── --}}
BPS-{{ str_replace('BPS-','',$post->bps) }} {{ number_format($post->total_seats) }} seats {{ $post->min_age }}–{{ $post->max_age }} yrs {{ $post->gender_label }}
{{-- ─── CLASSIC + HERO spec grid ───────────────────────── --}}
Pay scale
{{ $post->bps }}
Seats
{{ number_format($post->total_seats) }}
Age limit
{{ $post->min_age }}–{{ $post->max_age }} yrs
Gender
{{ $post->gender_label }}
Qualification

{{ Str::limit($post->qualification, 130) }}

@if($post->quotas->isNotEmpty())
Quota
@foreach($post->quotas as $quota) {{ $quota->quota_type_label }} · {{ $quota->seats }} @endforeach
@endif
@if($isLocked) @elseif(!$profile || !$profile->isApproved()) @else @endif
{{-- ─── Per-post review modal ──────────────────────────────────── --}} @if(!$isLocked && $profile && $profile->isApproved()) @endif @endforeach
@endif @endsection @push('scripts') @endpush