Files
Solis/internal/server/templates/print_labels.html
T
lucioandClaude Opus 4.6 ff1d1fc490 Add i18n framework with English and Chinese support
Introduce an embedded-locale i18n package exposing a T() template
function. UI strings across all templates and catalog category/item
names are now translatable via locale JSON files, selectable through
the new server.language config option. Falls back to English when a
locale is missing or fails to load.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-05-21 21:30:56 -07:00

52 lines
3.1 KiB
HTML

{{define "title"}}{{T "app.title.print"}}{{end}}
{{define "content"}}
<div class="page-header">
<div class="page-title">
<h1>{{T "print.title"}}</h1>
<p>{{T "print.subtitle"}}</p>
</div>
<div style="display: flex; gap: 0.5rem;">
<button onclick="window.print()" class="btn btn-primary">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" style="width:18px;height:18px;">
<path stroke-linecap="round" stroke-linejoin="round" d="M6.72 13.829c-.24.03-.48.062-.72.096m.72-.096a42.415 42.415 0 0110.56 0m-10.56 0L6.34 18m10.94-4.171c.24.03.48.062.72.096m-.72-.096L17.66 18m0 0a2.25 2.25 0 01-2.247 2.118H8.587A2.25 2.25 0 016.34 18m11.32 0h.008v.008h-.008V18zm-12 0h.008v.008h-.008V18zm0-11.25h12.75c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125H5.66c-.621 0-1.125-.504-1.125-1.125v-1.5c0-.621.504-1.125 1.125-1.125z" />
</svg>
{{T "print.print_sheet"}}
</button>
<a href="/admin" class="btn btn-secondary">{{T "print.back_to_assets"}}</a>
</div>
</div>
<div class="card" style="margin-bottom: 2rem;">
<h3 style="font-weight: 700; margin-bottom: 0.5rem; color: var(--color-brand-primary);">{{T "print.guidelines_title"}}</h3>
<ul style="margin-left: 1.5rem; color: var(--color-text-muted); font-size: 0.95rem; display: flex; flex-direction: column; gap: 0.25rem;">
<li>{{T "print.guideline_margins"}}</li>
<li>{{T "print.guideline_graphics"}}</li>
<li>{{T "print.guideline_size"}}</li>
</ul>
</div>
<!-- Dynamic Printable Grid -->
<div class="print-grid" style="display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; padding: 10px; background-color: white; border: 1px solid var(--color-border); border-radius: var(--radius-md);">
{{if .Items}}
{{range .Items}}
{{if .ShortSlug}}
<div class="print-label-item" style="border: 1px dashed var(--color-border); border-radius: var(--radius-sm); padding: 1rem; text-align: center; background-color: white; display: flex; flex-direction: column; align-items: center; justify-content: space-between; aspect-ratio: 1/1;">
<div class="print-label-name" style="font-weight: 700; font-size: 0.95rem; color: var(--color-text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;" title="{{.Name}}">
{{.Name}}
</div>
<img class="print-label-qr" src="/admin/qr/{{.ShortSlug}}" alt="QR Code" style="width: 110px; height: 110px; margin: 0.5rem 0; border: 1px solid var(--color-border); padding: 2px;">
<div class="print-label-slug" style="font-family: monospace; font-size: 0.8rem; color: var(--color-text-muted); font-weight: 600;">
s/{{.ShortSlug}}
</div>
</div>
{{end}}
{{end}}
{{else}}
<div style="grid-column: 1/-1; text-align: center; color: var(--color-text-light); padding: 4rem 1rem;">
{{T "print.empty"}}
</div>
{{end}}
</div>
{{end}}