{{-- Permintaan tambahan pengguna - kad Attachments (Work Order show) dipaparkan sebagai table (bukan galeri thumbnail bebas) supaya lebih tersusun: #, Tarikh, Info (label fasa + peranan/nama pemuat naik), Gambar, Keterangan Gambar (caption). Parameter (sama seperti partials.attachment-gallery): - $attachments: Collection Attachment (mesti sudah eager-load 'uploadedBy.roles' oleh Controller - lihat WorkOrderController - elak masalah N+1). - $downloadRoute: nama route muat turun berkawalan-akses. --}} @if ($attachments->isEmpty())
{{ __('app.partials.attachment.table.no_attachments') }}
@else @php $phaseText = fn ($a) => match ($a->phase ?? null) { 'BEFORE' => __('app.partials.attachment.table.phase_before_text'), 'DURING' => __('app.partials.attachment.table.phase_during_text'), 'AFTER' => __('app.partials.attachment.table.phase_after_text'), default => null, }; @endphp| {{ __('app.partials.attachment.table.col_no') }} | {{ __('app.partials.attachment.table.col_date') }} | {{ __('app.partials.attachment.table.col_info') }} | {{ __('app.partials.attachment.table.col_image') }} | {{ __('app.partials.attachment.table.col_caption') }} |
|---|---|---|---|---|
| {{ $loop->iteration }} | {{ $attachment->created_at?->format('d/m/Y H:i') }} |
@if ($phaseText($attachment))
{{ $phaseText($attachment) }}
@endif
{{ Str::before($attachment->uploadedBy?->roles->first()?->name ?? '-', '(') }}
@if ($attachment->uploadedBy)
({{ $attachment->uploadedBy->name }})
@endif
|
@if ($attachment->file_type === 'IMAGE')
|
{{ $attachment->caption ?? '-' }} |