Actualiser test2.html
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
This commit is contained in:
+12
-2
@@ -35,12 +35,22 @@
|
|||||||
|
|
||||||
// 2. Fonction d'affichage du formulaire
|
// 2. Fonction d'affichage du formulaire
|
||||||
function editCategory() {
|
function editCategory() {
|
||||||
const categories = getRealCategories();
|
|
||||||
const container = document.getElementById('app-container');
|
const container = document.getElementById('app-container');
|
||||||
|
|
||||||
|
// 1. On vérifie si la variable existe vraiment
|
||||||
|
const rawData = typeof CATEGORY_LABELS !== 'undefined' ? CATEGORY_LABELS : {};
|
||||||
|
|
||||||
|
// 2. On transforme les valeurs en tableau
|
||||||
|
const categories = Object.values(rawData);
|
||||||
|
|
||||||
|
// 3. Sécurité : si toujours vide, on alerte
|
||||||
|
if (categories.length === 0) {
|
||||||
|
alert("Erreur : CATEGORY_LABELS est vide ou non chargé.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
container.innerHTML = `
|
container.innerHTML = `
|
||||||
<h3>Changer la catégorie</h3>
|
<h3>Changer la catégorie</h3>
|
||||||
<label>Choix issus d'EverShelf :</label><br>
|
|
||||||
<select id="cat-select" style="width:100%; padding:10px; margin: 10px 0;">
|
<select id="cat-select" style="width:100%; padding:10px; margin: 10px 0;">
|
||||||
${categories.map(c => `<option value="${c}">${c}</option>`).join('')}
|
${categories.map(c => `<option value="${c}">${c}</option>`).join('')}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user