diff --git a/public/index.html b/public/index.html
index b4c8df3..c6f0acd 100644
--- a/public/index.html
+++ b/public/index.html
@@ -4,411 +4,10 @@
Notes & Todos
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/public/js/admin.js b/public/js/admin.js
index a7b5aaf..4149579 100644
--- a/public/js/admin.js
+++ b/public/js/admin.js
@@ -7,6 +7,7 @@ class AdminService {
this.closeAdminBtn = document.getElementById('close-admin-btn');
this.addUserBtn = document.getElementById('add-user-btn');
this.usersList = document.getElementById('users-list');
+ this.adminBtn = document.getElementById('admin-btn');
if (this.adminPanel && this.closeAdminBtn && this.addUserBtn && this.usersList) {
this.setupEventListeners();
@@ -20,6 +21,13 @@ class AdminService {
if (this.addUserBtn) {
this.addUserBtn.addEventListener('click', () => this.showAddUserForm());
}
+ if (this.adminBtn) {
+ this.adminBtn.addEventListener('click', () => {
+ if (this.adminPanel) {
+ this.adminPanel.classList.remove('hidden');
+ }
+ });
+ }
}
async loadUsers() {
diff --git a/public/js/auth.js b/public/js/auth.js
index afac4c3..640f9d5 100644
--- a/public/js/auth.js
+++ b/public/js/auth.js
@@ -5,6 +5,7 @@ class AuthService {
this.loginForm = document.getElementById('login-form');
this.logoutBtn = document.getElementById('logout-btn');
this.userInfo = document.getElementById('user-info');
+ this.adminPanel = document.getElementById('admin-panel');
this.setupEventListeners();
this.updateUI();
@@ -63,7 +64,11 @@ class AuthService {
updateUI() {
const authContainer = document.getElementById('auth-container');
const appContainer = document.getElementById('app-container');
- const adminPanel = document.getElementById('admin-panel');
+
+ // S'assurer que le panneau d'administration est caché au démarrage
+ if (this.adminPanel) {
+ this.adminPanel.classList.add('hidden');
+ }
if (this.token && this.user) {
if (authContainer) authContainer.classList.add('hidden');
@@ -78,7 +83,7 @@ class AuthService {
adminBtn.className = 'admin-btn ml-4 text-sm text-gray-600 hover:text-gray-900';
adminBtn.textContent = 'Admin';
adminBtn.onclick = () => {
- if (adminPanel) adminPanel.classList.remove('hidden');
+ if (this.adminPanel) this.adminPanel.classList.remove('hidden');
};
this.userInfo.parentNode.insertBefore(adminBtn, this.logoutBtn);
}