@extends('source.layouts.app') @section('content')
@include('source.common.header') @include('source.common.sidebar')
{{-- Page Header --}}
Manuscript (ID: {{$manuscript->manuscriptID}})

Title: {{ $manuscript->title ?? 'N/A' }} | Author: {{ $manuscript->author1 ?? ($manuscript->author1 ?? 'N/A') }}, {{ $manuscript->author2 ?? ($manuscript->author2 ?? 'N/A') }} | Status: {{ $manuscript->status ?? 'N/A' }}

{{-- Main Files Section --}}
@if(!empty($manuscript->fileurl))
Manuscript File

{{ basename($manuscript->fileurl) }}

Download
@endif @if(!empty($manuscript->table_index_file))
Table Index

{{ basename($manuscript->table_index_file) }}

Download
@endif
Figures
@forelse($images as $img)
{{ $img['name'] }}
{{ $img['name'] }}
@empty

No images uploaded.

@endforelse
@if(!empty($otherFiles) && $otherFiles->isNotEmpty())
Supplementary Files
@foreach($otherFiles as $file)
{{ $file['name'] }}
Open File
@endforeach
@endif {{-- Manuscript Attachments --}} @php $attachments = []; if (!empty($manuscript->attachments)) { $decoded = json_decode($manuscript->attachments, true); if (json_last_error() === JSON_ERROR_NONE && is_array($decoded)) { $attachments = $decoded; } else { $attachments = [$manuscript->attachments]; } } $possibleFields = [ $manuscript->manuscript_file ?? null, $manuscript->cover_letter ?? null, $manuscript->supplementary_file ?? null, ]; foreach ($possibleFields as $file) { if (!empty($file)) { $attachments[] = $file; } } $attachments = array_values(array_unique(array_filter($attachments))); @endphp @if(count($attachments))
Attachments
@foreach($attachments as $file) @php $clean = ltrim($file, '/'); $candidates = [ 'uploads/manuscripts/' . $clean, 'uploads/' . $clean, $clean, ]; $url = null; foreach ($candidates as $path) { if (\Illuminate\Support\Facades\File::exists(public_path($path))) { $url = asset($path); break; } } if (!$url) { $url = asset('uploads/manuscripts/' . $clean); } @endphp
{{ basename($clean) }}
Download
@endforeach
@endif
{{-- Footer --}}
{{-- Email Manuscript Modal --}} @endsection