Actualiser test.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:
@@ -33,14 +33,18 @@
|
||||
<script>
|
||||
// 1. Fonction qui affiche le formulaire
|
||||
function mockEditProduct(id) {
|
||||
const categories = ["Fruits", "Légumes", "Boissons", "Épicerie", "Surgelés"];
|
||||
let optionsHTML = categories.map(cat => `<option value="${cat}">${cat}</option>`).join('');
|
||||
// 1. On va chercher les catégories directement dans la mémoire de l'appli.
|
||||
// Si 'categories' n'est pas définie, on prévoit une liste de secours.
|
||||
const appCategories = (typeof categories !== 'undefined') ? categories : ["Fruits", "Légumes", "Boissons", "Épicerie", "Surgelés"];
|
||||
|
||||
// 2. On construit les options dynamiquement
|
||||
let optionsHTML = appCategories.map(cat => `<option value="${cat}">${cat}</option>`).join('');
|
||||
|
||||
const container = document.querySelector('.modal-preview');
|
||||
container.innerHTML = `
|
||||
<h3>Modification du produit #${id}</h3>
|
||||
<form onsubmit="event.preventDefault(); alert('Catégorie ' + document.getElementById('cat-select').value + ' enregistrée !'); location.reload();">
|
||||
<label>Choisir la catégorie :</label><br>
|
||||
<form onsubmit="event.preventDefault(); alert('Catégorie ' + document.getElementById('cat-select').value + ' appliquée !'); location.reload();">
|
||||
<label>Catégories EverShelf :</label><br>
|
||||
<select id="cat-select" style="width:100%; padding:8px; margin: 10px 0;">
|
||||
${optionsHTML}
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user