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>
37 lines
1.1 KiB
HTML
37 lines
1.1 KiB
HTML
{#
|
|
_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 %}
|