@extends('layouts.app') @section('title', __('Country-wise Workflow Settings')) @push('styles') @endpush @section('content')

{{ __('Country-wise Workflow Settings') }}

{{ __('Choose the workflow steps for each country') }}
{{ __('The tables below are the default workflows. Use Configure on a country to skip steps for that country (for example Police Clearance, then Visa, without Training). Countries without changes follow the full default workflow.') }}

{{ __('Default workflow stages') }}

@foreach ($workflows as $workflow)
@foreach ($workflow['stages'] as $index => $stage) @endforeach
{{ __('Order') }} {{ __('Stage') }} {{ __('Available statuses') }}
{{ $index + 1 }} {{ __(\Illuminate\Support\Str::headline($stage)) }} {{ collect($stageStatuses[$stage] ?? [])->map(fn($status) => __(\Illuminate\Support\Str::headline($status)))->join(', ') }}
@endforeach

{{ __('Countries using these workflows') }}

{{ __('Search') }}
{{ __('Clear') }}
@forelse($countries as $country) @empty @endforelse
{{ __('Country') }} {{ __('Code') }} {{ __('Status') }} {{ __('Overseas') }} {{ __('Student') }} {{ __('Hajj & Umrah') }} {{ __('Total') }} {{ __('Workflow') }}
{{ $country->name }} {{ $country->code ?: '—' }} {{ $country->overseas_count }} {{ $country->student_count }} {{ $country->hajj_umrah_count }} {{ $country->recruitments_count }} @php($skipped = $disabledByCountry[$country->id] ?? collect()) @if ($skipped->isEmpty()) {{ __('Default (all steps)') }} @else {{ __('Custom') }}
{{ __('Skipped') }}: {{ $skipped->pluck('stage')->unique()->map(fn($st) => __(\Illuminate\Support\Str::headline($st)))->join(', ') }}
@endif
{{ __('Configure') }}
{{ __('No countries found.') }}
{{ __('Showing :from–:to of :total results', ['from' => $countries->firstItem() ?? 0, 'to' => $countries->lastItem() ?? 0, 'total' => $countries->total()]) }}
{{ $countries->appends(request()->query())->links('pagination::bootstrap-5') }}
@endsection