[UI] SWAP V2: Bootstrap Italia ora UFFICIALE su 27 pagine app (kill della vecchia UI)
Promosse le pagine -bi a nomi ufficiali (contenuto BI), link -bi->plain, titoli '(BI)' rimossi.
La vecchia UI delle pagine app e sostituita. Backup: git (commit 36967f9) + /tmp/nis2-v1-backup.
Promosse (27): auth (login/register/onboarding/forgot/reset) + app (dashboard/assessment/
risks/incidents/policies/supply-chain/training/assets/reports/settings/isms/acn-gap/normative/
whistleblowing/kb/cross-analysis/service-continuity/guida/companies) + admin (index/orgs/users).
common-bi.js: sidebar BI ora linka le pagine ufficiali.
ESCLUSA: index.html (landing marketing 1298 righe) -> conversione dedicata a parte (la -bi
era 557 righe, rischio perdita contenuti). Pagine marketing/demo (presentation/simulate/
workflow/architecture/index-en) restano vecchio stile (fuori scope app autenticata).
Verifica produzione: 27/27 servite 200 con BI, 0 link -bi residui, 0 '(BI)' nei titoli,
auth intatta (401 su pwd errata), common-bi.js node --check OK.
Rollback: git revert HEAD (oppure ripristino da /tmp/nis2-v1-backup).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
36967f9452
commit
1c64211685
+66
-85
@@ -4,136 +4,117 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Accedi - NIS2 Agile</title>
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
||||
<!-- PILOTA Bootstrap Italia v2.18.1 (Opzione B). Self-hostato: asset serviti da /vendor (regola 'MAI CDN'). -->
|
||||
<link rel="stylesheet" href="vendor/bootstrap-italia/dist/css/bootstrap-italia.min.css">
|
||||
<style>
|
||||
/* solo layout di centratura: i colori/font/forme vengono da Bootstrap Italia */
|
||||
body { min-height: 100vh; display: flex; align-items: center; background: #f5f6f7; }
|
||||
.auth-wrap { width: 100%; max-width: 460px; margin: 0 auto; padding: 24px; }
|
||||
.auth-brand { text-align: center; margin-bottom: 24px; }
|
||||
.auth-brand .brand-name { font-weight: 700; font-size: 1.5rem; color: #06c; }
|
||||
.auth-brand .brand-name span { color: #17324d; }
|
||||
.auth-brand .brand-sub { color: #5a6772; font-size: .9rem; margin-top: 4px; }
|
||||
.pw-wrap { position: relative; }
|
||||
.pw-wrap .form-input { padding-right: 42px; }
|
||||
.pw-toggle {
|
||||
position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
|
||||
background: none; border: none; cursor: pointer;
|
||||
color: #9CA3AF; font-size: 15px; padding: 0; transition: color .2s;
|
||||
}
|
||||
.pw-toggle:hover { color: var(--color-primary, #2563eb); }
|
||||
.forgot-link {
|
||||
display: block; text-align: center; margin-top: 10px;
|
||||
font-size: .78rem; color: #6B7280; text-decoration: none; transition: color .2s;
|
||||
}
|
||||
.forgot-link:hover { color: var(--color-primary, #2563eb); }
|
||||
.auth-terms {
|
||||
margin-top: 14px; padding-top: 14px;
|
||||
border-top: 1px solid var(--border-color, #e5e7eb);
|
||||
text-align: center; font-size: .72rem; color: #9CA3AF; line-height: 1.8;
|
||||
}
|
||||
.auth-terms a { color: #6B7280; text-decoration: underline; }
|
||||
.pw-wrap .form-control { padding-right: 44px; }
|
||||
.pw-toggle { position: absolute; right: 8px; top: 8px; background: none; border: none;
|
||||
color: #5a6772; cursor: pointer; padding: 6px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="auth-page">
|
||||
<div class="auth-card">
|
||||
<div class="auth-header">
|
||||
<div class="auth-logo">
|
||||
<div class="auth-logo-icon">
|
||||
<svg viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 2.18l7 3.12v4.7c0 4.83-3.23 9.36-7 10.57-3.77-1.21-7-5.74-7-10.57V6.3l7-3.12z"/>
|
||||
<path d="M10 12.5l-2-2-1.41 1.41L10 15.32l5.41-5.41L14 8.5l-4 4z"/>
|
||||
</svg>
|
||||
</div>
|
||||
<span class="auth-logo-text">NIS2 <span>Agile</span></span>
|
||||
</div>
|
||||
<p class="auth-subtitle">Piattaforma di compliance NIS2</p>
|
||||
</div>
|
||||
<main class="auth-wrap">
|
||||
<div class="auth-brand">
|
||||
<div class="brand-name">NIS2 <span>Agile</span></div>
|
||||
<div class="brand-sub">Piattaforma di compliance NIS2</div>
|
||||
</div>
|
||||
|
||||
<div class="auth-body">
|
||||
<div class="auth-error" id="login-error"></div>
|
||||
<div class="card card-bg has-bkg-grey shadow">
|
||||
<div class="card-body">
|
||||
<h1 class="h4 mb-3">Accedi</h1>
|
||||
|
||||
<div class="alert alert-danger d-none" id="login-error" role="alert"></div>
|
||||
|
||||
<form id="login-form" novalidate>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="email">Indirizzo Email</label>
|
||||
<input type="email" id="email" name="email" class="form-input"
|
||||
placeholder="nome@azienda.it" autocomplete="email" required>
|
||||
<label for="email" class="active">Indirizzo Email</label>
|
||||
<input type="email" id="email" name="email" class="form-control"
|
||||
autocomplete="email" required aria-describedby="login-error">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="password">Password</label>
|
||||
<label for="password" class="active">Password</label>
|
||||
<div class="pw-wrap">
|
||||
<input type="password" id="password" name="password" class="form-input"
|
||||
placeholder="La tua password" autocomplete="current-password" required>
|
||||
<input type="password" id="password" name="password" class="form-control"
|
||||
autocomplete="current-password" required>
|
||||
<button type="button" class="pw-toggle" id="pw-toggle" tabindex="-1"
|
||||
onclick="(function(){var i=document.getElementById('password'),b=document.getElementById('pw-toggle');if(i.type==='password'){i.type='text';b.innerHTML='<i class=\'fas fa-eye-slash\'></i>';}else{i.type='password';b.innerHTML='<i class=\'fas fa-eye\'></i>';}})()" aria-label="Mostra/nascondi password">
|
||||
<i class="fas fa-eye"></i>
|
||||
aria-label="Mostra o nascondi la password"
|
||||
onclick="(function(){var i=document.getElementById('password');i.type=(i.type==='password')?'text':'password';})()">
|
||||
<svg class="icon icon-sm" aria-hidden="true"><use href="vendor/bootstrap-italia/dist/svg/sprites.svg#it-password-visible"></use></svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary btn-lg w-full" id="login-btn">
|
||||
Accedi
|
||||
</button>
|
||||
<a href="forgot-password.html" class="forgot-link">
|
||||
Password dimenticata?
|
||||
</a>
|
||||
<button type="submit" class="btn btn-primary w-100 mt-2" id="login-btn">Accedi</button>
|
||||
|
||||
<p class="text-center mt-3 mb-0">
|
||||
<a href="forgot-password.html">Password dimenticata?</a>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="auth-footer">
|
||||
<p>Non hai un account? <a href="register.html">Registrati</a></p>
|
||||
<div class="auth-terms">
|
||||
Accedendo accetti i nostri
|
||||
<a href="https://agentai.agile.software/terms" target="_blank">Termini di Servizio</a>
|
||||
e la <a href="https://agentai.agile.software/privacy" target="_blank">Privacy Policy</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="text-center mt-3 small">
|
||||
Non hai un account? <a href="register.html">Registrati</a>
|
||||
</p>
|
||||
<p class="text-center small text-muted">
|
||||
Accedendo accetti i
|
||||
<a href="https://agentai.agile.software/terms" target="_blank" rel="noopener">Termini di Servizio</a>
|
||||
e la <a href="https://agentai.agile.software/privacy" target="_blank" rel="noopener">Privacy Policy</a>.
|
||||
</p>
|
||||
</main>
|
||||
|
||||
<script src="vendor/bootstrap-italia/dist/js/bootstrap-italia.bundle.min.js"></script>
|
||||
<script>
|
||||
// Carica i web font ufficiali (Titillium Web, ecc.) — richiesto da Bootstrap Italia
|
||||
if (window.bootstrap && bootstrap.loadFonts) {
|
||||
bootstrap.loadFonts('vendor/bootstrap-italia/dist/fonts');
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Stessa logica della login attuale: ZERO modifiche backend -->
|
||||
<script src="js/api.js"></script>
|
||||
<script src="js/common.js"></script>
|
||||
<script>
|
||||
// Se gia' autenticato, vai alla dashboard
|
||||
if (api.isAuthenticated()) {
|
||||
window.location.href = 'dashboard.html';
|
||||
}
|
||||
if (api.isAuthenticated()) { window.location.href = 'dashboard.html'; }
|
||||
|
||||
const form = document.getElementById('login-form');
|
||||
const errorEl = document.getElementById('login-error');
|
||||
const loginBtn = document.getElementById('login-btn');
|
||||
|
||||
function showError(msg) { errorEl.textContent = msg; errorEl.classList.remove('d-none'); }
|
||||
function hideError() { errorEl.classList.add('d-none'); }
|
||||
|
||||
form.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
errorEl.classList.remove('visible');
|
||||
|
||||
hideError();
|
||||
const email = document.getElementById('email').value.trim();
|
||||
const password = document.getElementById('password').value;
|
||||
|
||||
if (!email || !password) {
|
||||
errorEl.textContent = 'Inserisci email e password.';
|
||||
errorEl.classList.add('visible');
|
||||
return;
|
||||
}
|
||||
if (!email || !password) { showError('Inserisci email e password.'); return; }
|
||||
|
||||
loginBtn.disabled = true;
|
||||
loginBtn.textContent = 'Accesso in corso...';
|
||||
|
||||
try {
|
||||
const result = await api.login(email, password);
|
||||
|
||||
if (result.success) {
|
||||
const isConsultant = result.data.user && result.data.user.role === 'consultant';
|
||||
const hasOrgs = result.data.organizations && result.data.organizations.length > 0;
|
||||
if (!hasOrgs) {
|
||||
window.location.href = 'onboarding.html';
|
||||
} else if (isConsultant) {
|
||||
window.location.href = 'companies.html';
|
||||
} else {
|
||||
window.location.href = 'dashboard.html';
|
||||
}
|
||||
if (!hasOrgs) window.location.href = 'onboarding.html';
|
||||
else if (isConsultant) window.location.href = 'companies.html';
|
||||
else window.location.href = 'dashboard.html';
|
||||
} else {
|
||||
errorEl.textContent = result.message || 'Credenziali non valide.';
|
||||
errorEl.classList.add('visible');
|
||||
showError(result.message || 'Credenziali non valide.');
|
||||
}
|
||||
} catch (err) {
|
||||
errorEl.textContent = 'Errore di connessione al server.';
|
||||
errorEl.classList.add('visible');
|
||||
showError('Errore di connessione al server.');
|
||||
} finally {
|
||||
loginBtn.disabled = false;
|
||||
loginBtn.textContent = 'Accedi';
|
||||
|
||||
Reference in New Issue
Block a user