Fix affichage index admin

This commit is contained in:
Tinka 2025-03-24 14:38:38 +01:00
parent 89fb69f680
commit 0dd438af9a
4 changed files with 91 additions and 18 deletions

View File

@ -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) */

View File

@ -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);
});
}

View File

@ -26,6 +26,17 @@
<div>
Bonjour, {{ app.user.prenom }}
</div>
<div class="Information-perso">
<div class="btn-info-compte icon-container">
<i class="icon-medium"> {{ ux_icon('ph:user-circle-fill') }}</i>
<span>Compte</span>
</div>
<div class="btn-info-exit icon-container">
<a href="{{ path('app_logout') }}" class="icon-medium">
{{ ux_icon('iconamoon:exit-bold') }}
</a>
</div>
</div>
</div>
<!-- Left Menu -->
@ -64,8 +75,21 @@
<span>Voir tendances</span>
</div>
</li>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('icon-park-outline:view-list') }}</i>
<span>Commandes</span>
</div>
</li>
<li>
<div class="btn-custom icon-container">
<i class="icon-medium"> {{ ux_icon('fluent-mdl2:reservation-orders') }}</i>
<span>Réservation</span>
</div>
</li>
</ul>
</div>
{% elseif is_granted('ROLE_CUISINIER') %}
<div class="nav-bar">
<ul>
@ -105,17 +129,6 @@
</ul>
</div>
{% endif %}
<div class="Information-perso">
<div class="btn-info-compte icon-container">
<i class="icon-medium"> {{ ux_icon('ph:user-circle-fill') }}</i>
<span>Compte</span>
</div>
<div class="btn-info-exit icon-container">
<a href="{{ path('app_logout') }}" class="icon-medium">
{{ ux_icon('iconamoon:exit-bold') }}
</a>
</div>
</div>
</div>
<div id="container_modal">

View File

@ -84,5 +84,5 @@
{% endblock %}
{% block javascripts %}
<script src="{{ asset('js/GestionUtilisateurs/GestionUtilisateurs.js') }}" defer></script>
<script src="{{ asset('js/GestionUtilisateurs/GestionMenu.js') }}" defer></script>
{% endblock %}