@extends('user.layouts.app')
@section('title','Edit Authors')
@section('page-title','Edit Paper Authors')
@section('page-subtitle',$paper->paper_code)
@section('content')
@if(session('success'))
{{ session('success') }}
@endif
@if($errors->any())@foreach($errors->all() as $e)- {{ $e }}
@endforeach
@endif
@if($paper->isAccepted())
This paper has been accepted. Only Technical Committee Editor/Chairman or assigned review managers can change authors.
@else
You can edit, reorder, or remove co-authors until the paper is accepted.
@endif
@php
$principal = $paper->authors->firstWhere('author_order', 1) ?? $paper->authors->first();
$coAuthors = $paper->authors->where('author_order', '>', 1)->sortBy('author_order')->values()->map(fn ($a) => [
'first_name' => $a->first_name,
'other_name' => $a->other_name,
'last_name' => $a->last_name,
'email' => $a->email,
'phone' => $a->phone,
'affiliation' => $a->affiliation,
])->all();
@endphp
@endsection