Files
product-slip/slips/templates/slips/calibrate.html
Diaco Soltanpour d7f1929674 Label print calibration and Lithium Label UI polish (#3)
## Summary
- Calibrate label print/calibrate CSS to the reference PDF (positions, ~7pt/6pt sizes, bottom-row pitch)
- Print layout: partial last-box weight, pad short pages to 4 slips, whole-number weights
- Rename to Lithium Label Manager; Vazirmatn for FA / Inter for EN; inverted lithium icon; seed weights=5; number step=1; hide empty toast

## Test plan
- [ ] Print calibration sheet and overlay on a physical label — top and bottom rows align
- [ ] Order 50/5/4 — box labels show 20, 20, 10 (padded page); weights without `.0`
- [ ] Language toggle switches Inter ↔ Vazirmatn
- [ ] Seed products use canister weight 5; form spinners step by 1

Reviewed-on: #3
Co-authored-by: Diaco Soltanpour <dyaco8464@yahoo.com>
Co-committed-by: Diaco Soltanpour <dyaco8464@yahoo.com>
2026-10-01 18:10:44 +00:00

80 lines
3.1 KiB
HTML

{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calibration Page</title>
<link rel="stylesheet" href="{% static 'slips/css/label_print.css' %}">
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, sans-serif; background-color: #f0f0f0; }
.preview-controls {
background: #1e293b; color: #fff; padding: 1rem; text-align: center;
position: fixed; top: 0; left: 0; right: 0; z-index: 100;
}
.preview-controls button {
background: #3b82f6; color: white; border: none; padding: 10px 20px;
font-size: 16px; border-radius: 6px; cursor: pointer; font-weight: bold;
}
.page-wrapper { margin-top: 80px; display: flex; justify-content: center; padding-bottom: 40px; }
.a4-page {
width: 210mm; height: 297mm; background: white; position: relative;
box-shadow: 0 10px 25px rgba(0,0,0,0.15); overflow: hidden;
background-image:
linear-gradient(to right, #e2e8f0 1px, transparent 1px),
linear-gradient(to bottom, #e2e8f0 1px, transparent 1px);
background-size: 10mm 10mm;
}
.slip-grid {
display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
width: 100%; height: 100%;
}
.slip-quadrant { position: relative; width: 105mm; height: 148.5mm; border: 1px dashed #cbd5e1; }
.var-field {
color: red; /* Red for visibility during calibration */
}
.crosshair::before {
content: "┼"; position: absolute; left: -10px; top: -5px; color: blue; font-size: 20px;
}
@media print {
@page { size: A4 portrait; margin: 0; }
body { background: none; margin: 0; }
.preview-controls { display: none; }
.page-wrapper { margin: 0; padding: 0; display: block; }
.a4-page { box-shadow: none; width: 100%; height: 100vh; background-image: none; }
}
</style>
</head>
<body>
<div class="preview-controls">
<p style="margin-bottom: 10px;">Calibration Sheet. Print this on blank paper and overlay on a pre-printed label against light.</p>
<button onclick="window.print()">🖨️ Print Calibration</button>
<button onclick="window.close()" style="background:#64748b; margin-left: 10px;">Close</button>
</div>
<div class="page-wrapper">
<div class="a4-page">
<div class="slip-grid">
{% for i in "1234" %}
<div class="slip-quadrant">
<div class="var-field crosshair val-batch">[Batch#]</div>
<div class="var-field crosshair val-date">[Date]</div>
<div class="var-field crosshair val-next">[Next Control]</div>
<div class="var-field crosshair val-weight">[Weight]</div>
</div>
{% endfor %}
</div>
</div>
</div>
</body>
</html>