From a39b76f0af5d8a13eb804122db83c83ab324301f Mon Sep 17 00:00:00 2001 From: Tinka Date: Thu, 21 Nov 2024 17:50:53 +0100 Subject: [PATCH 01/10] fix --- templates/index/cuisinier.html.twig | 144 ---------------------------- templates/index/serveur.html.twig | 144 ---------------------------- 2 files changed, 288 deletions(-) delete mode 100644 templates/index/cuisinier.html.twig delete mode 100644 templates/index/serveur.html.twig diff --git a/templates/index/cuisinier.html.twig b/templates/index/cuisinier.html.twig deleted file mode 100644 index f09ee3f..0000000 --- a/templates/index/cuisinier.html.twig +++ /dev/null @@ -1,144 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block head %} - - - {% block title %}Cuisine{% endblock %} - - - -{% endblock %} - -{% block stylesheets %} - -{% endblock %} - -{% block body %} - - - -
-
- Bonjour, {{ app.user.prenom }} -
-
- Rôle : {{ app.user.getRolesAsString() }} -
-
- - -
- - - -
-
- {{ ux_icon('ph:user-circle-fill') }} - Compte -
- -
-
- -
- -
- - - - - {% include 'Modals/gestionCompteModal.html.twig' %} - -{% endblock %} - -{% block javascripts %} - -{% endblock %} diff --git a/templates/index/serveur.html.twig b/templates/index/serveur.html.twig deleted file mode 100644 index f09ee3f..0000000 --- a/templates/index/serveur.html.twig +++ /dev/null @@ -1,144 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block head %} - - - {% block title %}Cuisine{% endblock %} - - - -{% endblock %} - -{% block stylesheets %} - -{% endblock %} - -{% block body %} - - - -
-
- Bonjour, {{ app.user.prenom }} -
-
- Rôle : {{ app.user.getRolesAsString() }} -
-
- - -
- - - -
-
- {{ ux_icon('ph:user-circle-fill') }} - Compte -
- -
-
- -
- -
- - - - - {% include 'Modals/gestionCompteModal.html.twig' %} - -{% endblock %} - -{% block javascripts %} - -{% endblock %} From 0dd438af9a776c4df329b069e5e3fc852a5579e7 Mon Sep 17 00:00:00 2001 From: Tinka Date: Mon, 24 Mar 2025 14:38:38 +0100 Subject: [PATCH 02/10] Fix affichage index admin --- public/css/Index/index.css | 10 ++--- public/js/GestionMenu/GestionMenu.js | 62 ++++++++++++++++++++++++++++ templates/index/admin.html.twig | 35 +++++++++++----- templates/user/list.html.twig | 2 +- 4 files changed, 91 insertions(+), 18 deletions(-) create mode 100644 public/js/GestionMenu/GestionMenu.js 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 @@
Bonjour, {{ app.user.prenom }}
+
+
+ {{ ux_icon('ph:user-circle-fill') }} + Compte +
+ +
@@ -64,8 +75,21 @@ Voir tendances +
  • +
    + {{ ux_icon('icon-park-outline:view-list') }} + Commandes +
    +
  • +
  • +
    + {{ ux_icon('fluent-mdl2:reservation-orders') }} + Réservation +
    +
  • + {% elseif is_granted('ROLE_CUISINIER') %} {% endif %} -
    -
    - {{ ux_icon('ph:user-circle-fill') }} - Compte -
    - -
    diff --git a/templates/user/list.html.twig b/templates/user/list.html.twig index 0a88997..6cade11 100644 --- a/templates/user/list.html.twig +++ b/templates/user/list.html.twig @@ -84,5 +84,5 @@ {% endblock %} {% block javascripts %} - + {% endblock %} From de58b74eebde17716d428d77fca09b398da5ec09 Mon Sep 17 00:00:00 2001 From: Tinka Date: Mon, 24 Mar 2025 14:50:57 +0100 Subject: [PATCH 03/10] font-family --- public/css/Compte/GestionUser.css | 4 ++++ public/css/Compte/index.css | 4 ++++ public/css/ControllerVues/edit.css | 4 +++- public/css/ControllerVues/list.css | 4 +++- public/css/ControllerVues/new.css | 4 +++- public/css/GestionUtilisateurs/GestionUtilisateurs.css | 3 +++ public/css/Index/index.css | 7 +++++-- 7 files changed, 25 insertions(+), 5 deletions(-) diff --git a/public/css/Compte/GestionUser.css b/public/css/Compte/GestionUser.css index 5fe2b0a..323de72 100644 --- a/public/css/Compte/GestionUser.css +++ b/public/css/Compte/GestionUser.css @@ -1,3 +1,7 @@ +html{ + font-family: "Quicksand Light"; !important; +} + #container_modal { background-color: white; margin-left: 20%; /* Centrage vertical */ diff --git a/public/css/Compte/index.css b/public/css/Compte/index.css index 37dd955..4073693 100644 --- a/public/css/Compte/index.css +++ b/public/css/Compte/index.css @@ -1,3 +1,7 @@ + +html{ + font-family: "Quicksand Light"; !important; +} /* Style pour chaque élément d'information de l'utilisateur */ .user-info-item { display: flex; diff --git a/public/css/ControllerVues/edit.css b/public/css/ControllerVues/edit.css index 0ee0756..f83a288 100644 --- a/public/css/ControllerVues/edit.css +++ b/public/css/ControllerVues/edit.css @@ -1,4 +1,6 @@ - +html{ + font-family: "Quicksand Light"; !important; +} /* Page container */ .page-container { width: 100%; diff --git a/public/css/ControllerVues/list.css b/public/css/ControllerVues/list.css index 37866e5..1c7bb06 100644 --- a/public/css/ControllerVues/list.css +++ b/public/css/ControllerVues/list.css @@ -1,5 +1,7 @@ - +html{ + font-family: "Quicksand Light"; !important; +} /*h1 {*/ /* text-align: center;*/ /* color: #db5559;*/ diff --git a/public/css/ControllerVues/new.css b/public/css/ControllerVues/new.css index 5f888aa..0ce956f 100644 --- a/public/css/ControllerVues/new.css +++ b/public/css/ControllerVues/new.css @@ -1,4 +1,6 @@ - +html{ + font-family: "Quicksand Light"; !important; +} /* Page container */ .page-container { width: 100%; diff --git a/public/css/GestionUtilisateurs/GestionUtilisateurs.css b/public/css/GestionUtilisateurs/GestionUtilisateurs.css index b5957a1..c6c6322 100644 --- a/public/css/GestionUtilisateurs/GestionUtilisateurs.css +++ b/public/css/GestionUtilisateurs/GestionUtilisateurs.css @@ -8,3 +8,6 @@ height: 100%; /* Hauteur du contenu de la modal */ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); } +html{ + font-family: "Quicksand Light"; !important; +} diff --git a/public/css/Index/index.css b/public/css/Index/index.css index 07138a8..7d7c96e 100644 --- a/public/css/Index/index.css +++ b/public/css/Index/index.css @@ -1,3 +1,7 @@ +html{ + font-family: "Quicksand Light"; !important; +} + .top-bar { background-color: #db5559; width: calc(100% - 18%); /*Calcule la totalité de l'écran - le left-background */ @@ -51,7 +55,7 @@ ul { } li { - padding-bottom: 30px; + padding-bottom: 20px; } .btn-custom { @@ -62,7 +66,6 @@ li { font-weight: bold; cursor: pointer; display: inline-block; - border-right: 5px solid #db5559; border-left: 5px solid #db5559; } From f4f64892740126cc1a3c963257653dabc3c9edb2 Mon Sep 17 00:00:00 2001 From: Joshua Date: Mon, 24 Mar 2025 15:54:35 +0100 Subject: [PATCH 04/10] Suppression Modals, rajout et essaie de base.html.twig sur tout les page --- public/js/GestionMenu/GestionMenu.js | 77 ++++++++ templates/base.html.twig | 123 ++++++++++++- templates/index/admin.html.twig | 13 +- templates/plats/index.html.twig | 181 +++++++++++++++---- templates/reductions/index.html.twig | 185 ++++++++++++++++---- templates/tables/index.html.twig | 169 ++++++++++++++---- templates/user/list.html.twig | 86 ++------- templates/user/update.html.twig | 252 +++++++++++++++++++-------- 8 files changed, 843 insertions(+), 243 deletions(-) create mode 100644 public/js/GestionMenu/GestionMenu.js diff --git a/public/js/GestionMenu/GestionMenu.js b/public/js/GestionMenu/GestionMenu.js new file mode 100644 index 0000000..679f140 --- /dev/null +++ b/public/js/GestionMenu/GestionMenu.js @@ -0,0 +1,77 @@ +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 Promotions'); + } + 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 addPlats (event) { + document.getElementById('container_modal'); + + fetch(`/plats/new`) + .then(response => { + 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 updatePromotion (event) { + document.getElementById('container_modal'); + const reductionsIdString = event.getAttribute('data-id'); + let reductionsId = parseInt(reductionsIdString); + + fetch(`/plats/${platsId}/edit`) + .then(response => { + 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 deletePromotion (event) { + document.getElementById('container_modal'); + const reductionsIdString = event.getAttribute('data-id'); + let reductionsId = parseInt(reductionsIdString); + + fetch(`/reductions/${reductionsId}`) + .then(response => { + 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); + }); +} \ No newline at end of file diff --git a/templates/base.html.twig b/templates/base.html.twig index abbbe3c..88ca0eb 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -11,14 +11,135 @@ {# #} {% block stylesheets %} + + + {% endblock %} {% block javascripts %} + + + + + {% block importmap %}{{ importmap('app') }}{% endblock %} {% endblock %} - {% block body %}{% endblock %} + {% block body %} + + + +
    +
    + Bonjour, {{ app.user.prenom }} +
    +
    + + +
    + + {% if is_granted('ROLE_ADMIN') %} + + {% elseif is_granted('ROLE_CUISINIER') %} + + {% elseif is_granted('ROLE_SERVEUR') %} + + {% endif %} + +
    + +
    + +
    + + + + + + {% endblock %} {# bootstrap#} {# #} {# #} diff --git a/templates/index/admin.html.twig b/templates/index/admin.html.twig index b6ee974..8a7f8ef 100644 --- a/templates/index/admin.html.twig +++ b/templates/index/admin.html.twig @@ -36,9 +36,9 @@
    • - {{ ux_icon('grommet-icons:group') }} - Gérer Utilisateur -
      + {{ ux_icon('grommet-icons:group') }} + Gérer Utilisateur +
  • @@ -47,7 +47,7 @@
  • -
    +
    {{ ux_icon('bx:food-menu') }} Gestion Menu
    @@ -106,10 +106,10 @@
    {% endif %}
    - +
    {{ ux_icon('iconamoon:exit-bold') }} @@ -135,4 +135,5 @@ + {% endblock %} \ No newline at end of file diff --git a/templates/plats/index.html.twig b/templates/plats/index.html.twig index d6777bb..0720080 100644 --- a/templates/plats/index.html.twig +++ b/templates/plats/index.html.twig @@ -1,15 +1,118 @@ {% extends 'base.html.twig' %} {% block title %}Plats index{% endblock %} -{% block stylesheets %} - +{% block head %} + + + + + {% endblock %} -{% block body %} -

    Plats index

    - - +{% block body %} + +
    +
    + Bonjour, {{ app.user.prenom }} +
    +
    + + +
    + + {% if is_granted('ROLE_ADMIN') %} + + {% elseif is_granted('ROLE_CUISINIER') %} + + {% elseif is_granted('ROLE_SERVEUR') %} + + {% endif %} + +
    + +
    +

    Plats index

    + +
    + @@ -20,32 +123,44 @@ - - - {% for plat in plats %} - - - - - - - - - - - {% else %} - - - - {% endfor %} - -
    Id NomNb_de_commande actions
    {{ plat.id }}{{ plat.Nom }}{{ plat.Description }}{{ plat.Prix }}{{ plat.Categorie }}{{ plat.Statut ? 'Yes' : 'No' }}{{ plat.NbDeCommande }} -
    - - {{ include('plats/_delete_form.html.twig') }} -
    - Modifier -
    Aucun enregistrement trouvé
    + + + {% for plat in plats %} + + {{ plat.id }} + {{ plat.Nom }} + {{ plat.Description }} + {{ plat.Prix }} + {{ plat.Categorie }} + {{ plat.Statut ? 'Yes' : 'No' }} + {{ plat.NbDeCommande }} + +
    + + {{ include('plats/_delete_form.html.twig') }} +
    + Modifier + + + {% else %} + + Aucun enregistrement trouvé + + {% endfor %} + + + + +
    + + {% block stylesheets %} + + + + + {% endblock %} - Créer un nouveau plat {% endblock %} + + + diff --git a/templates/reductions/index.html.twig b/templates/reductions/index.html.twig index 600d45b..aef0096 100644 --- a/templates/reductions/index.html.twig +++ b/templates/reductions/index.html.twig @@ -1,15 +1,118 @@ {% extends 'base.html.twig' %} -{% block title %}Reductions index{% endblock %} -{% block stylesheets %} - +{% block title %}Promotion index{% endblock %} +{% block head %} + + + + + {% endblock %} -{% block body %} -

    Reductions index

    - - +{% block body %} + +
    +
    + Bonjour, {{ app.user.prenom }} +
    +
    + + +
    + + {% if is_granted('ROLE_ADMIN') %} + + {% elseif is_granted('ROLE_CUISINIER') %} + + {% elseif is_granted('ROLE_SERVEUR') %} + + {% endif %} + +
    + +
    +

    Reductions index

    + +
    + @@ -20,36 +123,44 @@ - - - {% for reduction in reductions %} - - - - - - - - - - - {% else %} - - - - {% endfor %} - -
    Id DescriptionDateFin actions
    {{ reduction.id }}{{ reduction.Description }}{{ reduction.Prix }}{{ reduction.Pourcentage }}{{ reduction.MontantFixe }}{{ reduction.DateDebut ? reduction.DateDebut|date('Y-m-d H:i:s') : '' }}{{ reduction.DateFin ? reduction.DateFin|date('Y-m-d H:i:s') : '' }} -
    - - {{ include('reductions/_delete_form.html.twig') }} -
    - -
    Aucun enregistrement trouvé
    + + + {% for reduction in reductions %} + + {{ reduction.id }} + {{ reduction.Description }} + {{ reduction.Prix }} + {{ reduction.Pourcentage }} + {{ reduction.MontantFixe }} + {{ reduction.DateDebut ? reduction.DateDebut|date('Y-m-d H:i:s') : '' }} + {{ reduction.DateFin ? reduction.DateFin|date('Y-m-d H:i:s') : '' }} + +
    + + {{ include('reductions/_delete_form.html.twig') }} +
    + + + + {% else %} + + Aucun enregistrement trouvé + + {% endfor %} + + + + +
    + + {% block stylesheets %} + + + + + {% endblock %} - {% endblock %} -{% block javascripts %} - -{% endblock %} \ No newline at end of file + + diff --git a/templates/tables/index.html.twig b/templates/tables/index.html.twig index 84979b9..d0d5b07 100644 --- a/templates/tables/index.html.twig +++ b/templates/tables/index.html.twig @@ -1,43 +1,152 @@ {% extends 'base.html.twig' %} {% block title %}Tables index{% endblock %} -{% block stylesheets %} - +{% block head %} + + + + + {% endblock %} -{% block body %} -

    Tables index

    - - +{% block body %} + +
    +
    + Bonjour, {{ app.user.prenom }} +
    +
    + + +
    + + {% if is_granted('ROLE_ADMIN') %} + + {% elseif is_granted('ROLE_CUISINIER') %} + + {% elseif is_granted('ROLE_SERVEUR') %} + + {% endif %} + +
    + +
    +

    Tables index

    + +
    + - - - {% for table in tables %} - - - - - {% else %} - - - - {% endfor %} - -
    Id actions
    {{ table.id }} -
    - - {{ include('tables/_delete_form.html.twig') }} -
    - Modifier -
    Aucun enregistrement trouvé
    + + + {% for table in tables %} + + {{ table.id }} + +
    + + {{ include('tables/_delete_form.html.twig') }} +
    + Modifier + + + {% else %} + + Aucun enregistrement trouvé + + {% endfor %} + + + + + + + {% block stylesheets %} + + + + + {% endblock %} - {% endblock %} -{% block javascripts %} - -{% endblock %} diff --git a/templates/user/list.html.twig b/templates/user/list.html.twig index 0a88997..9c16bcd 100644 --- a/templates/user/list.html.twig +++ b/templates/user/list.html.twig @@ -1,74 +1,34 @@ {% extends 'base.html.twig' %} -{% block title %}Liste Utilisateur{% endblock %} +{% block title %}Liste des Utilisateurs{% endblock %} -{% block body %} - - -
    -

    Liste des Utilisateurs ! ✅

    - - +{% block container_modal %} +

    Liste des utilisateurs

    +
    - - - + + + - {% for utilisateur in utilisateurs %} + {% for user in users %} - - - - - + + + + + {% else %} @@ -77,12 +37,4 @@ {% endfor %}
    ID NomPrenomMailRolesEmailRôleActions
    {{ utilisateur.id }}{{ utilisateur.nom }}{{ utilisateur.prenom }}{{ utilisateur.UserIdentifier }}{{ utilisateur.RolesAsString }}{{ user.id }}{{ user.nom }}{{ user.email }}{{ user.roles|join(', ') }} + Modifier + Supprimer +
    -
    - -
    -
    -{% endblock %} - -{% block javascripts %} - {% endblock %} diff --git a/templates/user/update.html.twig b/templates/user/update.html.twig index df18571..92e4dfe 100644 --- a/templates/user/update.html.twig +++ b/templates/user/update.html.twig @@ -1,77 +1,114 @@ {% extends 'base.html.twig' %} -{% block stylesheets %} - -{% endblock %} - {% block title %}Nouvelle Utilisateur{% endblock %} +{% block head %} + + + + + +{% endblock %} + {% block body %} -
    + +
    +
    + Bonjour, {{ app.user.prenom }} +
    +
    + + +
    + + {% if is_granted('ROLE_ADMIN') %} + + {% elseif is_granted('ROLE_CUISINIER') %} + + {% elseif is_granted('ROLE_SERVEUR') %} + + {% endif %} + +
    + +

    Modifier Utilisateurs ! ✅

    {{ form_start(form) }} @@ -102,4 +139,81 @@ Annuler
    + + {% block stylesheets %} + + + + + + + {% endblock %} + {% endblock %} + + + From f1312c59d6278be01238773e0342f8311c843f00 Mon Sep 17 00:00:00 2001 From: bethoulevj Date: Mon, 24 Mar 2025 17:47:25 +0100 Subject: [PATCH 05/10] Suppresion des modals --- public/css/ControllerVues/list.css | 42 ++-- templates/base.html.twig | 163 ++------------ templates/plats/edit.html.twig | 138 +++++++++++- templates/plats/index.html.twig | 2 +- templates/plats/new.html.twig | 125 ++++++++++- templates/reductions/edit.html.twig | 138 +++++++++++- templates/reductions/index.html.twig | 4 +- templates/reductions/new.html.twig | 126 ++++++++++- templates/tables/edit.html.twig | 136 +++++++++++- templates/tables/index.html.twig | 2 +- templates/tables/new.html.twig | 135 ++++++++++-- templates/user/add.html.twig | 310 ++++++++++++++++++--------- templates/user/list.html.twig | 186 +++++++++++++--- 13 files changed, 1160 insertions(+), 347 deletions(-) diff --git a/public/css/ControllerVues/list.css b/public/css/ControllerVues/list.css index 37866e5..3d5af65 100644 --- a/public/css/ControllerVues/list.css +++ b/public/css/ControllerVues/list.css @@ -1,36 +1,29 @@ - - -/*h1 {*/ -/* text-align: center;*/ -/* color: #db5559;*/ -/* margin-bottom: 20px;*/ -/*}*/ - /* Table styles */ -.table { +table { width: 100%; border-collapse: collapse; margin-bottom: 20px; background-color: #fff; - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + font-family: sans-serif; } -.table th, .table td { +table th, table td { padding: 12px; text-align: left; border: 1px solid #ddd; } -.table th { +table th { background-color: #db5559; color: white; + font-weight: bold; } -.table tr:nth-child(even) { +table tr:nth-child(even) { background-color: #f2f2f2; } -.table tr:hover { +table tr:hover { background-color: #ddd; } @@ -42,7 +35,7 @@ a { } a:hover { - color: #38538e; + color: white; text-decoration: underline; } @@ -64,8 +57,25 @@ a[href*="app_clients_new"]:hover { } /* Empty table row message */ -.table td[colspan="6"] { +table td[colspan="6"] { text-align: center; font-style: italic; color: #666; } + +/* Button styles */ +.btn-container { + display: flex; + justify-content: center; + margin-bottom: 20px; +} + +.btn { + padding: 5px 10px; + text-decoration: none; + color: white; + background-color: #db5559; + border-radius: 5px; + font-weight: bold; + margin-top: 25px; +} diff --git a/templates/base.html.twig b/templates/base.html.twig index 88ca0eb..3d4015e 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -1,147 +1,26 @@ - - - {% block title %}Welcome!{% endblock %} - - - - + + + {% block title %}Welcome!{% endblock %} + + + + + {# bootstrap#} + {# #} + + {% block stylesheets %} + {% endblock %} + + {% block javascripts %} + {% block importmap %}{{ importmap('app') }}{% endblock %} + {% endblock %} + + +{% block body %}{% endblock %} {# bootstrap#} -{# #} - - {% block stylesheets %} - - - - {% endblock %} - - {% block javascripts %} - - - - - - {% block importmap %}{{ importmap('app') }}{% endblock %} - {% endblock %} - - - {% block body %} - - - -
    -
    - Bonjour, {{ app.user.prenom }} -
    -
    - - -
    - - {% if is_granted('ROLE_ADMIN') %} - - {% elseif is_granted('ROLE_CUISINIER') %} - - {% elseif is_granted('ROLE_SERVEUR') %} - - {% endif %} - -
    - -
    - -
    - - - - - - {% endblock %} -{# bootstrap#} - {# #} +{# #} {# #} - + diff --git a/templates/plats/edit.html.twig b/templates/plats/edit.html.twig index b763493..f3b6c7b 100644 --- a/templates/plats/edit.html.twig +++ b/templates/plats/edit.html.twig @@ -2,20 +2,136 @@ {% block title %}Modifier Plat{% endblock %} -{% block stylesheets %} - +{% block head %} + + + + + {% endblock %} {% block body %} -
    -

    Modifier Plat

    - - {{ include('plats/_form.html.twig', {'button_label': 'Mettre à jour'}) }} - -
    - Retour à la liste + +
    +
    + Bonjour, {{ app.user.prenom }}
    - - {{ include('plats/_delete_form.html.twig') }}
    + + +
    + + {% if is_granted('ROLE_ADMIN') %} + + {% elseif is_granted('ROLE_CUISINIER') %} + + {% elseif is_granted('ROLE_SERVEUR') %} + + {% endif %} + +
    + +
    +
    +

    Modifier Plat

    + + {{ include('plats/_form.html.twig', {'button_label': 'Mettre à jour'}) }} + + + + {{ include('plats/_delete_form.html.twig') }} +
    +
    + + {% block stylesheets %} + + + + + + {% endblock %} + {% endblock %} + + + + diff --git a/templates/plats/index.html.twig b/templates/plats/index.html.twig index 0720080..e0cfa38 100644 --- a/templates/plats/index.html.twig +++ b/templates/plats/index.html.twig @@ -150,7 +150,7 @@ - + Créer un menu
    {% block stylesheets %} diff --git a/templates/plats/new.html.twig b/templates/plats/new.html.twig index 7c091ad..6a6e2ff 100644 --- a/templates/plats/new.html.twig +++ b/templates/plats/new.html.twig @@ -1,14 +1,129 @@ {% extends 'base.html.twig' %} {% block title %}New Plats{% endblock %} -{% block stylesheets %} - +{% block head %} + + + + + {% endblock %} + {% block body %} -

    Créer un nouveau plat

    + +
    +
    + Bonjour, {{ app.user.prenom }} +
    +
    - {{ include('plats/_form.html.twig') }} + +
    + + {% if is_granted('ROLE_ADMIN') %} + + {% elseif is_granted('ROLE_CUISINIER') %} + + {% elseif is_granted('ROLE_SERVEUR') %} + + {% endif %} + +
    + +
    +

    Créer un nouveau plat

    + + {{ include('plats/_form.html.twig') }} + + Retour à la liste +
    + + {% block stylesheets %} + + + + + {% endblock %} - Retour à la liste {% endblock %} + + + diff --git a/templates/reductions/edit.html.twig b/templates/reductions/edit.html.twig index bab0c4d..10adb6f 100644 --- a/templates/reductions/edit.html.twig +++ b/templates/reductions/edit.html.twig @@ -2,20 +2,136 @@ {% block title %}Modifier Réductions{% endblock %} -{% block stylesheets %} - +{% block head %} + + + + + {% endblock %} {% block body %} -
    -

    Modifier une réduction

    - - {{ include('reductions/_form.html.twig', {'button_label': 'Mettre à jour'}) }} - -
    - Retour à la liste + +
    +
    + Bonjour, {{ app.user.prenom }}
    - - {{ include('reductions/_delete_form.html.twig') }}
    + + +
    + + {% if is_granted('ROLE_ADMIN') %} + + {% elseif is_granted('ROLE_CUISINIER') %} + + {% elseif is_granted('ROLE_SERVEUR') %} + + {% endif %} + +
    + +
    +
    +

    Modifier une réduction

    + + {{ include('reductions/_form.html.twig', {'button_label': 'Mettre à jour'}) }} + + + + {{ include('reductions/_delete_form.html.twig') }} +
    +
    + + {% block stylesheets %} + + + + + + {% endblock %} + {% endblock %} + + + + diff --git a/templates/reductions/index.html.twig b/templates/reductions/index.html.twig index aef0096..79a4ccb 100644 --- a/templates/reductions/index.html.twig +++ b/templates/reductions/index.html.twig @@ -139,7 +139,7 @@ {{ include('reductions/_delete_form.html.twig') }} - + Modifier {% else %} @@ -150,7 +150,7 @@ - + Créer une réduction
    {% block stylesheets %} diff --git a/templates/reductions/new.html.twig b/templates/reductions/new.html.twig index 13723a3..1279336 100644 --- a/templates/reductions/new.html.twig +++ b/templates/reductions/new.html.twig @@ -1,14 +1,130 @@ {% extends 'base.html.twig' %} {% block title %}Nouvelle reduction{% endblock %} -{% block stylesheets %} - +{% block head %} + + + + + {% endblock %} + {% block body %} -

    Créer une Reduction

    + +
    +
    + Bonjour, {{ app.user.prenom }} +
    +
    - {{ include('reductions/_form.html.twig') }} + +
    + + {% if is_granted('ROLE_ADMIN') %} + + {% elseif is_granted('ROLE_CUISINIER') %} + + {% elseif is_granted('ROLE_SERVEUR') %} + + {% endif %} + +
    + +
    +

    Créer une Reduction

    + + {{ include('reductions/_form.html.twig') }} + + Retour à la liste +
    + + {% block stylesheets %} + + + + + {% endblock %} - Retour à la liste {% endblock %} + + + + diff --git a/templates/tables/edit.html.twig b/templates/tables/edit.html.twig index 6447b90..93c11c2 100644 --- a/templates/tables/edit.html.twig +++ b/templates/tables/edit.html.twig @@ -2,20 +2,134 @@ {% block title %}Edit Tables{% endblock %} -{% block stylesheets %} - +{% block head %} + + + + + {% endblock %} {% block body %} -
    -

    Modifier Tables

    - - {{ include('tables/_form.html.twig', {'button_label': 'Mettre à jour'}) }} - -
    - Retour à la liste + +
    +
    + Bonjour, {{ app.user.prenom }}
    - - {{ include('tables/_delete_form.html.twig') }}
    + + +
    + + {% if is_granted('ROLE_ADMIN') %} + + {% elseif is_granted('ROLE_CUISINIER') %} + + {% elseif is_granted('ROLE_SERVEUR') %} + + {% endif %} + +
    + +
    +
    +

    Modifier Tables

    + + {{ include('tables/_form.html.twig', {'button_label': 'Mettre à jour'}) }} + + + + {{ include('tables/_delete_form.html.twig') }} +
    +
    + + {% block stylesheets %} + + + + + + {% endblock %} + {% endblock %} + + diff --git a/templates/tables/index.html.twig b/templates/tables/index.html.twig index d0d5b07..a973bf3 100644 --- a/templates/tables/index.html.twig +++ b/templates/tables/index.html.twig @@ -138,7 +138,7 @@ - + Créer une tables
    {% block stylesheets %} diff --git a/templates/tables/new.html.twig b/templates/tables/new.html.twig index c3f5994..f81ede4 100644 --- a/templates/tables/new.html.twig +++ b/templates/tables/new.html.twig @@ -2,21 +2,132 @@ {% block title %}Create New Table{% endblock %} -{% block stylesheets %} - - +{% block head %} + + + + + {% endblock %} {% block body %} -
    -

    Créer une nouvelle Table

    - -
    - {{ include('tables/_form.html.twig') }} -
    - -
  • +
  • +
    + {{ ux_icon('icon-park-outline:view-list') }} + Commandes +
    +
  • +
  • +
    + {{ ux_icon('fluent-mdl2:reservation-orders') }} + Réservation +
    +
  • {% elseif is_granted('ROLE_CUISINIER') %} @@ -117,17 +140,6 @@ {% endif %} - {% block container_modal %} From bb35ba61c67191739e8740cfa1a506634f09cd26 Mon Sep 17 00:00:00 2001 From: Tinka Date: Mon, 31 Mar 2025 14:09:40 +0200 Subject: [PATCH 09/10] admin page commande + reservation fix form client --- public/css/Index/index.css | 2 +- src/Form/ClientsType.php | 7 +-- templates/base.html.twig | 20 +++--- templates/clients/edit.html.twig | 21 ++++++- templates/clients/index.html.twig | 20 +++++- templates/clients/new.html.twig | 23 +++++-- templates/commandes/edit.html.twig | 25 ++++++-- templates/commandes/index.html.twig | 86 +++++++++++++++----------- templates/commandes/new.html.twig | 22 +++++-- templates/reservations/edit.html.twig | 22 +++++-- templates/reservations/index.html.twig | 18 +++++- templates/reservations/new.html.twig | 23 +++++-- 12 files changed, 214 insertions(+), 75 deletions(-) diff --git a/public/css/Index/index.css b/public/css/Index/index.css index c081efb..7b2c784 100644 --- a/public/css/Index/index.css +++ b/public/css/Index/index.css @@ -43,7 +43,7 @@ ul { } li { - padding-bottom: 30px; + padding-bottom: 20px; } .btn-custom { diff --git a/src/Form/ClientsType.php b/src/Form/ClientsType.php index cd01f5a..4444b85 100644 --- a/src/Form/ClientsType.php +++ b/src/Form/ClientsType.php @@ -23,12 +23,9 @@ class ClientsType extends AbstractType 'class' => Tables::class, 'choice_label' => 'id', 'multiple' => true, + 'expanded' => true, ]) - ->add('Commandes', EntityType::class, [ - 'class' => Commandes::class, - 'choice_label' => 'id', - 'multiple' => true, - ]) + ; } diff --git a/templates/base.html.twig b/templates/base.html.twig index 619a007..baf9c01 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -63,6 +63,12 @@ Gérer Utilisateur +
  • + + {{ ux_icon('icon-park-outline:people') }} + Gestion Client + +
  • {{ ux_icon('ic:outline-table-bar') }} @@ -82,22 +88,22 @@
  • - +
  • - +
  • - +
  • @@ -144,7 +150,7 @@ {% block container_modal %}
    - +
    {% endblock %} diff --git a/templates/clients/edit.html.twig b/templates/clients/edit.html.twig index bea3e03..1a6a7f1 100644 --- a/templates/clients/edit.html.twig +++ b/templates/clients/edit.html.twig @@ -2,7 +2,25 @@ {% block title %}Modifier Client{% endblock %} -{% block body %} +{% block head %} + + + + + +{% endblock %} + +{% block stylesheets %} + + + + + +{% endblock %} + +{% block container_modal %} + +

    Modifier Client

    {{ include('clients/_form.html.twig', {'button_label': 'Mettre à jour'}) }} @@ -10,4 +28,5 @@ Retour à la liste {{ include('clients/_delete_form.html.twig') }} +
    {% endblock %} diff --git a/templates/clients/index.html.twig b/templates/clients/index.html.twig index 9eeb216..e78988b 100644 --- a/templates/clients/index.html.twig +++ b/templates/clients/index.html.twig @@ -1,11 +1,24 @@ {% extends 'base.html.twig' %} -{% block title %}Clients index{% endblock %} +{% block title %}Client index{% endblock %} + +{% block head %} + + + + + +{% endblock %} + {% block stylesheets %} - + + + {% endblock %} -{% block body %} + +{% block container_modal %} +

    Clients index

    @@ -44,4 +57,5 @@
    Créer un nouveau client +
    {% endblock %} diff --git a/templates/clients/new.html.twig b/templates/clients/new.html.twig index 16b0079..cd1332f 100644 --- a/templates/clients/new.html.twig +++ b/templates/clients/new.html.twig @@ -1,14 +1,29 @@ {% extends 'base.html.twig' %} -{% block title %}Nouveau client{% endblock %} -{% block stylesheets %} - +{% block title %}Tables index{% endblock %} +{% block head %} + + + + + {% endblock %} -{% block body %} + +{% block stylesheets %} + + + + +{% endblock %} + +{% block container_modal %} + +

    Créer un client

    {{ include('clients/_form.html.twig') }} Retour à la liste +
    {% endblock %} diff --git a/templates/commandes/edit.html.twig b/templates/commandes/edit.html.twig index 104ce92..df76840 100644 --- a/templates/commandes/edit.html.twig +++ b/templates/commandes/edit.html.twig @@ -1,13 +1,30 @@ {% extends 'base.html.twig' %} -{% block title %}Modifier Commande{% endblock %} +{% block title %}Tables index{% endblock %} -{% block body %} +{% block head %} + + + + + +{% endblock %} + +{% block stylesheets %} + + + + + +{% endblock %} + +{% block container_modal %} + +

    Modifier Commande

    {{ include('commandes/_form.html.twig', {'button_label': 'Mettre à jour'}) }} Retour à la liste - - +
    {% endblock %} diff --git a/templates/commandes/index.html.twig b/templates/commandes/index.html.twig index 38ce9b9..f3ffffa 100644 --- a/templates/commandes/index.html.twig +++ b/templates/commandes/index.html.twig @@ -1,46 +1,60 @@ {% extends 'base.html.twig' %} {% block title %}Commandes index{% endblock %} + +{% block head %} + + + + + +{% endblock %} + {% block stylesheets %} - + + + {% endblock %} -{% block body %} -

    Commandes index

    - - - - - - - - - - - - {% for commande in commandes %} - - - - - - - - {% else %} - - - - {% endfor %} - -
    IdDateHeureStatutTotalactions
    {{ commande.id }}{{ commande.DateHeure ? commande.DateHeure|date('Y-m-d H:i:s') : '' }}{{ commande.Statut ? 'Yes' : 'No' }}{{ commande.Total }} -
    - - {{ include('commandes/_delete_form.html.twig') }} -
    +{% block container_modal %} +
    +

    Commandes index

    - Modifier -
    pas de commande crée
    + + + + + + + + + + + + {% for commande in commandes %} + + + + + + + + {% else %} + + + + {% endfor %} + +
    IdDateHeureStatutTotalactions
    {{ commande.id }}{{ commande.DateHeure ? commande.DateHeure|date('Y-m-d H:i:s') : '' }}{{ commande.Statut ? 'Yes' : 'No' }}{{ commande.Total }} +
    + + {{ include('commandes/_delete_form.html.twig') }} +
    - Créer une nouvelle commande + Modifier +
    pas de commande crée
    + + Créer une nouvelle commande + {% endblock %} diff --git a/templates/commandes/new.html.twig b/templates/commandes/new.html.twig index fb9b259..0104be5 100644 --- a/templates/commandes/new.html.twig +++ b/templates/commandes/new.html.twig @@ -1,15 +1,29 @@ {% extends 'base.html.twig' %} -{% block title %}Nouvelle commande{% endblock %} -{% block stylesheets %} - +{% block title %}Tables index{% endblock %} +{% block head %} + + + + + {% endblock %} -{% block body %} +{% block stylesheets %} + + + + +{% endblock %} + +{% block container_modal %} + +

    Créer une commande

    {{ include('commandes/_form.html.twig') }} Retour à la liste +
    {% endblock %} diff --git a/templates/reservations/edit.html.twig b/templates/reservations/edit.html.twig index 320a151..1483f13 100644 --- a/templates/reservations/edit.html.twig +++ b/templates/reservations/edit.html.twig @@ -1,12 +1,25 @@ {% extends 'base.html.twig' %} -{% block title %}Modifier Réservation{% endblock %} +{% block title %}Tables index{% endblock %} -{% block stylesheets %} - +{% block head %} + + + + + {% endblock %} -{% block body %} +{% block stylesheets %} + + + + + +{% endblock %} + +{% block container_modal %} +

    Modifier Réservation

    @@ -18,4 +31,5 @@ {{ include('reservations/_delete_form.html.twig') }}
    +
    {% endblock %} diff --git a/templates/reservations/index.html.twig b/templates/reservations/index.html.twig index c2be21a..b0ac723 100644 --- a/templates/reservations/index.html.twig +++ b/templates/reservations/index.html.twig @@ -1,11 +1,24 @@ {% extends 'base.html.twig' %} {% block title %}Reservations index{% endblock %} + +{% block head %} + + + + + +{% endblock %} + {% block stylesheets %} - + + + {% endblock %} -{% block body %} + +{% block container_modal %} +

    Reservations index

    @@ -40,4 +53,5 @@
    Créer une réservation +
    {% endblock %} diff --git a/templates/reservations/new.html.twig b/templates/reservations/new.html.twig index f33c62a..3a8a5b7 100644 --- a/templates/reservations/new.html.twig +++ b/templates/reservations/new.html.twig @@ -1,14 +1,29 @@ {% extends 'base.html.twig' %} -{% block title %}New Reservations{% endblock %} -{% block stylesheets %} - +{% block title %}Tables index{% endblock %} +{% block head %} + + + + + {% endblock %} -{% block body %} + +{% block stylesheets %} + + + + + +{% endblock %} + +{% block container_modal %} +

    Créer une reservation

    {{ include('reservations/_form.html.twig') }} Retour à la liste +
    {% endblock %} From eba77e220de2bd5af315e75136748f33cb855e41 Mon Sep 17 00:00:00 2001 From: Tinka Date: Mon, 31 Mar 2025 14:32:31 +0200 Subject: [PATCH 10/10] fix form avec expanded --- src/Form/CommandesType.php | 4 +++- src/Form/ReservationsType.php | 1 + src/Form/TablesType.php | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Form/CommandesType.php b/src/Form/CommandesType.php index 5dcc39b..d079017 100644 --- a/src/Form/CommandesType.php +++ b/src/Form/CommandesType.php @@ -25,15 +25,17 @@ class CommandesType extends AbstractType 'class' => Clients::class, 'choice_label' => 'id', 'multiple' => true, + 'expanded' => true, ]) ->add('plats', EntityType::class, [ 'class' => Plats::class, 'choice_label' => 'id', 'multiple' => true, + 'expanded' => true, ]) ->add('StatutCommande', EntityType::class, [ 'class' => StatutCommandes::class, - 'choice_label' => 'id', + 'choice_label' => 'libelle', ]) ; } diff --git a/src/Form/ReservationsType.php b/src/Form/ReservationsType.php index 8a59b2b..d6b4e99 100644 --- a/src/Form/ReservationsType.php +++ b/src/Form/ReservationsType.php @@ -27,6 +27,7 @@ class ReservationsType extends AbstractType 'class' => Utilisateurs::class, 'choice_label' => 'id', 'multiple' => true, + 'expanded' => true, ]) ; } diff --git a/src/Form/TablesType.php b/src/Form/TablesType.php index ff62602..f4a3d05 100644 --- a/src/Form/TablesType.php +++ b/src/Form/TablesType.php @@ -19,11 +19,13 @@ class TablesType extends AbstractType 'class' => Clients::class, 'choice_label' => 'id', 'multiple' => true, + 'expanded' => true, ]) ->add('utilisateurs', EntityType::class, [ 'class' => Utilisateurs::class, 'choice_label' => 'id', 'multiple' => true, + 'expanded' => true, ]) ; }