feat(errors): erori pe 3 niveluri (problema+cauza+fix) pe API si UI (PRD 5.4)

Catalog central pur app/errors.py ca sursa unica cod->{problema,fix},
consumat de API+UI+worker. Aditiv (field/message pastrate la octet) +
rar_error stocat superset. Scope: fluxul de declarare; login/signup/CSRF
neatinse. labels.parse_erori degradeaza gratios; UI progresiv AA light+dark.
631 teste.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-06-23 10:28:09 +00:00
parent b48501d8e4
commit 14e1c463f0
25 changed files with 2440 additions and 44 deletions

View File

@@ -0,0 +1,36 @@
{#
_eroare.html — macro card_erori(erori) (US-006, PRD 5.4).
Primeste o lista de dict-uri cu cheile: problema, cauza, fix, field (sau None).
Afiseaza 3 niveluri intr-un bloc scannabil:
- "Problema" (bold, --err)
- "De ce" (doar daca ne-gol, --muted)
- "Cum repari" (accentuat, --accent)
Nu hardcodeaza culori — foloseste variabilele CSS din paleta (base.html).
Suporta light + dark din box (variabilele se schimba prin [data-theme]).
#}
{% macro card_erori(erori) %}
{% if erori %}
<div class="eroare-3n">
{% for e in erori %}
<div class="eroare-3n-item{% if not loop.first %} eroare-3n-sep{% endif %}">
<div class="eroare-3n-problema">
{% if e.field %}<span class="eroare-3n-camp">{{ e.field }}</span> {% endif %}{{ e.problema }}
</div>
{% if e.cauza %}
<div class="eroare-3n-cauza">
<span class="eroare-3n-label">De ce:</span> {{ e.cauza }}
</div>
{% endif %}
{% if e.fix %}
<div class="eroare-3n-fix">
<span class="eroare-3n-label">Cum repari:</span> {{ e.fix }}
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% endif %}
{% endmacro %}