feat(5.20): US-010 badge mediu RAR in liste/preview/detaliu/jurnal + audit + ecou API
labels.py: ETICHETE_ENV + eticheta_env(env)->(text,css). Productie afisata
"PRODUCȚIE" (majuscule+diacritice) cu badge fill de atentie (--err), Testare
outline discret muted — semnalizare risc L.142 (declaratie reala ireversibila).
Clase .env-badge-prod / .env-badge-test in base.html; eticheta_env expus ca
global Jinja.
Badge de mediu per rand in _submissions, _coada implicit prin view, _preview_rand,
_trimitere_detaliu, _jurnal. Statusbar (_status.html) aliniat la aceeasi conventie
(Productie = atentie, nu verde) — inlocuieste culorile ad-hoc din US-011, toggle
neatins.
rar_env in exportul de audit (AUDIT_COLUMNS + _audit_rows) si ecou in
GET /v1/prezentari(/{id}). _submission_row_view/_detaliu_ctx/fragment_submissions
duc rar_env pana in template.
tests/test_badge_rar_env.py: badge in lista, audit contine rar_env, GET ecou rar_env.
test_statusbar_env: asertie aliniata la eticheta PRODUCȚIE.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,11 @@
|
||||
{% else %}
|
||||
<span class="muted" style="font-size:12px;">doar evenimentele contului tau</span>
|
||||
{% endif %}
|
||||
{# Badge mediu RAR activ (US-010 PRD 5.20) — mediul implicit al contului #}
|
||||
{% if env_default | default('') %}
|
||||
{% set _eb = eticheta_env(env_default) %}
|
||||
<span class="{{ _eb[1] }}" style="margin-left:auto;" title="Mediu RAR activ">{{ _eb[0] }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<form id="filtre-jurnal"
|
||||
|
||||
@@ -39,6 +39,11 @@
|
||||
<span class="pill {{ row.stare_css }}" style="display:inline-flex; align-items:center; gap:5px;"
|
||||
{% if _nota %}title="{{ _nota }}"{% endif %}>
|
||||
<span aria-hidden="true" style="display:inline-block; width:7px; height:7px; border-radius:99px; background:currentColor; flex-shrink:0;"></span>{{ row.stare_eticheta }}</span>
|
||||
{# Badge mediu RAR (US-010 PRD 5.20) — rar_env disponibil din contextul batch-ului. #}
|
||||
{% if rar_env | default('') %}
|
||||
{% set _eb = eticheta_env(rar_env) %}
|
||||
<div style="margin-top:3px;"><span class="{{ _eb[1] }}">{{ _eb[0] }}</span></div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="col-vehicul" data-eticheta="Vehicul">
|
||||
{{ row.prez.vehicul_nr }}
|
||||
|
||||
@@ -127,19 +127,19 @@
|
||||
La 0 medii: nu afisa (cont fara configuratie RAR).
|
||||
La 1 mediu: eticheta statica (fara toggle).
|
||||
La 2 medii: buton de comutare HTMX (toggle conditionat).
|
||||
US-010: culori prin eticheta_env/clase .env-badge-* (consistenta cu badge-urile din liste).
|
||||
#}
|
||||
{% set _medii = medii_disponibile | default([]) %}
|
||||
{% set _env = env_default | default('prod') %}
|
||||
{% set _env_label = "Testare" if _env == "test" else "Productie" %}
|
||||
{% set _eb = eticheta_env(_env) %}
|
||||
{% if _medii | length >= 1 %}
|
||||
<div class="env-indicator"
|
||||
style="display:flex; align-items:center; gap:8px; margin-bottom:10px;
|
||||
padding:6px 10px; border-radius:6px; font-size:var(--fs-sm);
|
||||
background:color-mix(in srgb, {% if _env == 'test' %}var(--warn){% else %}var(--ok){% endif %} 12%, var(--card));
|
||||
border:1px solid color-mix(in srgb, {% if _env == 'test' %}var(--warn){% else %}var(--ok){% endif %} 30%, transparent);">
|
||||
<span style="font-weight:600; color:{% if _env == 'test' %}var(--warn){% else %}var(--ok){% endif %};">
|
||||
Mediu RAR: {{ _env_label }}
|
||||
</span>
|
||||
background:color-mix(in srgb, {% if _env == 'prod' %}var(--err){% else %}var(--line){% endif %} 10%, var(--card));
|
||||
border:1px solid color-mix(in srgb, {% if _env == 'prod' %}var(--err){% else %}var(--line){% endif %} 30%, transparent);">
|
||||
<span style="font-weight:600;">Mediu RAR:</span>
|
||||
<span class="{{ _eb[1] }}">{{ _eb[0] }}</span>
|
||||
{% if _medii | length >= 2 %}
|
||||
{# Toggle: apare DOAR cand sunt cel putin 2 medii disponibile #}
|
||||
<form method="post" action="/_fragments/status/toggle-env"
|
||||
@@ -152,7 +152,7 @@
|
||||
style="padding:2px 10px; font-size:var(--fs-xs); border-radius:99px;
|
||||
border:1px solid currentColor; background:transparent; cursor:pointer;
|
||||
color:var(--muted); line-height:1.4;"
|
||||
title="Comuta la {{ 'Productie' if _env == 'test' else 'Testare' }}">
|
||||
title="Comuta la {{ 'PRODUCȚIE' if _env == 'test' else 'Testare' }}">
|
||||
Comuta
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -136,9 +136,14 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Pill de stare — dreapta, flex:none #}
|
||||
<span class="pill {{ r.stare_css }}" title="{{ r.stare_text }}"
|
||||
style="flex:0 0 auto; white-space:nowrap;">{{ r.stare_scurt }}</span>
|
||||
{# Zona dreapta: pill stare + badge mediu RAR (US-010 PRD 5.20) #}
|
||||
<div style="flex:0 0 auto; display:flex; flex-direction:column; align-items:flex-end; gap:3px; white-space:nowrap;">
|
||||
<span class="pill {{ r.stare_css }}" title="{{ r.stare_text }}">{{ r.stare_scurt }}</span>
|
||||
{% if r.rar_env %}
|
||||
{% set _eb = eticheta_env(r.rar_env) %}
|
||||
<span class="{{ _eb[1] }}">{{ _eb[0] }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
@@ -7,10 +7,14 @@
|
||||
{% set cod_afis = prez.cod_rar if (prez.cod_rar and prez.cod_rar != '—') else 'nemapat' %}
|
||||
<div class="card" id="detaliu-card-{{ id }}" style="border:none; padding:0; margin:0;">
|
||||
|
||||
{# === Header — #id + pill + motiv uman === #}
|
||||
{# === Header — #id + pill stare + badge mediu RAR (US-010 PRD 5.20) + motiv === #}
|
||||
<div style="display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0 0 8px;">
|
||||
<h2 id="detaliu-modal-titlu" style="font-size:15px; margin:0;">Detaliu trimitere #{{ id }}</h2>
|
||||
<span class="pill {{ stare_css }}">{{ stare_text }}</span>
|
||||
{% if rar_env %}
|
||||
{% set _eb = eticheta_env(rar_env) %}
|
||||
<span class="{{ _eb[1] }}" title="Mediu RAR: {{ _eb[0] }}">{{ _eb[0] }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if motiv %}
|
||||
<p class="muted" style="margin:0 0 12px; font-size:13px;">{{ motiv }}</p>
|
||||
|
||||
@@ -142,6 +142,14 @@
|
||||
.s-ok{color:var(--ok);}
|
||||
.s-needs_review{color:var(--warn);}
|
||||
.s-already_sent,.s-duplicate_in_file{color:var(--muted);}
|
||||
/* Badge mediu RAR (US-010 PRD 5.20) — semantica risc L.142.
|
||||
Productie: fill atentie (ton --err), text alb — declaratie reala, ireversibila.
|
||||
Testare: outline discret, ton --muted — mediu de proba, low-stakes.
|
||||
NU se foloseste verde pentru Productie (ar semnala "sigur"). */
|
||||
.env-badge-prod { display:inline-block; padding:1px 7px; border-radius:99px; font-size:11px; font-weight:700; letter-spacing:.02em;
|
||||
background:color-mix(in srgb, var(--err) 80%, var(--card)); color:#fff; border:1px solid transparent; }
|
||||
.env-badge-test { display:inline-block; padding:1px 7px; border-radius:99px; font-size:11px;
|
||||
background:transparent; color:var(--muted); border:1px solid var(--line); }
|
||||
.muted { color:var(--muted); }
|
||||
/* Heading/eticheta accesibila doar pentru cititoare de ecran (vizual ascunsa). */
|
||||
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
|
||||
|
||||
Reference in New Issue
Block a user