From 6c2a9f716a876c9e615877318836bcb8c06d99b8 Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Tue, 16 Jun 2026 12:33:32 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20bouton=20Enregistrer=20+=20Deconnexion?= =?UTF-8?q?=20dans=20Profil=20=E2=80=94=20style=20harmonieux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - config-save-btn: fond accent, texte blanc, border-radius 6px - Bouton Deconnexion: fond danger-bg, texte danger - Logout dans initProfile via /api/auth/logout --- frontend/index.html | 1 + frontend/js/config.js | 12 ++++++++++++ frontend/style.css | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/frontend/index.html b/frontend/index.html index 2f39334..5507458 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2043,6 +2043,7 @@ + diff --git a/frontend/js/config.js b/frontend/js/config.js index 6dee151..11c07d9 100644 --- a/frontend/js/config.js +++ b/frontend/js/config.js @@ -1546,6 +1546,7 @@ function initProfile() { var langSel = document.getElementById('profile-lang'); var nameInp = document.getElementById('profile-name'); var saveBtn = document.getElementById('profile-save'); + var logoutBtn = document.getElementById('profile-logout'); var savedEl = document.getElementById('profile-saved'); if (!langSel || !saveBtn) return; @@ -1564,4 +1565,15 @@ function initProfile() { if (savedEl) { savedEl.style.display = 'inline'; setTimeout(function() { savedEl.style.display = 'none'; }, 2000); } } catch(e) {} }); + + // Logout button + if (logoutBtn) { + logoutBtn.addEventListener('click', function() { + if (confirm('Voulez-vous vraiment vous deconnecter ?')) { + fetch('/api/auth/logout', { method: 'POST' }) + .then(function() { window.location.reload(); }) + .catch(function() { window.location.reload(); }); + } + }); + } } diff --git a/frontend/style.css b/frontend/style.css index 89610f0..ddd5d45 100644 --- a/frontend/style.css +++ b/frontend/style.css @@ -2228,6 +2228,13 @@ select { } .profile-hint { display: block; font-size: 0.65rem; color: var(--text-muted); margin-top: 4px; } .profile-saved { font-size: 0.7rem; color: var(--accent-green); margin-left: 10px; } +.config-save-btn { + padding: 6px 18px; font-size: 0.75rem; font-weight: 600; + background: var(--accent); color: #fff; + border: 1px solid var(--accent); border-radius: 6px; + cursor: pointer; transition: opacity 0.15s; +} +.config-save-btn:hover { opacity: 0.85; } .saved-search-vault { font-size: 0.65rem; color: var(--text-muted);