From a3f863ecdb964461725acc98f36f98755f28128f Mon Sep 17 00:00:00 2001 From: BFLOWS Date: Sat, 18 Apr 2026 22:15:24 +0200 Subject: [PATCH] feat(verbale): logo Gepafin SVG ufficiale nel verbale PDF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Carlo ha fornito il logo Gepafin ufficiale (SVG vettoriale, colore #4A644E verde istituzionale, 118x50 viewbox). Sostituito il placeholder testuale con il logo reale. Implementazione: - app/static/gepafin-logo.svg — logo copiato dal repo FE Gepafin (8.7KB SVG) - verbale.py: aggiunto STATIC_DIR + LOGO_FILE_URL con path file:// assoluto (weasyprint risolve file:// localmente senza HTTP fetch) - template passa logo_path nel contesto Jinja - verbale_istruttoria.html: CSS .hdr__logo-img (altezza 38pt) sostituisce .hdr__logo testuale Verificato: PDF da 23KB -> 32KB (incluso SVG), XObject embedded OK, header PDF-1.7 valido. Nel PDF il logo appare in alto a destra dell'header accanto al sottotitolo 'Finanziaria regionale dell\'Umbria'. --- app/routers/verbale.py | 4 ++++ app/static/gepafin-logo.svg | 1 + app/templates_jinja/verbale_istruttoria.html | 6 +++--- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 app/static/gepafin-logo.svg diff --git a/app/routers/verbale.py b/app/routers/verbale.py index 08ef456..7ffef66 100644 --- a/app/routers/verbale.py +++ b/app/routers/verbale.py @@ -23,6 +23,9 @@ router = APIRouter(prefix="/api/remission-practices/instructor", tags=["verbale" TEMPLATES_DIR = Path(__file__).resolve().parent.parent / "templates_jinja" +STATIC_DIR = Path(__file__).resolve().parent.parent / "static" +# URL file:// assoluto per weasyprint (che non fa HTTP fetch ma risolve file://) +LOGO_FILE_URL = f"file://{STATIC_DIR.resolve()}/gepafin-logo.svg" # ---------- Jinja env & filters ---------- @@ -244,6 +247,7 @@ def _build_context(db: Session, practice: RemissionPractice, user: AuthUser) -> "custom_checks_merged": custom_checks_merged, "previous_tranches": previous_tranches, "max_tranches_snapshot": max_tranches_snapshot, + "logo_path": LOGO_FILE_URL, } diff --git a/app/static/gepafin-logo.svg b/app/static/gepafin-logo.svg new file mode 100644 index 0000000..5ae5063 --- /dev/null +++ b/app/static/gepafin-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/templates_jinja/verbale_istruttoria.html b/app/templates_jinja/verbale_istruttoria.html index b5addb5..3739b76 100644 --- a/app/templates_jinja/verbale_istruttoria.html +++ b/app/templates_jinja/verbale_istruttoria.html @@ -50,8 +50,8 @@ padding-bottom: 10pt; margin-bottom: 14pt; } - .hdr__logo { - font-size: 22pt; font-weight: 900; color: #1a365d; letter-spacing: 1pt; + .hdr__logo-img { + height: 38pt; width: auto; display: inline-block; } .hdr__subtitle { @@ -186,7 +186,7 @@ {% if practice.period_label %}
{{ practice.period_label }}
{% endif %}
- + Gepafin
Finanziaria regionale dell'Umbria