From d99f860e135d541538961719547c0808141e765e Mon Sep 17 00:00:00 2001 From: diaco Date: Wed, 7 Oct 2026 08:48:35 +0330 Subject: [PATCH] Add pages column and widen data entry tables Co-authored-by: Cursor --- slips/static/slips/css/style.css | 27 +++++++++++++++++++++++---- slips/static/slips/js/i18n.js | 5 +---- slips/templates/slips/entry.html | 4 +++- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/slips/static/slips/css/style.css b/slips/static/slips/css/style.css index 97d04fc..954e788 100644 --- a/slips/static/slips/css/style.css +++ b/slips/static/slips/css/style.css @@ -35,6 +35,7 @@ --font-sans: 'Inter', sans-serif; --font-fa: 'Vazirmatn', sans-serif; --font-mono: 'JetBrains Mono', monospace; + --content-max: 1200px; } [data-theme="dark"] { @@ -123,7 +124,7 @@ html[lang="fa"] body { .nav-container { position: relative; z-index: 1; - max-width: 1200px; + max-width: var(--content-max); margin: 0 auto; padding: 1rem 2rem; display: flex; @@ -201,15 +202,27 @@ html[lang="fa"] body { } /* Layout */ +@media (min-width: 1400px) { + :root { + --content-max: 1600px; + } +} + +@media (min-width: 1800px) { + :root { + --content-max: 1800px; + } +} + .main-content { - max-width: 1200px; + max-width: var(--content-max); margin: 2rem auto; padding: 0 2rem; } .page-grid { display: grid; - grid-template-columns: 1fr 1.5fr; + grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 2rem; align-items: start; } @@ -393,10 +406,16 @@ input:focus, select:focus { } .data-table th, .data-table td { - padding: 1rem 1.5rem; + padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); } +@media (min-width: 1400px) { + .data-table th, .data-table td { + padding: 1rem 1.25rem; + } +} + .data-table th { font-weight: 500; color: var(--text-secondary); diff --git a/slips/static/slips/js/i18n.js b/slips/static/slips/js/i18n.js index 2a39b9a..aa8bcc6 100644 --- a/slips/static/slips/js/i18n.js +++ b/slips/static/slips/js/i18n.js @@ -181,10 +181,7 @@ async function adjustCount(id, field, delta) { const tw = document.getElementById(`tw-${id}`); if (tw) tw.textContent = `${order.total_weight} kg`; const pages = document.getElementById(`pages-${id}`); - if (pages) { - const unit = (translations[currentLang] || translations.en).pages_unit; - pages.innerHTML = `${order.canister_pages + order.box_pages} ${unit}`; - } + if (pages) pages.textContent = order.canister_pages + order.box_pages; } catch (err) { showToast('Network error', true); } diff --git a/slips/templates/slips/entry.html b/slips/templates/slips/entry.html index 508e54c..b1b93e7 100644 --- a/slips/templates/slips/entry.html +++ b/slips/templates/slips/entry.html @@ -108,6 +108,7 @@ Batch Canisters Boxes + Pages Status @@ -140,6 +141,7 @@ {{ o.box_count }} {% endif %} + {{ o.canister_pages|add:o.box_pages }} {{ o.get_status_display }} {% if o.status == 'pending' %} @@ -148,7 +150,7 @@ {% empty %} - No orders yet + No orders yet {% endfor %}