@php $variant = $variant ?? 'pre-pdwp'; $wpPreviewOnly = ! empty($wpPreviewOnly ?? false); $canEditWorkingPaperBody = $canEditWorkingPaperBody ?? true; $canEditAttachments = (bool) $canEditWorkingPaperBody && ! $wpPreviewOnly; $attachmentRows = data_get($data ?? [], 'attachments', []); $attachmentRows = \App\Support\WorkingPaperAttachments::normalizeList($attachmentRows); $tableClass = match ($variant) { 'pdwp' => 'pdwpwp-form', 'ddwp' => 'ddwpwp-form', default => 'prepwp-form', }; $labelClass = match ($variant) { 'pdwp' => 'pdwpwp-label', 'ddwp' => 'ddwpwp-label', default => 'prepwp-label', }; $headRowClass = $variant === 'pdwp' ? 'pdwpwp-h34' : ''; $hideBlock = ! $canEditAttachments && $attachmentRows === []; $workingPaper = $workingPaper ?? null; $canEmbedSaved = $workingPaper instanceof \App\Models\PC\WorkingPaper && (int) $workingPaper->id > 0; @endphp @unless ($hideBlock)
| Attached Documents | |
|---|---|
|
@if ($attachmentRows !== [])
@if ($canEmbedSaved)
@endif
@elseif ($canEditAttachments)
No documents attached yet. @endif @if ($canEditAttachments) @endif |
|