[dyad] wrote 5 file(s)

This commit is contained in:
Michael committed 2025-11-06 14:00:24 +01:00
1 parent 204e66dd3a
commit f45cfb36e0
5 files changed
+40 -23

No files matched your search

+10 -10
View File
@@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Notes & Todos</title>
<link rel="stylesheet" href="/css/styles.css">
<link href="https://unpkg.com/lucide-icons/dist/css/lucide.css" rel="stylesheet">
<script src="https://unpkg.com/lucide-icons"></script>
<!-- Remplacer les CDN Lucide par une version locale -->
<script src="/js/lucide.min.js" defer></script>
</head>
<body class="bg-[#FAFAFA] text-gray-900">
<!-- Auth Container -->
@@ -37,13 +37,13 @@
<div class="flex items-center justify-between mb-6">
<h1 class="text-xl font-bold">Notes & Todos</h1>
<button id="new-note-btn" class="p-2 rounded-full hover:bg-gray-100">
<i data-lucide="plus"></i>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
</button>
</div>
<div class="relative mb-4">
<input type="text" id="search-notes" placeholder="Rechercher..."
class="w-full pl-8 pr-3 py-2 border rounded bg-gray-50">
<i data-lucide="search" class="absolute left-2 top-2.5 text-gray-400 w-4 h-4"></i>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="absolute left-2 top-2.5 text-gray-400 w-4 h-4"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>
</div>
<div id="notes-list" class="space-y-2">
<!-- Notes will be dynamically inserted here -->
@@ -56,16 +56,16 @@
<header class="flex justify-between items-center mb-8">
<div class="flex items-center space-x-4">
<button id="archive-note-btn" class="text-gray-600 hover:text-gray-900">
<i data-lucide="archive"></i>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-archive"><polyline points="21 8 21 21 3 21 3 8"></polyline><rect x="1" y="3" width="22" height="5"></rect><line x1="10" y1="12" x2="14" y2="12"></line></svg>
</button>
<button id="delete-note-btn" class="text-gray-600 hover:text-red-600">
<i data-lucide="trash-2"></i>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash-2"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>
</button>
</div>
<div class="flex items-center space-x-4">
<span id="user-info" class="text-sm text-gray-600"></span>
<button id="logout-btn" class="text-gray-600 hover:text-gray-900">
<i data-lucide="log-out"></i>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-out"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg>
</button>
</div>
</header>
@@ -80,7 +80,7 @@
<div class="flex items-center mb-4">
<h3 class="font-medium">Todos</h3>
<button id="add-todo-btn" class="ml-2 p-1 rounded-full hover:bg-gray-100">
<i data-lucide="plus" class="w-4 h-4"></i>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
</button>
</div>
<div id="todos-list" class="space-y-2">
@@ -92,7 +92,7 @@
<div class="flex items-center mb-4">
<h3 class="font-medium">Images</h3>
<label for="image-upload" class="ml-2 p-1 rounded-full hover:bg-gray-100 cursor-pointer">
<i data-lucide="image-plus" class="w-4 h-4"></i>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>
</label>
<input type="file" id="image-upload" class="hidden" accept="image/*">
</div>
@@ -109,7 +109,7 @@
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-bold">Gestion des utilisateurs</h2>
<button id="close-admin-btn" class="text-gray-600 hover:text-gray-900">
<i data-lucide="x"></i>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
</div>
<div class="mb-4">
+3 -4
View File
@@ -40,20 +40,19 @@ class AdminService {
<div class="actions">
${user.id !== 1 ? `
<button class="text-gray-600 hover:text-blue-600" onclick="window.admin.changePassword(${user.id})">
<i data-lucide="key"></i>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"></path></svg>
</button>
<button class="text-gray-600 hover:text-blue-600" onclick="window.admin.toggleAdmin(${user.id}, ${user.is_admin})">
<i data-lucide="shield"></i>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg>
</button>
<button class="text-gray-600 hover:text-red-600" onclick="window.admin.deleteUser(${user.id})">
<i data-lucide="trash-2"></i>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>
</button>
` : ''}
</div>
`;
this.usersList.appendChild(userElement);
});
lucide.createIcons();
}
showAddUserForm() {
+1
View File
@@ -0,0 +1 @@
// Fichier vide pour éviter les erreurs - les icônes sont maintenant directement intégrées en SVG
+2 -7
View File
@@ -32,9 +32,6 @@ class NotesService {
// Auto-save on content changes
this.noteTitle.addEventListener('input', () => this.autoSave());
this.noteContent.addEventListener('input', () => this.autoSave());
// Initialize Lucide icons
lucide.createIcons();
}
async loadNotes() {
@@ -89,7 +86,7 @@ class NotesService {
<input type="checkbox" ${todo.completed ? 'checked' : ''}>
<span>${todo.text}</span>
<button class="ml-auto text-gray-400 hover:text-red-500">
<i data-lucide="x"></i>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
`;
@@ -101,7 +98,6 @@ class NotesService {
this.todosList.appendChild(todoElement);
});
lucide.createIcons();
}
renderImages() {
@@ -112,7 +108,7 @@ class NotesService {
imageElement.innerHTML = `
<img src="/uploads/${image.filename}" alt="Note image">
<button class="delete-btn">
<i data-lucide="x"></i>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
`;
@@ -121,7 +117,6 @@ class NotesService {
this.imagesList.appendChild(imageElement);
});
lucide.createIcons();
}
async createNewNote() {