@extends('layouts.dashboard') @php $user = Auth::user(); $isAdmin = $isNotAdmin; $typeOfEvaluation = ($isPanelChair || $isAdvisory) ? $panel_evaluation : $individual_evaluation; $templateFile = ($isPanelChair || $isAdvisory) && isset($callPanelEvaluationFiles)? $callPanelEvaluationFiles['panel_evaluation_template_file'] : $evaluation_files['evaluation_template_file']; $instructionsFile = ($isPanelChair || $isAdvisory) && isset($callPanelEvaluationFiles)? $callPanelEvaluationFiles['panel_evaluation_guidelines_file'] : $evaluation_files['evaluation_guidelines_file']; $isFinalized = !empty($typeOfEvaluation->is_finalized); $panelChairBlocked = ($isPanelChair || $isAdvisory) && !$panelChairCanEvaluate; $isLocked = $isFinalized || $panelChairBlocked; $uploadedFile = $typeOfEvaluation?->submission_files; $hasExistingFile = $uploadedFile && !empty($uploadedFile->originalFilename); $metrics = $proposal->call->evaluationMetrics->map(function ($metric) { return [ 'name' => \Str::slug($metric->name_en, '_'), // machine key for form + scores_json 'label' => $metric->view_name_el ?? $metric->name_el, // display (or use name_en) 'min' => $metric->min_value, 'max' => $metric->max_value, 'threshold' => $metric->pass_threshold ?: null, // 0 -> null ]; })->all(); $formAction = ($isPanelChair || $isAdvisory) ? route('panel.proposal.evaluate', ['call' => $proposal->call, 'panel' => $proposal->panel, 'proposal' => $proposal]) : route('proposal.evaluate', ['call' => $proposal->call, 'proposal' => $proposal]); @endphp @section('nav-top-left') @foreach($user->getActiveRolesForCall($proposal->call) as $role)
{{$role->view_name}}
@endforeach
Proposal by {{ $proposal->applicant->firstname .' '. $proposal->applicant->lastname }}
Review Proposal Data
@endsection @section('nav-bottom-left') @endsection @section('content') @include('proposal.proposal-parts.proposal-subviews.nav_tabs')
@if ($errors->any())
@endif @if($isFinalized)
This evaluation has been finalized and can no longer be edited.
@elseif($panelChairBlocked)
This proposal cannot be evaluated yet, as both individual evaluators must finalize their evaluations first.
@endif {{-- Instructions & template download --}}

Evaluation Resources

Evaluation Instructions

@if ($instructionsFile) Download Instructions @else Download Instructions @endif

Individual Evaluation Template

@if ($instructionsFile) Download template @else Download template @endif
{{-- Scores form --}}
@csrf @if($typeOfEvaluation && !empty($typeOfEvaluation->hash_id)) @endif
{{-- Scores --}}

Set Evaluation Score

@foreach($metrics as $metric) @php $score = data_get($typeOfEvaluation, "scores_json.{$metric['name']}"); @endphp
{{ $score ?? $metric['min'] }}
@endforeach

Total Evaluation Score: / 100

{{-- Buttons --}}
{{-- Submitted only when Finalize is confirmed in the modal (enabled via JS) --}}
@if (!$isFinalized) @php $isDisabled = !$hasExistingFile || $isLocked; @endphp FINALIZE @endif
{{-- Finalize confirmation modal --}}
{{-- File upload --}}
@if ($isAdmin)

Upload {{($isPanelChair || $isAdvisory) ? 'Panel' : 'Individual'}} Evaluation File

@endif @if($uploadedFile && !empty($uploadedFile->originalFilename)) @endif @if ($isAdmin && !$isFinalized)
@endif
@endsection @section('javascripts') @endsection