fix: bouton Enregistrer + Deconnexion dans Profil — style harmonieux
- config-save-btn: fond accent, texte blanc, border-radius 6px - Bouton Deconnexion: fond danger-bg, texte danger - Logout dans initProfile via /api/auth/logout
This commit is contained in:
@@ -2043,6 +2043,7 @@
|
||||
<input type="text" id="profile-name" class="config-input" placeholder="Votre nom" maxlength="60">
|
||||
</div>
|
||||
<button class="config-save-btn" id="profile-save">Enregistrer</button>
|
||||
<button class="config-save-btn" id="profile-logout" style="background:var(--danger-bg);color:var(--danger);border-color:var(--danger);margin-left:8px">Deconnexion</button>
|
||||
<span class="profile-saved" id="profile-saved" style="display:none">✓ Sauvegarde</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -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(); });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user