diff --git a/public/css/Index/index.css b/public/css/Index/index.css index f09f4d3..07138a8 100644 --- a/public/css/Index/index.css +++ b/public/css/Index/index.css @@ -10,7 +10,7 @@ align-items: center; padding: 0 20px; color: white; - font-size: 18px; + font-size: 16px; box-sizing: border-box; /* Inclut le padding dans la largeur totale */ } @@ -57,7 +57,7 @@ li { .btn-custom { background-color: #FFFFFF; color: black; - padding: 15px 40px; + padding: 20px; font-size: 16px; font-weight: bold; cursor: pointer; @@ -88,8 +88,6 @@ li { .Information-perso { display: flex; justify-content: space-between; - padding: 20px; - margin-top: auto; } .btn-info-compte, .btn-info-exit { @@ -104,12 +102,12 @@ li { .btn-info-compte { width: 50%; - height: 30px; + height: 20px; } .btn-info-exit { width: 10%; - height: 30px; + height: 20px; } /* Style pour la modal (cachée par défaut) */ diff --git a/public/js/GestionMenu/GestionMenu.js b/public/js/GestionMenu/GestionMenu.js new file mode 100644 index 0000000..c4c0a8f --- /dev/null +++ b/public/js/GestionMenu/GestionMenu.js @@ -0,0 +1,62 @@ +document.querySelector('.btn-gestion-menu').addEventListener('click', function(event) { + event.preventDefault(); + + document.getElementById('container_modal'); + + fetch('/plats') + .then(response => { + if (!response.ok) { + throw new Error('Erreur de chargement de la section Table'); + } + return response.text(); + }) + .then(html => { + // Insérer le HTML dans le conteneur et l'afficher + container_modal.innerHTML = html; + container_modal.style.display = 'block'; + }) + .catch(error => { + console.error('Erreur:', error); + }); +}); + +function addPlat (event) { + document.getElementById('container_modal'); + + fetch('/plats/new') + .then(response => { + if (!response.ok) { + throw new Error('Erreur de chargement de la section tables'); + } + return response.text(); + }) + .then(html => { + // Insérer le HTML dans le conteneur et l'afficher + container_modal.innerHTML = html; + container_modal.style.display = 'block'; + }) + .catch(error => { + console.error('Erreur:', error); + }); +} + +function editMenu (event) { + document.getElementById('container_modal'); + const IdString = event.getAttribute('data-id'); + let Id = parseInt(IdString); + fetch(`/plats/${Id}/edit`) + .then(response => { + if (!response.ok) { + throw new Error('Erreur de chargement de la section tables'); + } + return response.text(); + }) + .then(html => { + // Insérer le HTML dans le conteneur et l'afficher + container_modal.innerHTML = html; + container_modal.style.display = 'block'; + }) + .catch(error => { + console.error('Erreur:', error); + }); +} diff --git a/templates/index/admin.html.twig b/templates/index/admin.html.twig index b6ee974..7ffdb66 100644 --- a/templates/index/admin.html.twig +++ b/templates/index/admin.html.twig @@ -26,6 +26,17 @@