105 lines
4.5 KiB
PHP
105 lines
4.5 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))
|
|
<style>
|
|
@page { margin: 0; size: {{ $fmt === '99014' ? '54mm 101mm' : '57mm 32mm' }}; }
|
|
html, body {
|
|
margin: 0;
|
|
padding: 0;
|
|
width: {{ $fmt === '99014' ? '54mm' : '57mm' }};
|
|
height: {{ $fmt === '99014' ? '101mm' : '32mm' }};
|
|
font-family: Arial, Helvetica, sans-serif;
|
|
overflow: hidden;
|
|
}
|
|
.label { 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;
|
|
}
|
|
.content { min-width: 0; }
|
|
.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;
|
|
}
|
|
.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 print {
|
|
html, body { width: 100%; height: 100%; }
|
|
.label { transform: translate({{ $dymoDx }}mm, {{ $dymoDy }}mm) rotate({{ $dymoRot }}deg); transform-origin: top left; }
|
|
@if($fmt === '11354' && $dymoFix)
|
|
@page { size: 32mm 57mm; }
|
|
html, body { width: 32mm; height: 57mm; }
|
|
.label { width: 57mm; height: 32mm; transform: translate({{ $dymoDx }}mm, calc(57mm + {{ $dymoDy }}mm)) rotate(-90deg); transform-origin: top left; }
|
|
@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="label">
|
|
<div class="panel">
|
|
<div class="content">
|
|
<div class="code">{{ $item->codice_univoco }}</div>
|
|
<div class="title">{{ $item->titolo }}</div>
|
|
<div class="meta">
|
|
<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->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>
|
|
</body>
|
|
</html>
|