Aduce toate suprafetele dashboard-ului la grila tabelului Trimiteri, muta
navigarea intr-un meniu de cont (hamburger) si da panoului admin actiuni
reale de ciclu de viata. 9 stories, 3 valuri. UI pur (reskin + reasezare)
cu O SINGURA exceptie backend: modelul de stare a contului.
- US-001 sectiunea "Ajutor" eliminata din Acasa (wayfinding redundant).
- US-002 Nomenclator la grila standard (_submissions.html ca referinta).
- US-003 macro autosend compact (Manual<->Auto). Semantica de PREZENTA
`auto_send` (bifat->true, absent->false) NEALTERATA — compatibil cu ambele
parsere (Form(bool) la /mapari, bool(form.get()) la import). Zero backend.
- US-004 accounts.status (pending/active/blocked/archived/deleted), migrare
defensiva idempotenta derivata din `active`, gate worker claim_one pe
status='active' (echivalenta active=1 <=> status='active' pastrata).
- US-005 tabel Mapari compact + panou Ajutor (<details>, proza o singura data),
coloana "In coada".
- US-006 meniu hamburger dropdown (Cont/Integrare/Nomenclator/Admin/logout) +
context is_authenticated/is_admin/csrf_token defensiv in base.html.
- US-007 tab-bar redus la Acasa+Mapari; rutele /_fragments/{cont,integrare,
nomenclator} + deep-link ?tab= raman valide.
- US-008 rute admin block/archive/delete + bulk pe lista account_id,
require_admin + CSRF + PRG, dev id=1 sarit in bulk.
- US-009 admin UI: selectie bife + master + bara bulk + kebab per-rand,
grupare pe stare (bloc nou blocate/arhivate), nota "cont dev implicit" scoasa.
Stergere = SOFT: tombstone (status='deleted'), dar PII purjata IMEDIAT
(rar_creds_enc + chei API revocate + CUI eliberat pentru re-inregistrare),
GDPR/L.142.
VERIFY: 671 teste pass (+40). E2E browser (Playwright) a prins 2 bug-uri
invizibile la TestClient: bara bulk cu display:flex inline invingea [hidden]
(mutat in CSS .bulk-bar[hidden]); conturi arhivate cadeau sub "in asteptare"
(grupare pe status). /code-review high a prins 2 bug-uri reale: soft delete
pastra creds RAR + CUI la nesfarsit fara purjare accounts (GDPR neonorat);
apostrof in numele firmei rupea confirm() inline din kebab — ambele reparate,
plus cleanup boilerplate rute (_lifecycle_route).
Backend trimitere (worker masina stari/idempotenta/mapping) neatins, cu
exceptia gate-ului de cont. Design: docs/design/5.5-uniformizare-ui.md.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
222 lines
9.4 KiB
HTML
222 lines
9.4 KiB
HTML
{% import '_macros.html' as ui %}
|
|
<div id="mapari-section">
|
|
|
|
{% if message %}
|
|
<div class="flash" style="margin-bottom:12px;">{{ message }}</div>
|
|
{% endif %}
|
|
|
|
<!-- ============================================================ -->
|
|
<!-- Sectiunea 1: De rezolvat (operatii needs_mapping) -->
|
|
<!-- ============================================================ -->
|
|
<div class="card">
|
|
{# US-005 (5.5): antet standard + link Ajutor ca <details> nativ (fara JS). Toata proza
|
|
care inainte se repeta inline (scopul maparilor, Auto/Manual) traieste acum AICI,
|
|
o singura data, ascunsa implicit. #}
|
|
<h2 style="font-size:15px; margin:0 0 8px;">De rezolvat</h2>
|
|
<details class="ajutor-mapari" style="margin:0 0 12px;">
|
|
<summary class="cardlink" style="display:inline-flex; color:var(--accent); cursor:pointer; padding:4px 0;">Ajutor</summary>
|
|
<div class="muted" style="font-size:13px; margin-top:8px; max-width:680px;">
|
|
Maparile leaga o operatie din softul tau (cod intern ROAAUTO) de un cod RAR oficial.
|
|
Operatiile necunoscute raman blocate in <span class="s-needs_mapping">needs_mapping</span>
|
|
si NU pleaca la RAR pana le mapezi. Sugestiile (%) vin din potrivire fuzzy pe denumire —
|
|
verifica-le inainte sa salvezi. <strong>In coada</strong>: <strong>Auto</strong> = la
|
|
urmatoarele fisiere cu aceasta operatie randurile intra automat in coada;
|
|
<strong>Manual</strong> = raman pentru verificare, nimic nu pleaca la RAR pana confirmi.
|
|
La schimbarea unui cod, submission-urile blocate pe acea operatie se re-rezolva automat.
|
|
</div>
|
|
</details>
|
|
|
|
{% if not pending %}
|
|
<div class="empty">
|
|
Nicio operatie nemapata — tot ce a venit s-a tradus in coduri RAR.
|
|
<a href="/?tab=acasa">Importa un fisier nou</a> daca vrei sa adaugi prezentari.
|
|
</div>
|
|
{% else %}
|
|
<div class="tablewrap">
|
|
<table>
|
|
<thead><tr>
|
|
<th>Operatie</th>
|
|
<th>Sugestii</th>
|
|
<th>Cod RAR</th>
|
|
<th>In coada</th>
|
|
<th></th>
|
|
</tr></thead>
|
|
<tbody>
|
|
{% for e in pending %}
|
|
{% set top = e.suggestions[0] if e.suggestions else None %}
|
|
{% set preselect = top.cod_prestatie if (top and top.score >= 60) else '' %}
|
|
<tr>
|
|
<td>
|
|
<form id="map-rez-{{ loop.index }}" hx-post="/mapari" hx-target="#mapari-section" hx-swap="outerHTML">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token or '' }}">
|
|
<input type="hidden" name="cod_op_service" value="{{ e.cod_op_service }}">
|
|
</form>
|
|
<div><strong>{{ e.cod_op_service }}</strong>
|
|
<span class="pill" title="submission-uri blocate">{{ e.blocked }} blocate</span></div>
|
|
<div class="muted">{{ e.denumire or '(fara denumire)' }}</div>
|
|
</td>
|
|
<td class="muted" style="font-size:12px;">
|
|
{% if e.suggestions %}
|
|
{% for s in e.suggestions[:3] %}
|
|
<span class="sugg">{{ s.cod_prestatie }} ({{ s.score|round|int }}%)</span>{% if not loop.last %}, {% endif %}
|
|
{% endfor %}
|
|
{% else %}—{% endif %}
|
|
</td>
|
|
<td>
|
|
<select name="cod_prestatie" form="map-rez-{{ loop.index }}" required
|
|
aria-label="Cod RAR pentru {{ e.cod_op_service }}">
|
|
<option value="">— alege cod RAR —</option>
|
|
{% for n in nomenclator %}
|
|
<option value="{{ n.cod_prestatie }}" {% if n.cod_prestatie == preselect %}selected{% endif %}>
|
|
{{ n.cod_prestatie }} — {{ n.nume_prestatie }}
|
|
</option>
|
|
{% endfor %}
|
|
</select>
|
|
</td>
|
|
<td>
|
|
{{ ui.autosend_toggle(form_id="map-rez-" ~ loop.index, checked=True) }}
|
|
</td>
|
|
<td>
|
|
<button type="submit" form="map-rez-{{ loop.index }}">Salveaza</button>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- ============================================================ -->
|
|
<!-- Sectiunea 2: Mapari operatii salvate (operations_mapping) -->
|
|
<!-- ============================================================ -->
|
|
<div class="card">
|
|
<h2 style="font-size:15px; margin:0 0 12px;">Mapari operatii salvate</h2>
|
|
|
|
{% if not saved_mappings %}
|
|
<div class="empty">
|
|
Nicio mapare salvata inca. Pe masura ce mapezi operatii, ele apar aici si le poti edita oricand.
|
|
</div>
|
|
{% else %}
|
|
{# US-005 (5.5): proza explicativa mutata in panoul Ajutor de la "De rezolvat" (o singura data). #}
|
|
|
|
<div class="tablewrap">
|
|
<table>
|
|
<thead><tr>
|
|
<th>Operatie</th>
|
|
<th>Cod RAR</th>
|
|
<th>In coada</th>
|
|
<th>Actiuni</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
{% for m in saved_mappings %}
|
|
<tr>
|
|
<td>
|
|
<form id="map-salv-{{ loop.index }}" hx-post="/mapari/salvate" hx-target="#mapari-section" hx-swap="outerHTML">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token or '' }}">
|
|
<input type="hidden" name="cod_op_service" value="{{ m.cod_op_service }}">
|
|
</form>
|
|
<form id="map-del-{{ loop.index }}" hx-post="/mapari/salvate/sterge" hx-target="#mapari-section" hx-swap="outerHTML"
|
|
hx-confirm="Stergi maparea pentru {{ m.cod_op_service }}?">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token or '' }}">
|
|
<input type="hidden" name="cod_op_service" value="{{ m.cod_op_service }}">
|
|
</form>
|
|
<div><strong>{{ m.cod_op_service }}</strong></div>
|
|
<div class="muted" style="font-size:12px;">
|
|
acum: {{ m.cod_prestatie }}{% if m.nume_prestatie %} — {{ m.nume_prestatie }}{% endif %}
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<select name="cod_prestatie" form="map-salv-{{ loop.index }}" required
|
|
aria-label="Cod RAR pentru {{ m.cod_op_service }}">
|
|
{% for n in nomenclator %}
|
|
<option value="{{ n.cod_prestatie }}" {% if n.cod_prestatie == m.cod_prestatie %}selected{% endif %}>
|
|
{{ n.cod_prestatie }} — {{ n.nume_prestatie }}
|
|
</option>
|
|
{% endfor %}
|
|
</select>
|
|
</td>
|
|
<td>
|
|
{{ ui.autosend_toggle(form_id="map-salv-" ~ loop.index, checked=m.auto_send) }}
|
|
</td>
|
|
<td style="white-space:nowrap;">
|
|
<button type="submit" form="map-salv-{{ loop.index }}">Salveaza</button>
|
|
<button type="submit" form="map-del-{{ loop.index }}"
|
|
style="background:var(--card); color:var(--err); border-color:var(--err);">
|
|
Sterge
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- ============================================================ -->
|
|
<!-- Sectiunea 3: Formate de coloane salvate (column_mappings) -->
|
|
<!-- ============================================================ -->
|
|
<div class="card">
|
|
<h2 style="font-size:15px; margin:0 0 12px;">Formate de coloane salvate</h2>
|
|
|
|
{% if not column_formats %}
|
|
<div class="empty">
|
|
Niciun format de coloane salvat inca. La primul import, maparea coloanelor fisierului
|
|
se retine aici si se reaplica automat la fisierele cu acelasi antet.
|
|
</div>
|
|
{% else %}
|
|
<p class="muted" style="margin:0 0 12px; font-size:13px;">
|
|
Antetele de fisier recunoscute. Un fisier cu alte coloane = format nou separat.
|
|
</p>
|
|
|
|
<div class="tablewrap">
|
|
<table>
|
|
<thead><tr>
|
|
<th>Coloane</th>
|
|
<th>Mapari (coloana → camp)</th>
|
|
<th>Format data</th>
|
|
<th></th>
|
|
</tr></thead>
|
|
<tbody>
|
|
{% for f in column_formats %}
|
|
<tr>
|
|
<td style="white-space:nowrap;">
|
|
<strong>{{ f.columns | length }} coloane</strong>
|
|
</td>
|
|
<td class="muted" style="font-size:12px; white-space:normal; max-width:340px;">
|
|
{% for col, camp in f.mappings.items() %}
|
|
<span class="sugg">{{ col }}</span> → {{ camp }}{% if not loop.last %}; {% endif %}
|
|
{% endfor %}
|
|
</td>
|
|
<td>
|
|
<form id="fmt-edit-{{ loop.index }}" hx-post="/formate-coloane/editeaza"
|
|
hx-target="#mapari-section" hx-swap="outerHTML"
|
|
style="display:flex; gap:6px; align-items:center;">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token or '' }}">
|
|
<input type="hidden" name="format_id" value="{{ f.id }}">
|
|
<input type="text" name="format_data" value="{{ f.format_data or '' }}"
|
|
placeholder="ex. DD.MM.YYYY" aria-label="Format data" style="max-width:130px;">
|
|
<button type="submit">Salveaza data</button>
|
|
</form>
|
|
</td>
|
|
<td>
|
|
<form hx-post="/formate-coloane/sterge" hx-target="#mapari-section" hx-swap="outerHTML"
|
|
hx-confirm="Stergi acest format de coloane?">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token or '' }}">
|
|
<input type="hidden" name="format_id" value="{{ f.id }}">
|
|
<button type="submit" style="background:var(--card); color:var(--err); border-color:var(--err);">
|
|
Sterge
|
|
</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
</div>
|