diff --git a/blog/categories/articles/ajouter_article.html b/blog/articles/ajouter_article/ajouter_article.html
similarity index 60%
rename from blog/categories/articles/ajouter_article.html
rename to blog/articles/ajouter_article/ajouter_article.html
index bd09ca5..18e7bf3 100644
--- a/blog/categories/articles/ajouter_article.html
+++ b/blog/articles/ajouter_article/ajouter_article.html
@@ -23,7 +23,7 @@
Ajouter un article
-
diff --git a/blog/categories/ajouter_categorie.js b/blog/categories/ajouter_categorie/ajouter_categorie.js
similarity index 96%
rename from blog/categories/ajouter_categorie.js
rename to blog/categories/ajouter_categorie/ajouter_categorie.js
index f2045eb..3eedbf4 100644
--- a/blog/categories/ajouter_categorie.js
+++ b/blog/categories/ajouter_categorie/ajouter_categorie.js
@@ -37,6 +37,7 @@ form.addEventListener("submit", function (e) {
//Ajout d'une nouvelle catégorie en BDD
- categoriesExistantes.push(nom);
+ existingCategories.push(nom);
+
});
\ No newline at end of file
diff --git a/blog/categories/liste_categorie/liste_categorie.html b/blog/categories/liste_categorie/liste_categorie.html
new file mode 100644
index 0000000..402532f
--- /dev/null
+++ b/blog/categories/liste_categorie/liste_categorie.html
@@ -0,0 +1,56 @@
+
+
+
+
+
+
Liste des catégories
+
+
+
+
+
+
+
+
+
Liste des catégories
+
+
+
+
+
+
+
+
+
+
+
+ | Nom |
+ Description |
+ Actions |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/blog/categories/liste_categorie/liste_categorie.js b/blog/categories/liste_categorie/liste_categorie.js
new file mode 100644
index 0000000..3a4d2f8
--- /dev/null
+++ b/blog/categories/liste_categorie/liste_categorie.js
@@ -0,0 +1,52 @@
+// Simulation BDD
+let categories = [
+ { id: 1, nom: "Actualités", description: "Infos et nouveautés" },
+ { id: 2, nom: "Chien", description: "Articles liés aux chiens" },
+ { id: 3, nom: "Chat", description: "Conseils pour chats" },
+ { id: 4, nom: "Boutique", description: "Produits et accessoires" }
+];
+
+const tableBody = document.getElementById("categoriesTableBody");
+const successMsg = document.getElementById("successMsg");
+
+// Fonction d'affichage
+function afficherCategories() {
+ tableBody.innerHTML = "";
+
+ categories.forEach((cat, index) => {
+ const row = `
+
+ | ${cat.nom} |
+ ${cat.description || "-"} |
+
+
+
+ Modifier
+
+
+
+ |
+
+ `;
+ tableBody.innerHTML += row;
+ });
+}
+
+afficherCategories();
+
+// Suppression
+function supprimerCategorie(index) {
+ if (confirm("Voulez-vous vraiment supprimer cette catégorie ?")) {
+
+ const nomCat = categories[index].nom;
+
+ categories.splice(index, 1);
+
+ afficherCategories();
+
+ successMsg.textContent = `La catégorie "${nomCat}" a été supprimée avec succès.`;
+ successMsg.classList.remove("d-none");
+ }
+}
diff --git a/blog/categories/modifier_categorie.html b/blog/categories/modifier_categorie/modifier_categorie.html
similarity index 93%
rename from blog/categories/modifier_categorie.html
rename to blog/categories/modifier_categorie/modifier_categorie.html
index 26da894..d27d7d9 100644
--- a/blog/categories/modifier_categorie.html
+++ b/blog/categories/modifier_categorie/modifier_categorie.html
@@ -42,7 +42,7 @@