Implementeaza PRD 3.6 (US-001..007), pe canalul de import + stratul web;
worker / masina stari / idempotenta / mapare raman neatinse.
- US-003/004: tab-ul "Trimiteri" eliminat; Trimiterile devin sectiune
permanenta sub upload pe Acasa ("Trimiterile tale"); upload comprimat la
bara slim (hero pastrat la first-run); ?tab=coada si /_fragments/coada
servesc Acasa (fara fragment orfan); poll gated pe visibilityState.
- US-001: coloana noua import_rows.override_json (nullable, Fernet, Approach B)
+ _migrate defensiv; ruta v1 + alias web .../rand/{i}/editeaza aplica patch
canonic ULTIMUL in _resolve_row_for_preview si commit_import (mutatie pura,
status rederivat, fara drift). Scoping JOIN -> 404, guard committed -> 409,
semantica empty=clear, decrypt fail -> no-op.
- US-002: buton "Editeaza" pe rand; swap pe <tr> + OOB contoare (nu pe sectiune);
form propriu (confirm dezactivat la editare); refoloseste grila responsiva +
error-map din _trimitere_detaliu.html; mutual-exclusion intre randuri.
- US-005/006: "De rezolvat", "Operatii salvate" si "Formate de coloane" ca
tabele (.tablewrap); H4: comutatorul reflecta auto_send STOCAT.
- US-007: bifa "auto-send" devine comutator etichetat pe COADA ("Pune automat
in coada" / "Tine pentru verificare"), scoped pe operatie; name="auto_send"
pastrat (semantica de prezenta -> bool corect cu ambele parsere, zero backend).
Fix-uri gasite la verificarea E2E in browser (htmx 1.9.12, JS — invizibile la
TestClient): useTemplateFragments=true (raspuns <tr>+OOB era parsat in context
de tabel -> swapError + contoare pierdute); re-activarea confirm-btn dupa salvare
deferita pe tick (evita editing=true tranzitoriu); n-hint actualizat de updateN.
Teste: 523 passed. E2E browser: Acasa unificata, upload slim, editare rand
(needs_data -> ok, swap pe rand, contoare OOB), Mapari tabelar + comutator.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
95 lines
3.8 KiB
HTML
95 lines
3.8 KiB
HTML
{% extends "base.html" %}
|
|
{% block content %}
|
|
|
|
<!-- Nav cont: link admin (doar pentru admini) + logout -->
|
|
<div style="display:flex; gap:8px; justify-content:flex-end; margin-bottom:12px; flex-wrap:wrap;">
|
|
{% if is_admin %}<a class="cardlink" href="/admin">Panou admin</a>{% endif %}
|
|
<form method="post" action="/logout" style="display:inline; margin:0;">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
<button type="submit" style="background:var(--card); color:var(--muted); border-color:var(--line);">Iesi din cont</button>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Bara de status (US-002): mereu vizibila, deasupra tab-bar-ului -->
|
|
<div id="status-bar" class="status-bar card"
|
|
hx-get="/_fragments/status"
|
|
hx-trigger="load, every 15s"
|
|
hx-swap="outerHTML">
|
|
<div class="empty muted" style="padding:8px 0;">se incarca starea…</div>
|
|
</div>
|
|
|
|
<!-- Tab-bar: navigare intre sectiuni -->
|
|
<div role="tablist" class="tab-bar" aria-label="Sectiuni dashboard">
|
|
{# US-003 (3.6): tab-ul "Trimiteri" (coada) a fost eliminat — Trimiterile traiesc
|
|
ca sectiune permanenta pe Acasa. Raman: Acasa·Mapari·Cont·Nomenclator. #}
|
|
{% set tabs = [
|
|
("acasa", "Acasa", "tab-acasa"),
|
|
("mapari", "Mapari", "tab-mapari"),
|
|
("cont", "Cont", "tab-cont"),
|
|
("nomenclator", "Nomenclator", "tab-nomenclator")
|
|
] %}
|
|
{% for tab_id, tab_label, tab_elem_id in tabs %}
|
|
{% set badge = (badges.get(tab_id, 0) if badges else 0) %}
|
|
<a id="{{ tab_elem_id }}"
|
|
role="tab"
|
|
href="/?tab={{ tab_id }}"
|
|
aria-selected="{{ 'true' if active_tab == tab_id else 'false' }}"
|
|
aria-controls="tab-panel"
|
|
{% if badge %}aria-label="{{ tab_label }}, {{ badge }} necesita atentie"{% endif %}
|
|
class="tab-link{% if active_tab == tab_id %} tab-activ{% endif %}"
|
|
tabindex="{{ '0' if active_tab == tab_id else '-1' }}"
|
|
hx-get="/_fragments/{{ tab_id }}"
|
|
hx-target="#tab-panel"
|
|
hx-swap="innerHTML"
|
|
hx-push-url="/?tab={{ tab_id }}">{{ tab_label }}{% if badge %}<span class="tab-badge" aria-hidden="true" style="display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; margin-left:6px; padding:0 5px; border-radius:99px; background:var(--err); color:#fff; font-size:11px; font-weight:700;">{{ badge }}</span>{% endif %}</a>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<!-- Panou activ: randat server-side la full load; HTMX inlocuieste continutul la click pe tab -->
|
|
<div id="tab-panel" role="tabpanel" aria-labelledby="tab-{{ active_tab }}" class="tab-panel">
|
|
{{ panel_html | safe }}
|
|
</div>
|
|
|
|
<script>
|
|
(function() {
|
|
/* Navigare cu sageti intre tab-uri (ARIA pattern) */
|
|
var tablist = document.querySelector('[role="tablist"]');
|
|
if (!tablist) return;
|
|
var tabs = Array.from(tablist.querySelectorAll('[role="tab"]'));
|
|
tablist.addEventListener('keydown', function(e) {
|
|
var idx = tabs.indexOf(document.activeElement);
|
|
if (idx === -1) return;
|
|
var next = -1;
|
|
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
|
|
next = (idx + 1) % tabs.length;
|
|
} else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {
|
|
next = (idx - 1 + tabs.length) % tabs.length;
|
|
} else if (e.key === 'Home') {
|
|
next = 0;
|
|
} else if (e.key === 'End') {
|
|
next = tabs.length - 1;
|
|
}
|
|
if (next !== -1) {
|
|
e.preventDefault();
|
|
tabs[next].focus();
|
|
}
|
|
});
|
|
|
|
/* La click pe tab: actualizeaza aria-selected + tabindex */
|
|
tabs.forEach(function(tab) {
|
|
tab.addEventListener('click', function() {
|
|
tabs.forEach(function(t) {
|
|
t.setAttribute('aria-selected', 'false');
|
|
t.setAttribute('tabindex', '-1');
|
|
t.classList.remove('tab-activ');
|
|
});
|
|
tab.setAttribute('aria-selected', 'true');
|
|
tab.setAttribute('tabindex', '0');
|
|
tab.classList.add('tab-activ');
|
|
});
|
|
});
|
|
})();
|
|
</script>
|
|
|
|
{% endblock %}
|