225 lines
8.6 KiB
PHP
225 lines
8.6 KiB
PHP
<!doctype html>
|
|
<html lang="it">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Etichetta Archivio Fisico</title>
|
|
@php($fmt = in_array(($format ?? '11354'), ['11354','99014'], true) ? $format : '11354')
|
|
@php($dymoFix = isset($dymoFix) ? (bool) $dymoFix : false)
|
|
@php($dymoRot = isset($dymoRot) ? (int) $dymoRot : 0)
|
|
@php($dymoDx = isset($dymoDx) ? (float) $dymoDx : 0.0)
|
|
@php($dymoDy = isset($dymoDy) ? (float) $dymoDy : 0.0)
|
|
@php($autoPrint = request()->has('autoprint') && filter_var(request()->query('autoprint'), FILTER_VALIDATE_BOOL))
|
|
@php($labelPrinterMode = isset($labelPrinterMode) ? (bool) $labelPrinterMode : false)
|
|
@php($pageWidth = $fmt === '99014' ? '54mm' : '57mm')
|
|
@php($pageHeight = $fmt === '99014' ? '101mm' : '32mm')
|
|
<style>
|
|
@page {
|
|
margin: {{ $labelPrinterMode ? '0' : '10mm' }};
|
|
size: {{ $labelPrinterMode ? ($fmt === '99014' ? '54mm 101mm' : '57mm 32mm') : 'A4 portrait' }};
|
|
}
|
|
html, body {
|
|
margin: 0;
|
|
padding: 0;
|
|
width: 100%;
|
|
min-height: 100%;
|
|
font-family: Arial, Helvetica, sans-serif;
|
|
overflow: visible;
|
|
background: {{ $labelPrinterMode ? 'white' : '#eef1f5' }};
|
|
}
|
|
.sheet {
|
|
box-sizing: border-box;
|
|
width: {{ $labelPrinterMode ? $pageWidth : '210mm' }};
|
|
min-height: {{ $labelPrinterMode ? $pageHeight : '297mm' }};
|
|
padding: {{ $labelPrinterMode ? '0' : '12mm' }};
|
|
display: flex;
|
|
align-items: {{ $labelPrinterMode ? 'stretch' : 'flex-start' }};
|
|
justify-content: {{ $labelPrinterMode ? 'stretch' : 'flex-start' }};
|
|
margin: 0 auto;
|
|
background: white;
|
|
overflow: hidden;
|
|
-webkit-print-color-adjust: exact;
|
|
print-color-adjust: exact;
|
|
break-inside: avoid;
|
|
break-after: avoid-page;
|
|
page-break-inside: avoid;
|
|
page-break-after: avoid;
|
|
}
|
|
.label {
|
|
box-sizing: border-box;
|
|
width: {{ $pageWidth }};
|
|
height: {{ $pageHeight }};
|
|
padding: 0;
|
|
flex: 0 0 auto;
|
|
position: relative;
|
|
}
|
|
.calib {
|
|
position: absolute;
|
|
inset: 0;
|
|
transform-origin: 0 0;
|
|
}
|
|
.label-content {
|
|
box-sizing: border-box;
|
|
width: 100%;
|
|
height: 100%;
|
|
padding: {{ $fmt === '99014' ? '3.5mm' : '2mm' }};
|
|
}
|
|
.panel {
|
|
width: 100%;
|
|
height: 100%;
|
|
border: 0.35mm solid #111;
|
|
box-sizing: border-box;
|
|
display: grid;
|
|
grid-template-columns: {{ $fmt === '99014' ? '1fr 18mm' : '1fr 10.8mm' }};
|
|
gap: 2mm;
|
|
padding: {{ $fmt === '99014' ? '2.4mm' : '1.5mm' }};
|
|
align-items: stretch;
|
|
}
|
|
.panel.panel-99014 {
|
|
display: block;
|
|
position: relative;
|
|
padding: 2.8mm;
|
|
}
|
|
.content { min-width: 0; }
|
|
.panel.panel-99014 .content {
|
|
padding-right: 0;
|
|
padding-bottom: 21mm;
|
|
}
|
|
.code { font-weight: 800; font-size: {{ $fmt === '99014' ? '14px' : '10px' }}; letter-spacing: 0.4px; }
|
|
.title { font-weight: 700; font-size: {{ $fmt === '99014' ? '13px' : '9px' }}; line-height: 1.15; margin-top: 1mm; }
|
|
.meta { font-size: {{ $fmt === '99014' ? '10px' : '7px' }}; line-height: 1.2; color: #222; margin-top: 1.1mm; }
|
|
.qr {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
overflow: hidden;
|
|
min-width: 0;
|
|
min-height: 0;
|
|
padding: 0.4mm;
|
|
box-sizing: border-box;
|
|
}
|
|
.panel.panel-99014 .qr {
|
|
position: absolute;
|
|
right: 2.8mm;
|
|
bottom: 2.8mm;
|
|
width: 18mm;
|
|
height: 18mm;
|
|
padding: 0;
|
|
}
|
|
.qr svg,
|
|
.qr img {
|
|
display: block;
|
|
width: 100% !important;
|
|
max-width: 100%;
|
|
max-height: 100%;
|
|
height: auto !important;
|
|
}
|
|
.qr svg {
|
|
aspect-ratio: 1 / 1;
|
|
}
|
|
.path { font-size: {{ $fmt === '99014' ? '9px' : '6.6px' }}; line-height: 1.2; color: #444; margin-top: 1mm; word-break: break-word; }
|
|
@media screen {
|
|
body {
|
|
padding: 12mm 0;
|
|
}
|
|
.sheet {
|
|
box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
|
|
}
|
|
}
|
|
@media print {
|
|
html, body {
|
|
width: 100%;
|
|
min-height: 100%;
|
|
background: white;
|
|
}
|
|
.sheet {
|
|
box-shadow: none;
|
|
margin: 0;
|
|
padding: {{ $labelPrinterMode ? '0' : '12mm' }};
|
|
min-height: auto;
|
|
}
|
|
@if($labelPrinterMode)
|
|
html, body {
|
|
overflow: hidden;
|
|
}
|
|
.sheet {
|
|
position: fixed;
|
|
left: 0;
|
|
top: 0;
|
|
}
|
|
.calib {
|
|
transform: translate({{ $dymoDx }}mm, {{ $dymoDy }}mm) rotate({{ $dymoRot }}deg);
|
|
}
|
|
@if($fmt === '11354' && $dymoFix)
|
|
@page { size: 32mm 57mm; }
|
|
html, body {
|
|
width: 32mm;
|
|
height: 57mm;
|
|
}
|
|
.sheet {
|
|
width: 32mm;
|
|
height: 57mm;
|
|
padding: 0;
|
|
}
|
|
.calib {
|
|
width: 57mm;
|
|
height: 32mm;
|
|
@if($dymoRot === 90)
|
|
transform: translate({{ $dymoDx }}mm, {{ $dymoDy }}mm) translateX(32mm) rotate(90deg);
|
|
@else
|
|
transform: translate({{ $dymoDx }}mm, {{ $dymoDy }}mm) translateY(57mm) rotate(-90deg);
|
|
@endif
|
|
}
|
|
@endif
|
|
@else
|
|
.calib { transform: none !important; }
|
|
@endif
|
|
}
|
|
</style>
|
|
@if($autoPrint)
|
|
<script>
|
|
window.addEventListener('load', () => setTimeout(() => { try { window.print(); } catch (e) {} }, 80));
|
|
window.onafterprint = () => { try { window.history.back(); } catch (e) {} };
|
|
</script>
|
|
@endif
|
|
</head>
|
|
<body>
|
|
<div class="sheet">
|
|
<div class="label">
|
|
<div class="calib">
|
|
<div class="label-content">
|
|
<div @class(['panel', 'panel-99014' => $fmt === '99014'])>
|
|
<div class="content">
|
|
<div class="code">{{ $item->codice_univoco }}</div>
|
|
<div class="title">{{ $item->titolo }}</div>
|
|
<div class="meta">
|
|
@if($item->stabile)
|
|
<div><strong>Stabile:</strong> {{ $item->stabile->denominazione }}</div>
|
|
@endif
|
|
<div><strong>Tipo:</strong> {{ $item->tipo_label }}</div>
|
|
@if($item->voce_numero || $item->voce_titolo)
|
|
<div><strong>Voce:</strong> {{ $item->voce_numero ? 'Voce ' . $item->voce_numero : '' }} {{ $item->voce_titolo }}</div>
|
|
@endif
|
|
@if($item->data_archiviazione)
|
|
<div><strong>Data:</strong> {{ $item->data_archiviazione->format('d-m-Y') }}</div>
|
|
@endif
|
|
@if($item->parent)
|
|
<div><strong>Dentro:</strong> {{ $item->parent->codice_univoco }}</div>
|
|
@endif
|
|
@if($item->documento)
|
|
<div><strong>Digitale:</strong> {{ $item->documento->nome_file ?: $item->documento->nome }}</div>
|
|
@endif
|
|
</div>
|
|
<div class="path">{{ $item->percorso_fisico }}</div>
|
|
</div>
|
|
<div class="qr">
|
|
{!! $item->qr_code_image !!}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|