feat: FASE 2 - Client Base (layout, login, navbar, tema, i18n)

Implementazione completa del frontend Flask:
- Layout base.html con TailwindCSS CDN, dark/light theme, flash messages
- Navbar responsive role-based (Maker, MeasurementTec, Metrologist, Admin)
- Login page professionale con form + API integration
- Profilo utente: nome, lingua, tema, badge ruoli
- Sistema tema dark/light: CSS variables + Alpine.js store + localStorage
- i18n completo IT/EN: Flask-Babel (.po) + alpinejs-i18n (JSON)
- API Client riscritto: error handling normalizzato, no crash su 4xx/5xx
- CSRF protection con Flask-WTF su tutti i form
- Logo aziendale dinamico da system_settings
- Asset SVG: tmflow-logo.svg + tmflow-icon.svg (favicon)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Adriano
2026-02-07 01:10:13 +01:00
parent d6508e0ae8
commit edd4580a5a
17 changed files with 2230 additions and 52 deletions
+2
View File
@@ -1,3 +1,5 @@
[python: *.py]
[python: blueprints/**.py]
[python: services/**.py]
[jinja2: templates/**.html]
encoding = utf-8
@@ -0,0 +1,247 @@
# English translations for TieMeasureFlow
msgid ""
msgstr ""
"Project-Id-Version: TieMeasureFlow 1.0\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
# Login Page
msgid "Accedi al sistema"
msgstr "Sign in to your account"
msgid "Username"
msgstr "Username"
msgid "Password"
msgstr "Password"
msgid "Accedi"
msgstr "Sign In"
msgid "Credenziali non valide"
msgstr "Invalid credentials"
msgid "Inserisci username e password"
msgstr "Enter username and password"
msgid "Hai dimenticato la password?"
msgstr "Forgot password?"
msgid "Contatta l'amministratore"
msgstr "Contact administrator"
# Navbar
msgid "Misure"
msgstr "Measurements"
msgid "Ricette"
msgstr "Recipes"
msgid "Statistiche"
msgstr "Statistics"
msgid "Admin"
msgstr "Admin"
msgid "Utenti"
msgstr "Users"
msgid "Impostazioni"
msgstr "Settings"
msgid "Profilo"
msgstr "Profile"
msgid "Esci"
msgstr "Logout"
# Profile Page
msgid "Profilo Utente"
msgstr "User Profile"
msgid "Nome Visualizzato"
msgstr "Display Name"
msgid "Lingua"
msgstr "Language"
msgid "Tema"
msgstr "Theme"
msgid "Chiaro"
msgstr "Light"
msgid "Scuro"
msgstr "Dark"
msgid "Ruoli"
msgstr "Roles"
msgid "Salva Modifiche"
msgstr "Save Changes"
msgid "Profilo aggiornato con successo"
msgstr "Profile updated successfully"
# Flash Messages
msgid "Benvenuto, %(name)s!"
msgstr "Welcome, %(name)s!"
msgid "Logout effettuato"
msgstr "Logged out successfully"
msgid "Effettua il login per continuare"
msgstr "Please log in to continue"
msgid "Errore di connessione al server"
msgstr "Server connection error"
# Common UI
msgid "Caricamento..."
msgstr "Loading..."
msgid "Salva"
msgstr "Save"
msgid "Annulla"
msgstr "Cancel"
msgid "Conferma"
msgstr "Confirm"
msgid "Elimina"
msgstr "Delete"
msgid "Modifica"
msgstr "Edit"
msgid "Cerca..."
msgstr "Search..."
msgid "Nessun risultato"
msgstr "No results"
msgid "Errore"
msgstr "Error"
msgid "Successo"
msgstr "Success"
msgid "Attenzione"
msgstr "Warning"
msgid "Info"
msgstr "Info"
msgid "Pagina"
msgstr "Page"
msgid "di"
msgstr "of"
msgid "Precedente"
msgstr "Previous"
msgid "Successivo"
msgstr "Next"
# Measurements
msgid "Conforme"
msgstr "Pass"
msgid "Non Conforme"
msgstr "Fail"
msgid "Valore"
msgstr "Value"
msgid "Prossima misura"
msgstr "Next measurement"
# Numpad
msgid "Tastierino Numerico"
msgstr "Numeric Keypad"
msgid "Cancella"
msgstr "Clear"
msgid "Virgola"
msgstr "Decimal"
msgid "Chiudi"
msgstr "Close"
# Theme
msgid "Cambia tema"
msgstr "Toggle theme"
# Language
msgid "Cambia lingua"
msgstr "Switch language"
msgid "Italiano"
msgstr "Italian"
msgid "English"
msgstr "English"
# Additional Login Page
msgid "Sistema di misurazione industriale"
msgstr "Industrial measurement system"
# Additional Profile Page
msgid "Gestisci le tue informazioni e preferenze"
msgstr "Manage your information and preferences"
msgid "Informazioni Account"
msgstr "Account Information"
msgid "Il nome utente non può essere modificato"
msgstr "Username cannot be changed"
msgid "Nome da visualizzare nell'interfaccia"
msgstr "Name to display in the interface"
msgid "Lingua Preferita"
msgstr "Preferred Language"
msgid "Tema Preferito"
msgstr "Preferred Theme"
msgid "Indietro"
msgstr "Back"
msgid "Azioni Account"
msgstr "Account Actions"
msgid "Esci dal sistema"
msgstr "Logout from system"
msgid "Termina la sessione corrente e torna alla schermata di login"
msgstr "End current session and return to login screen"
msgid "Preferenze"
msgstr "Preferences"
# Error Messages
msgid "Errore durante l'aggiornamento del profilo"
msgstr "Error updating profile"
msgid "Errore di connessione al server: %(error)s"
msgstr "Server connection error: %(error)s"
msgid "Errore nel caricamento del profilo: %(error)s"
msgstr "Error loading profile: %(error)s"
# Roles
msgid "Maker"
msgstr "Maker"
msgid "MeasurementTec"
msgstr "Measurement Technician"
msgid "Metrologist"
msgstr "Metrologist"
@@ -0,0 +1,247 @@
# Italian translations for TieMeasureFlow
msgid ""
msgstr ""
"Project-Id-Version: TieMeasureFlow 1.0\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
# Login Page
msgid "Accedi al sistema"
msgstr "Accedi al sistema"
msgid "Username"
msgstr "Username"
msgid "Password"
msgstr "Password"
msgid "Accedi"
msgstr "Accedi"
msgid "Credenziali non valide"
msgstr "Credenziali non valide"
msgid "Inserisci username e password"
msgstr "Inserisci username e password"
msgid "Hai dimenticato la password?"
msgstr "Hai dimenticato la password?"
msgid "Contatta l'amministratore"
msgstr "Contatta l'amministratore"
# Navbar
msgid "Misure"
msgstr "Misure"
msgid "Ricette"
msgstr "Ricette"
msgid "Statistiche"
msgstr "Statistiche"
msgid "Admin"
msgstr "Admin"
msgid "Utenti"
msgstr "Utenti"
msgid "Impostazioni"
msgstr "Impostazioni"
msgid "Profilo"
msgstr "Profilo"
msgid "Esci"
msgstr "Esci"
# Profile Page
msgid "Profilo Utente"
msgstr "Profilo Utente"
msgid "Nome Visualizzato"
msgstr "Nome Visualizzato"
msgid "Lingua"
msgstr "Lingua"
msgid "Tema"
msgstr "Tema"
msgid "Chiaro"
msgstr "Chiaro"
msgid "Scuro"
msgstr "Scuro"
msgid "Ruoli"
msgstr "Ruoli"
msgid "Salva Modifiche"
msgstr "Salva Modifiche"
msgid "Profilo aggiornato con successo"
msgstr "Profilo aggiornato con successo"
# Flash Messages
msgid "Benvenuto, %(name)s!"
msgstr "Benvenuto, %(name)s!"
msgid "Logout effettuato"
msgstr "Logout effettuato"
msgid "Effettua il login per continuare"
msgstr "Effettua il login per continuare"
msgid "Errore di connessione al server"
msgstr "Errore di connessione al server"
# Common UI
msgid "Caricamento..."
msgstr "Caricamento..."
msgid "Salva"
msgstr "Salva"
msgid "Annulla"
msgstr "Annulla"
msgid "Conferma"
msgstr "Conferma"
msgid "Elimina"
msgstr "Elimina"
msgid "Modifica"
msgstr "Modifica"
msgid "Cerca..."
msgstr "Cerca..."
msgid "Nessun risultato"
msgstr "Nessun risultato"
msgid "Errore"
msgstr "Errore"
msgid "Successo"
msgstr "Successo"
msgid "Attenzione"
msgstr "Attenzione"
msgid "Info"
msgstr "Info"
msgid "Pagina"
msgstr "Pagina"
msgid "di"
msgstr "di"
msgid "Precedente"
msgstr "Precedente"
msgid "Successivo"
msgstr "Successivo"
# Measurements
msgid "Conforme"
msgstr "Conforme"
msgid "Non Conforme"
msgstr "Non Conforme"
msgid "Valore"
msgstr "Valore"
msgid "Prossima misura"
msgstr "Prossima misura"
# Numpad
msgid "Tastierino Numerico"
msgstr "Tastierino Numerico"
msgid "Cancella"
msgstr "Cancella"
msgid "Virgola"
msgstr "Virgola"
msgid "Chiudi"
msgstr "Chiudi"
# Theme
msgid "Cambia tema"
msgstr "Cambia tema"
# Language
msgid "Cambia lingua"
msgstr "Cambia lingua"
msgid "Italiano"
msgstr "Italiano"
msgid "English"
msgstr "English"
# Additional Login Page
msgid "Sistema di misurazione industriale"
msgstr "Sistema di misurazione industriale"
# Additional Profile Page
msgid "Gestisci le tue informazioni e preferenze"
msgstr "Gestisci le tue informazioni e preferenze"
msgid "Informazioni Account"
msgstr "Informazioni Account"
msgid "Il nome utente non può essere modificato"
msgstr "Il nome utente non può essere modificato"
msgid "Nome da visualizzare nell'interfaccia"
msgstr "Nome da visualizzare nell'interfaccia"
msgid "Lingua Preferita"
msgstr "Lingua Preferita"
msgid "Tema Preferito"
msgstr "Tema Preferito"
msgid "Indietro"
msgstr "Indietro"
msgid "Azioni Account"
msgstr "Azioni Account"
msgid "Esci dal sistema"
msgstr "Esci dal sistema"
msgid "Termina la sessione corrente e torna alla schermata di login"
msgstr "Termina la sessione corrente e torna alla schermata di login"
msgid "Preferenze"
msgstr "Preferenze"
# Error Messages
msgid "Errore durante l'aggiornamento del profilo"
msgstr "Errore durante l'aggiornamento del profilo"
msgid "Errore di connessione al server: %(error)s"
msgstr "Errore di connessione al server: %(error)s"
msgid "Errore nel caricamento del profilo: %(error)s"
msgstr "Errore nel caricamento del profilo: %(error)s"
# Roles
msgid "Maker"
msgstr "Maker"
msgid "MeasurementTec"
msgstr "Tecnico di Misura"
msgid "Metrologist"
msgstr "Metrologo"