@extends('admin.layouts.app') @section('title', get_setting('site_name').' | '.__('Edit instance #').$instance->id) @section('content')
{{ __('Edit appraisal instance') }} #{{ $instance->id }}

{{ __('Status') }}: {{ $instance->status }} · {{ __('Stage') }}: {{ $instance->current_stage }}

{{ __('View') }}
@if($hasSubmittedWork)
{{ __('Some stages are already submitted. Cycle, form, and period key are locked. Evaluators for submitted stages cannot be changed.') }}
@endif
@csrf @method('PUT')
@if($hasSubmittedWork) @endif
@if($hasSubmittedWork) @endif
@if($hasSubmittedWork) @else @endif

{{ __('Workflow — stage & evaluator assignment') }}

{{ __('Change evaluators only for stages not yet submitted.') }}

@if(! $hasSubmittedWork) @endif
@foreach($workflowStages as $step) @php $sub = $submissionsByStage->get($step['stage']); $isLocked = $sub && $sub->submitted_at; $selectedEvaluator = $evaluatorsOld[$step['stage']] ?? $sub?->evaluator_staff_id; @endphp
@if($step['is_self']) {{ __('Appraisee') }} @elseif($isLocked) {{ __('Submitted') }} {{ $sub->submitted_at->format('d/m/Y') }} @endif
@if($step['is_self'])

{{ $instance->staff?->selectOptionLabel() ?? '—' }}

@elseif($isLocked)

{{ $sub->evaluator?->selectOptionLabel() ?? '—' }}

@else @error('evaluators.'.$step['stage'])
{{ $message }}
@enderror @endif
@endforeach {{ __('Cancel') }}
@endsection @section('script') @endsection