@extends('layouts.app') @section('title', __('Review')) @section('content') @php $employee = $review->employee; $backUrl = $role === null ? route('admin.reviews.index') : route('reviews.index'); $done = collect($sections)->firstWhere('mode', 'edit'); $answered = $done['answered'] ?? 0; $questionCount = $done['total'] ?? 0; $complete = $questionCount > 0 && $answered === $questionCount; $nextLabel = match ($role?->value) { 'team_lead' => __('Submit to department head'), 'department_head' => __('Submit to HR'), default => __('Complete review'), }; @endphp
{{ __('Back to reviews') }}

{{ __('Appraisal') }} {{ $review->cycle->year }}

@if ($role !== null)
@if ($previous){{ __('Previous') }}@endif @if ($next){{ __('Next') }}@endif
@endif
@if ($queue->isNotEmpty()) @endif
{{ $employee->name }}
{{ $employee->employee_code }} · {{ $employee->job_title }}@if ($employee->department) · {{ $employee->department->name }}@endif
@if ($role === null)
{{ __('Read-only admin view') }}
{{ __('To act on this review, use “View as” in the top bar.') }}
@endif
@foreach ($steps as $i => $step)
@if ($step['submittedAt'])@else{{ $i + 1 }}@endif
{{ $step['role']->label() }} {{ $step['person']->name }} · @if ($step['submittedAt']) {{ __('Submitted') }} {{ $step['submittedAt']->translatedFormat('j M Y') }} @elseif ($step['current']) {{ __('In progress') }} @else {{ __('Waiting') }} @endif
@endforeach
@if ($errors->has('review')) @endif @if ($waiting)
{{ __('This review is not ready for you yet') }} {{ __('It is currently with :role (:name). You will get an email as soon as it is submitted to you.', ['role' => $review->stage->role()->label(), 'name' => $owner->name]) }}
{{ __('Back to reviews') }}
@else @if ($editable)
{{ __('Rate every question in your section.') }}
{{ __('All questions are required before you can submit. You can save your progress at any time and finish later.') }}
@csrf @foreach ($sections as $s) @include('reviews._section', ['s' => $s]) @endforeach
{{ $answered }} / {{ $questionCount }} {{ __('rated') }}{{ $questionCount ? round($answered / $questionCount * 100) : 0 }}%
@if ($review->last_saved_at){{ __('Draft saved') }} {{ $review->last_saved_at->translatedFormat('j M Y, H:i') }} @else{{ __('Draft, nothing saved yet') }}@endif

{{ $role->value === 'hr' ? __('Complete this review?') : __('Submit this review?') }}

{{ __('You are submitting the appraisal of') }} {{ $employee->name }}.

{{ __('After you submit, your section is locked and cannot be changed. An email will be sent to the next person.') }}
@else @if ($role !== null && ! $review->isCompleted() && $review->stage->position() > $role->stage()->position())
{{ __('You have submitted this review') }}
{{ __('Your section is locked and can no longer be edited.') }}
@endif @foreach ($sections as $s) @include('reviews._section', ['s' => $s]) @endforeach @endif @if ($review->isCompleted())

{{ __('Final result') }}

{{ $band['label'] }}
{{ __('Overall score') }}
{{ (float) $total }} / 100
@foreach ($sections as $s)
{{ $s['role']->label() }}{{ (float) $s['score'] }}
@endforeach
@endif @endif
@endsection