feat(pdf): preview in Filament modal (iframe) instead of new tab
All "Vizualizare PDF" actions now open a wide (7xl) Filament modal containing an iframe pointing at the inline PDF endpoint, with a top-right "Descarcă" and "Deschide în tab nou" fallback. - WorkOrder edit action + WO table row action - InjectorProtocol edit action + protocols table row action - Dashboard Docs tab preview button (Alpine.js overlay since it's a plain Blade view, not a Filament action) The underlying /pdf routes stay unchanged (Content-Disposition: inline, ?download=1 for attachment) — the iframe just loads the same URL. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
{{-- Reusable PDF preview iframe (loaded inside a Filament action modal).
|
||||
$pdfUrl — inline PDF endpoint (Content-Disposition: inline).
|
||||
$downloadUrl — same URL with ?download=1, shown as a fallback link. --}}
|
||||
<div style="display:flex;flex-direction:column;gap:10px;">
|
||||
<div style="display:flex;justify-content:flex-end;gap:8px;">
|
||||
<a href="{{ $downloadUrl }}" class="text-primary-600 hover:underline text-sm font-medium">
|
||||
⬇️ {{ __('Descarcă') }}
|
||||
</a>
|
||||
<a href="{{ $pdfUrl }}" target="_blank" class="text-primary-600 hover:underline text-sm font-medium">
|
||||
↗️ {{ __('Deschide în tab nou') }}
|
||||
</a>
|
||||
</div>
|
||||
<iframe src="{{ $pdfUrl }}#toolbar=1&navpanes=0" style="width:100%;height:75vh;border:1px solid var(--fi-color-gray-200,#e5e7eb);border-radius:6px;" title="PDF"></iframe>
|
||||
</div>
|
||||
Reference in New Issue
Block a user