@php $usesDrive = $this->usesDrive(); @endphp

{{ __('Files & Attachments') }}

{{ __('All files related to this job, including anything the client sent through their portal.') }}

@if ($usesDrive && $job->drive_folder_url) {{-- The escape hatch: everything below is a convenience view of this one folder, and anyone who would rather work in Drive itself (version history, desktop sync, comments) should be one click away. --}}
@if ($canUpdate) @endif {{ __('Open folder in Drive') }}
@endif
@if ($usesDrive)

{{ __("This job has its own Google Drive folder. Drop production files straight into it from Drive for Desktop — they do not have to be uploaded here — then use “Check Drive for new files” to list them.") }} @if ($job->drive_synced_at) {{ __('Last checked') }} {{ $job->drive_synced_at->timezone(config('app.display_timezone'))->diffForHumans() }}. @endif

@endif @if ($canUpdate) @php // One control for everything that can be added to a job. Splitting // "take a photo" from "upload a file" made two boxes for one act, // and the second one was the one nobody scrolled to. $destinations = [ \App\Livewire\Jobs\Show::UPLOAD_FILE => [ 'icon' => 'document', 'label' => __('Job file'), 'blurb' => __('Artwork, specs, references — the working files for this job.'), ], \App\Livewire\Jobs\Show::UPLOAD_PROOF => [ 'icon' => 'eye', 'label' => __('Proof for the client'), 'blurb' => __('Goes to their job portal to be approved or sent back. Kept private, never given a public link.'), ], \App\Livewire\Jobs\Show::UPLOAD_SHOWCASE => [ 'icon' => 'camera', 'label' => __('Showcase'), 'blurb' => __('A portfolio shot of the finished work. Shown in the gallery below, and under Showcase in the sidebar.'), ], ]; $maxLabel = $this->uploadMaxKb() >= 1024 ? round($this->uploadMaxKb() / 1024).' MB' : $this->uploadMaxKb().' KB'; @endphp
{{ __('Add to') }} @foreach ($destinations as $key => $meta) @endforeach

{{ $destinations[$uploadTo]['blurb'] ?? '' }}

{{-- What this file is FOR. A job selling three flags with three different designs has three drawings, and one pile of files on the job is how the wrong one gets printed. Choosing a product that was never split gives it its single piece behind the scenes, so the drawing has something real to belong to. --}} @if ($job->lineItems->count() > 1 || $job->productParts->isNotEmpty())
@endif
@endif
@foreach ($job->attachments->where('purpose', \App\Models\JobAttachment::PURPOSE_GENERAL)->sortByDesc('created_at') as $file) @php $href = $file->staffUrl(); @endphp
{{-- Clips and voice notes play here rather than being downloaded to find out which one they are — the reason a media library gets abandoned is having to open every file to identify it. --}} @if ($file->kind === 'video')
@elseif ($file->kind === 'audio')
@else @if ($file->is_image) {{-- Every image gets a thumbnail now, not just the ones that happened to land on the public disk: the stream route serves them all. --}}
{{ $file->original_name }}
@else
{{ $file->extension_label }}
@endif
@endif {{-- Where the file came from, where it is kept, and where a proof has got to. --}}
@if ($file->job_product_part_id) @php $forPart = $job->productParts->firstWhere('id', $file->job_product_part_id); @endphp @if ($forPart) {{ $forPart->label }} @endif @endif @if ($file->isInDrive()) {{ __('In Drive') }} @endif @if ($file->isFromClient()) {{ __('From client') }} @endif @if ($file->is_proof) @if ($file->proof_status === \App\Models\JobAttachment::PROOF_APPROVED) {{ __('Approved') }} @elseif ($file->proof_status === \App\Models\JobAttachment::PROOF_CHANGES) {{ __('Changes asked') }} @else {{ __('Awaiting client') }} @endif @endif

{{ $file->original_name }}

{{ $file->extension_label }} · {{ $file->human_size }} @if ($file->driveLink()) · {{ __('Drive') }} @endif

@if ($canUpdate) @endif
{{-- Drawings uploaded before a product was split still need to find their design, so they can be re-filed here rather than deleted and uploaded again. --}} @if ($canUpdate && $job->productParts->isNotEmpty())
@endif @if ($file->proof_comment)

“{{ $file->proof_comment }}”

@endif @if ($canUpdate && $file->is_proof && $file->proof_status === \App\Models\JobAttachment::PROOF_CHANGES) @endif
@endforeach
@if ($job->attachments->where('purpose', \App\Models\JobAttachment::PURPOSE_GENERAL)->isEmpty())

{{ __('No files attached.') }}

@endif