({
data-hex="{{ s.color_hex }}"
data-fill="{{ fill }}"
data-pct="{{ pct }}"
- data-remaining="{% if s.current_net_g is not none %}{{ s.current_net_g|int }} g / {{ s.nominal_weight_g|int }} g ({{ pct|int }}%){% else %}—{% endif %}"
+ data-remaining="{% if s.current_net_g is not none %}{{ s.current_net_g|int }} g / {{ s.nominal_weight_g|int }} g ({{ pct|int }}%){% else %}{{ s.nominal_weight_g|int }} g · {{ _('não pesado') }}{% endif %}"
data-diameter="{{ s.diameter_mm }} mm"
data-location="{{ s.location or '—' }}"
data-notes="{{ s.notes }}"
diff --git a/templates/spools/detail.html b/templates/spools/detail.html
index 0357f8c..f46c9c1 100644
--- a/templates/spools/detail.html
+++ b/templates/spools/detail.html
@@ -100,7 +100,8 @@ SP-{{ '%04d'|format(spool.id) }}
{{ _('Pesado em') }} {{ spool.last_weighed_at | localdate }}
{% endif %}
{% else %}
- {{ _('Não pesado ainda') }}
+ {{ spool.nominal_weight_g|int }}g
+ {{ _('de {n}g nominais').replace('{n}', spool.nominal_weight_g|int|string) }} · {{ _('não pesado') }}
{% if logged_in and spool.active %}
{{ _('Registrar peso') }}
{% endif %}
diff --git a/templates/spools/list.html b/templates/spools/list.html
index 394b586..edbc1a8 100644
--- a/templates/spools/list.html
+++ b/templates/spools/list.html
@@ -72,7 +72,7 @@
| {{ s.brand }} / {{ s.family }} |
{{ s.location or '—' }} |
- {% if s.current_net_g is not none %}{{ s.current_net_g|int }}g{% else %}—{% endif %}
+ {% if s.current_net_g is not none %}{{ s.current_net_g|int }}g{% else %}{{ s.nominal_weight_g|int }}g{% endif %}
|
{{ _('Ver') }}
diff --git a/tests/test_smoke.py b/tests/test_smoke.py
index 940b36f..9da94dc 100644
--- a/tests/test_smoke.py
+++ b/tests/test_smoke.py
@@ -138,6 +138,15 @@ def test_spool_detail_pages_render(auth_client, db):
assert resp.status_code == 200, f"{url} retornou {resp.status_code}"
+def test_unweighed_spool_detail_shows_nominal(auth_client, db):
+ """Rolo não pesado: o detalhe assume o peso nominal (cheio) em vez de exibir 0/—.
+ Trava a correção visual — consistente com relatórios e donuts."""
+ sid = _make_spool(db, nominal=1000)
+ html = auth_client.get(f"/spools/{sid}").get_data(as_text=True)
+ assert "1000g" in html
+ assert "Não pesado ainda" not in html
+
+
# ── Autoatualização: o app só escreve o flag (sem privilégio) ────────────────
def test_update_run_writes_flag(auth_client, db):
diff --git a/translations.py b/translations.py
index aee94d9..37cb51b 100644
--- a/translations.py
+++ b/translations.py
@@ -1082,6 +1082,7 @@
_EN["Tara (g)"] = "Tare (g)"
_EN["Compra"] = "Purchase"
_EN["Não pesado ainda"] = "Not weighed yet"
+_EN["não pesado"] = "not weighed"
_EN["Remover da fila de impressão"] = "Remove from print queue"
_EN["Adicionar à fila de impressão"] = "Add to print queue"
_EN["de {n}g nominais"] = "of {n}g nominal"
@@ -1111,6 +1112,7 @@
_ES["Tara (g)"] = "Tara (g)"
_ES["Compra"] = "Compra"
_ES["Não pesado ainda"] = "Aún no pesado"
+_ES["não pesado"] = "sin pesar"
_ES["Remover da fila de impressão"] = "Quitar de la cola de impresión"
_ES["Adicionar à fila de impressão"] = "Agregar a la cola de impresión"
_ES["de {n}g nominais"] = "de {n}g nominales"
|