@extends('layouts.dashboard') @section('nav-top-left') @foreach (Auth::user()->getActiveRolesForCall($proposals[0]->call) as $role)
{{ $role->view_name }}
@endforeach
{{ $panel->name }}
Assigned proposals to panel
@endsection @section('nav-bottom-left') @endsection @section('nav-bottom-right')
@endsection @section('content') @php $rowClass = function ($p) { return match (rescue(fn () => $p->panelResult(), null)) { 'not_rejected' => 'submitted', 'rejected' => 'rejected', default => '', }; }; $rowTitle = function ($p) { return match (rescue(fn () => $p->panelResult(), null)) { 'not_rejected' => 'The Proposal is Passed', 'rejected' => 'The Proposal is Rejected', default => '', }; }; $columns = [ ['label' => 'Proposal title', 'class' => 'list-box--inner---list----project', 'value' => fn ($p) => $p->title ?? ''], ['label' => 'Applicant', 'class' => 'list-box--inner---list----person', 'value' => fn ($p) => trim(($p->applicant?->lastname ?? '') . ' ' . ($p->applicant?->firstname ?? ''))], ['label' => 'Scientific Area', 'class' => 'list-box--inner---list----scientific_area', 'value' => fn ($p) => $p->primary_domain_name_en ?? ''], ['label' => 'Organisation Info', 'class' => 'list-box--inner---list----percentage', 'value' => fn ($p) => $p->applicant?->organization_info ?? ''], ['label' => 'Evaluators', 'class' => 'list-box--inner---list----evaluators', 'style' => 'text-align:left', 'cell' => function ($p) { // evaluator id => is_finalized, only for those who submitted $finalizedMap = collect($p->individualEvaluations ?? []) ->mapWithKeys(fn ($ev) => [ ($ev->evaluator_id ?? $ev->evaluator?->id) => (bool) $ev->is_finalized, ]); return '
' . collect($p->evaluators ?? []) ->map(function ($evaluator) use ($finalizedMap) { $name = trim(($evaluator->lastname ?? '') . ' ' . ($evaluator->firstname ?? '')); $name = $name !== '' ? $name : '—'; $finalized = $finalizedMap->get($evaluator->id, false); return '
' . ' ' . e($name) . '
'; }) ->implode('') . '
'; }], ['label' => 'Total Score', 'title' => fn ($p) => collect($p->panelEvaluation?->scores_json ?? []) ->map(fn ($v, $k) => ucwords(str_replace('_', ' ', $k)) . ': ' . ($v ?? '')) ->implode("\n"), 'class' => 'list-box--inner---list----total', 'style' => 'text-align:center', 'value' => fn ($p) => $p->panelEvaluation ? (int) round($p->panelEvaluation->total_score) : null], ['label' => 'Actions', 'class' => 'list-box--inner---list----actions', 'cell' => fn ($p) => '
' . ($p->call?->hash_id && $p->hash_id ? '' : '') . ($p->panelResult() == 'rejected' ? '
' . csrf_field() . '
' : '') . ($p->panelEvaluation?->submission_files?->hash_id ? '' : '') . '
', ], ]; @endphp {{-- Trigger: replaces your old submit button --}} @if ($panel->call->singlePanelEvaluationsFinalized($panel->id))
Εvaluations have been finalized. Please notify unsuccessful applicants. @if ($lastNotified) Unsuccessful applicants last notified on {{ $lastNotified->format('d/m/Y') }} at {{ $lastNotified->format('H:i') }} @endif
@endif {{-- Modal --}} @endsection @section('javascripts') @endsection