60 lines
2.4 KiB
PHP
Executable File
60 lines
2.4 KiB
PHP
Executable File
@extends('admin.layouts.netgescon')
|
|
|
|
@section('content')
|
|
<div class="container-fluid">
|
|
<div class="d-flex align-items-center justify-content-between mb-3">
|
|
<h1 class="h4 mb-0">Documento</h1>
|
|
<div class="btn-group" role="group">
|
|
<a class="btn btn-secondary" href="{{ route('admin.documenti.index') }}">Torna alla lista</a>
|
|
@if(!empty($documento?->file_path))
|
|
<a class="btn btn-primary" href="{{ route('admin.documenti.download', $documento->id) }}">Scarica</a>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card mb-3">
|
|
<div class="card-body">
|
|
<div class="row g-3">
|
|
<div class="col-md-6">
|
|
<div><strong>Titolo:</strong> {{ $documento->titolo ?? '-' }}</div>
|
|
<div><strong>Tipo:</strong> {{ $documento->tipo ?? '-' }}</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div><strong>Creato il:</strong> {{ optional($documento->created_at)->format('d/m/Y H:i') ?? '-' }}</div>
|
|
<div><strong>File:</strong> {{ $documento->nome_file ?? $documento->file_path ?? '-' }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@php
|
|
$path = (string) ($documento->file_path ?? '');
|
|
$ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));
|
|
$isPdf = $ext === 'pdf';
|
|
@endphp
|
|
|
|
@if(!empty($documento?->file_path))
|
|
<div class="card">
|
|
<div class="card-header">Anteprima</div>
|
|
<div class="card-body p-0">
|
|
@if($isPdf)
|
|
<iframe
|
|
src="{{ route('admin.documenti.download', $documento->id) }}"
|
|
style="width: 100%; height: 75vh; border: 0;"
|
|
title="Anteprima PDF"
|
|
></iframe>
|
|
@else
|
|
<div class="p-3">
|
|
<a class="btn btn-primary" href="{{ route('admin.documenti.download', $documento->id) }}">Apri / Scarica file</a>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@else
|
|
<div class="alert alert-warning">
|
|
Nessun file associato a questo documento.
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@endsection
|