Compare commits
No commits in common. "cbc2d65041fed8c414893b9285b78be654cacb79" and "b51a75285a4780ae003d932837d543c2741a7537" have entirely different histories.
cbc2d65041
...
b51a75285a
360
composer.lock
generated
360
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -31,14 +31,12 @@ security:
|
||||
|
||||
role_hierarchy:
|
||||
ROLE_SUPER_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
|
||||
ROLE_CUISINIER: ROLE_CUISINIER
|
||||
ROLE_SERVEUR: ROLE_SERVEUR
|
||||
|
||||
access_control:
|
||||
# - { path: ^/, roles: ROLE_USER }
|
||||
- { path: ^/login, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/logout, roles: ROLE_USER }
|
||||
- { path: ^/index, roles: [ROLE_ADMIN, ROLE_CUISINIER, ROLE_SERVEUR]}
|
||||
- { path: ^/index, roles: ROLE_ADMIN }
|
||||
- { path: ^/user, roles: ROLE_ADMIN }
|
||||
|
||||
#when@test:
|
||||
|
@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20241114160014 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE reservations DROP CONSTRAINT fk_4da2394de1870d');
|
||||
$this->addSql('DROP INDEX idx_4da2394de1870d');
|
||||
$this->addSql('ALTER TABLE reservations RENAME COLUMN tabl_id TO table_id');
|
||||
$this->addSql('ALTER TABLE reservations ADD CONSTRAINT FK_4DA239ECFF285C FOREIGN KEY (table_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX IDX_4DA239ECFF285C ON reservations (table_id)');
|
||||
$this->addSql('ALTER TABLE statut_tables DROP CONSTRAINT fk_33c8a3754de1870d');
|
||||
$this->addSql('DROP INDEX idx_33c8a3754de1870d');
|
||||
$this->addSql('ALTER TABLE statut_tables RENAME COLUMN tabl_id TO table_id');
|
||||
$this->addSql('ALTER TABLE statut_tables ADD CONSTRAINT FK_33C8A375ECFF285C FOREIGN KEY (table_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX IDX_33C8A375ECFF285C ON statut_tables (table_id)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_497B315E5126AC48 ON utilisateurs (mail)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE SCHEMA public');
|
||||
$this->addSql('DROP INDEX UNIQ_497B315E5126AC48');
|
||||
$this->addSql('ALTER TABLE statut_tables DROP CONSTRAINT FK_33C8A375ECFF285C');
|
||||
$this->addSql('DROP INDEX IDX_33C8A375ECFF285C');
|
||||
$this->addSql('ALTER TABLE statut_tables RENAME COLUMN table_id TO tabl_id');
|
||||
$this->addSql('ALTER TABLE statut_tables ADD CONSTRAINT fk_33c8a3754de1870d FOREIGN KEY (tabl_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX idx_33c8a3754de1870d ON statut_tables (tabl_id)');
|
||||
$this->addSql('ALTER TABLE reservations DROP CONSTRAINT FK_4DA239ECFF285C');
|
||||
$this->addSql('DROP INDEX IDX_4DA239ECFF285C');
|
||||
$this->addSql('ALTER TABLE reservations RENAME COLUMN table_id TO tabl_id');
|
||||
$this->addSql('ALTER TABLE reservations ADD CONSTRAINT fk_4da2394de1870d FOREIGN KEY (tabl_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX idx_4da2394de1870d ON reservations (tabl_id)');
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20241114160729 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE reservations DROP CONSTRAINT fk_4da239ecff285c');
|
||||
$this->addSql('DROP INDEX idx_4da239ecff285c');
|
||||
$this->addSql('ALTER TABLE reservations RENAME COLUMN table_id TO tables_id');
|
||||
$this->addSql('ALTER TABLE reservations ADD CONSTRAINT FK_4DA23985405FD2 FOREIGN KEY (tables_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX IDX_4DA23985405FD2 ON reservations (tables_id)');
|
||||
$this->addSql('ALTER TABLE statut_tables DROP CONSTRAINT fk_33c8a375ecff285c');
|
||||
$this->addSql('DROP INDEX idx_33c8a375ecff285c');
|
||||
$this->addSql('ALTER TABLE statut_tables RENAME COLUMN table_id TO tables_id');
|
||||
$this->addSql('ALTER TABLE statut_tables ADD CONSTRAINT FK_33C8A37585405FD2 FOREIGN KEY (tables_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX IDX_33C8A37585405FD2 ON statut_tables (tables_id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE SCHEMA public');
|
||||
$this->addSql('ALTER TABLE statut_tables DROP CONSTRAINT FK_33C8A37585405FD2');
|
||||
$this->addSql('DROP INDEX IDX_33C8A37585405FD2');
|
||||
$this->addSql('ALTER TABLE statut_tables RENAME COLUMN tables_id TO table_id');
|
||||
$this->addSql('ALTER TABLE statut_tables ADD CONSTRAINT fk_33c8a375ecff285c FOREIGN KEY (table_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX idx_33c8a375ecff285c ON statut_tables (table_id)');
|
||||
$this->addSql('ALTER TABLE reservations DROP CONSTRAINT FK_4DA23985405FD2');
|
||||
$this->addSql('DROP INDEX IDX_4DA23985405FD2');
|
||||
$this->addSql('ALTER TABLE reservations RENAME COLUMN tables_id TO table_id');
|
||||
$this->addSql('ALTER TABLE reservations ADD CONSTRAINT fk_4da239ecff285c FOREIGN KEY (table_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX idx_4da239ecff285c ON reservations (table_id)');
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20241114164216 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE TABLE tables_clients (tables_id INT NOT NULL, clients_id INT NOT NULL, PRIMARY KEY(tables_id, clients_id))');
|
||||
$this->addSql('CREATE INDEX IDX_80F8906E85405FD2 ON tables_clients (tables_id)');
|
||||
$this->addSql('CREATE INDEX IDX_80F8906EAB014612 ON tables_clients (clients_id)');
|
||||
$this->addSql('ALTER TABLE tables_clients ADD CONSTRAINT FK_80F8906E85405FD2 FOREIGN KEY (tables_id) REFERENCES tables (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE tables_clients ADD CONSTRAINT FK_80F8906EAB014612 FOREIGN KEY (clients_id) REFERENCES clients (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE clients_tables DROP CONSTRAINT fk_8190d6c6ab014612');
|
||||
$this->addSql('ALTER TABLE clients_tables DROP CONSTRAINT fk_8190d6c685405fd2');
|
||||
$this->addSql('DROP TABLE clients_tables');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE SCHEMA public');
|
||||
$this->addSql('CREATE TABLE clients_tables (clients_id INT NOT NULL, tables_id INT NOT NULL, PRIMARY KEY(clients_id, tables_id))');
|
||||
$this->addSql('CREATE INDEX idx_8190d6c685405fd2 ON clients_tables (tables_id)');
|
||||
$this->addSql('CREATE INDEX idx_8190d6c6ab014612 ON clients_tables (clients_id)');
|
||||
$this->addSql('ALTER TABLE clients_tables ADD CONSTRAINT fk_8190d6c6ab014612 FOREIGN KEY (clients_id) REFERENCES clients (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE clients_tables ADD CONSTRAINT fk_8190d6c685405fd2 FOREIGN KEY (tables_id) REFERENCES tables (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE tables_clients DROP CONSTRAINT FK_80F8906E85405FD2');
|
||||
$this->addSql('ALTER TABLE tables_clients DROP CONSTRAINT FK_80F8906EAB014612');
|
||||
$this->addSql('DROP TABLE tables_clients');
|
||||
}
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
/* Style pour chaque élément d'information de l'utilisateur */
|
||||
.user-info-item {
|
||||
display: flex;
|
||||
padding: 10px 0;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
/* Dernier élément sans bordure */
|
||||
.user-info-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
/* Style pour le label de chaque information (Nom, Prénom, etc.) */
|
||||
.user-info-label {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
width: 7%;
|
||||
}
|
||||
|
||||
/* Style pour la valeur de chaque information (la donnée de l'utilisateur) */
|
||||
.user-info-value {
|
||||
color: #555;
|
||||
text-align: left;
|
||||
width: 65%;
|
||||
word-wrap: break-word; /* Gère les débordements */
|
||||
}
|
||||
|
||||
.password {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* Ajout d'un style pour rendre responsive */
|
||||
@media (max-width: 600px) {
|
||||
#InformationUser {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.user-info-item {
|
||||
flex-direction: column;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.user-info-label, .user-info-value {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
#container_gestion_user {
|
||||
background-color: white;
|
||||
margin-left: 20%; /* Centrage vertical */
|
||||
margin-top: 5%;
|
||||
padding: 20px;
|
||||
border: 1px solid black;
|
||||
width: 75%; /* Largeur du contenu de la modal */
|
||||
height: 100%; /* Hauteur du contenu de la modal */
|
||||
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
|
||||
display: none;
|
||||
}
|
||||
|
||||
a{
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: initial;
|
||||
}
|
@ -1,152 +0,0 @@
|
||||
.top-bar {
|
||||
background-color: #db5559;
|
||||
width: calc(100% - 18%); /*Calcule la totalité de l'écran - le left-background */
|
||||
height: 60px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 18%; /*Evite le chauvechement des 2 bars */
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
box-sizing: border-box; /* Inclut le padding dans la largeur totale */
|
||||
}
|
||||
|
||||
|
||||
.user-role {
|
||||
background-color: white;
|
||||
color: black;
|
||||
padding: 10px 15px;
|
||||
font-weight: bold;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.left-background {
|
||||
background-color: #db5559;
|
||||
width: 18%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
|
||||
.index-title-page {
|
||||
color: #FFFFFF;
|
||||
font-size: 60px;
|
||||
padding-bottom: 10px;
|
||||
font-family: 'Brittany Signature', sans-serif;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
|
||||
.btn-custom {
|
||||
background-color: #FFFFFF;
|
||||
color: black;
|
||||
padding: 15px 40px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
|
||||
border-right: 5px solid #db5559;
|
||||
border-left: 5px solid #db5559;
|
||||
}
|
||||
|
||||
|
||||
.btn-custom:hover, .btn-info-compte:hover, .btn-info-exit:hover {
|
||||
background-color: #f8b5b5;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.icon-medium {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
.icon-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
|
||||
.Information-perso {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20px;
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.btn-info-compte, .btn-info-exit {
|
||||
background-color: #FFFFFF;
|
||||
color: black;
|
||||
padding: 10px 20px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
.btn-info-compte {
|
||||
width: 50%;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.btn-info-exit {
|
||||
width: 10%;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
/* Style pour la modal (cachée par défaut) */
|
||||
.modal {
|
||||
display: none; /* Masquée par défaut */
|
||||
position: fixed;
|
||||
z-index: 1; /* Au-dessus du contenu normal */
|
||||
left: 18%; /* Commence juste après ton left-background */
|
||||
top: 0;
|
||||
width: 82%; /* Prend le reste de la largeur après le left-background */
|
||||
height: 100%; /* Prend toute la hauteur de l'écran */
|
||||
background-color: rgba(0, 0, 0, 0.4); /* Couleur d'arrière-plan avec transparence */
|
||||
overflow: auto; /* Permet le défilement si le contenu dépasse */
|
||||
}
|
||||
|
||||
/* Contenu de la modal */
|
||||
.modal-content {
|
||||
background-color: white;
|
||||
margin: 5% auto; /* Centrage vertical */
|
||||
padding: 20px;
|
||||
border: 1px solid black;
|
||||
width: 80%; /* Largeur du contenu de la modal */
|
||||
height: 80%; /* Hauteur du contenu de la modal */
|
||||
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
/* Bouton de fermeture */
|
||||
.close {
|
||||
color: black;
|
||||
float: right;
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.close:hover,
|
||||
.close:focus {
|
||||
color: red;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
38
public/js/modal.js
Normal file
38
public/js/modal.js
Normal file
@ -0,0 +1,38 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Fonction pour ouvrir la modal
|
||||
function openModal(modalId) {
|
||||
const modal = document.getElementById(modalId);
|
||||
if (modal) {
|
||||
modal.style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
// Fonction pour fermer la modal
|
||||
function closeModal(modalId) {
|
||||
const modal = document.getElementById(modalId);
|
||||
if (modal) {
|
||||
modal.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
// Ouvre les modals lorsqu'un bouton est cliqué
|
||||
document.body.addEventListener('click', function(event) {
|
||||
if (event.target.matches('span[data-modal]')) {
|
||||
const modalId = event.target.getAttribute('data-modal');
|
||||
openModal(modalId);
|
||||
}
|
||||
|
||||
// Ferme la modal lorsqu'on clique sur le bouton de fermeture
|
||||
if (event.target.matches('.close[data-modal]')) {
|
||||
const modalId = event.target.getAttribute('data-modal');
|
||||
closeModal(modalId);
|
||||
}
|
||||
|
||||
// Ferme la modal lorsqu'on clique en dehors du contenu
|
||||
document.querySelectorAll('.modal').forEach(modal => {
|
||||
if (event.target === modal) {
|
||||
modal.style.display = "none";
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
@ -1,29 +0,0 @@
|
||||
document.querySelector('.btn-info-compte').addEventListener('click', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
const contentContainer = document.getElementById('container-gestion-user');
|
||||
|
||||
// Vérifie si le contenu est déjà affiché
|
||||
if (container_gestion_user.style.display === 'block') {
|
||||
// Masquer la section "Compte" si elle est déjà affichée
|
||||
container_gestion_user.style.display = 'none';
|
||||
container_gestion_user.innerHTML = ''; // On efface le contenu pour éviter la réutilisation
|
||||
} else {
|
||||
// Afficher le conteneur et charger le contenu via AJAX
|
||||
fetch('/gestion-user')
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Erreur de chargement de la section Compte');
|
||||
}
|
||||
return response.text();
|
||||
})
|
||||
.then(html => {
|
||||
// Insérer le HTML dans le conteneur et l'afficher
|
||||
container_gestion_user.innerHTML = html;
|
||||
container_gestion_user.style.display = 'block';
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Erreur:', error);
|
||||
});
|
||||
}
|
||||
});
|
@ -11,7 +11,7 @@ class IndexController extends AbstractController
|
||||
#[Route('/index', name: 'app_index')]
|
||||
public function index(): Response
|
||||
{
|
||||
return $this->render('index/admin.html.twig', [
|
||||
return $this->render('index/index.html.twig', [
|
||||
'controller_name' => 'IndexController',
|
||||
]);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ class LoginController extends AbstractController
|
||||
// last username entered by the user
|
||||
$lastUsername = $authenticationUtils->getLastUsername();
|
||||
|
||||
return $this->render('login/gestion.html.twig', ['last_username' => $lastUsername, 'error' => $error]);
|
||||
return $this->render('login/index.html.twig', ['last_username' => $lastUsername, 'error' => $error]);
|
||||
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ class LoginController extends AbstractController
|
||||
#[Route('/access/denied', name: 'app_access_denied')]
|
||||
public function denied(): Response
|
||||
{
|
||||
return $this->render('access_denied/gestion.html.twig', [
|
||||
return $this->render('access_denied/index.html.twig', [
|
||||
'controller_name' => 'AccessDeniedController',
|
||||
]);
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ class UserController extends AbstractController
|
||||
return $this->redirectToRoute('app_index');
|
||||
}
|
||||
|
||||
return $this->render('user/update.html.twig', [
|
||||
return $this->render('gestion_user/index.html.twig', [
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
@ -88,6 +88,6 @@ class UserController extends AbstractController
|
||||
#[Route('/gestion-user', name: 'gestion_user', methods: ['GET'])]
|
||||
public function index(): Response
|
||||
{
|
||||
return $this->render('user/gestion.html.twig');
|
||||
return $this->render('gestion_user/index.html.twig');
|
||||
}
|
||||
}
|
||||
|
@ -42,8 +42,6 @@ class AddUserFormType extends AbstractType
|
||||
'choices' => [
|
||||
'Admin' => 'ROLE_ADMIN',
|
||||
'User' => 'ROLE_USER',
|
||||
'Cuisinier' => 'ROLE_CUISINIER',
|
||||
'Serveur' => 'ROLE_SERVEUR',
|
||||
],
|
||||
'expanded' => true,
|
||||
'multiple' => true,
|
||||
|
58
templates/Modals/gestionCompteModal.html.twig
Normal file
58
templates/Modals/gestionCompteModal.html.twig
Normal file
@ -0,0 +1,58 @@
|
||||
<div id="compteModal" class="modal" tabindex="-1" aria-labelledby="compteModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<span class="close" data-modal="compteModal">×</span>
|
||||
<h2 class="modal-header" id="compteModalLabel">Gestion Compte</h2>
|
||||
<div class="modal-body">
|
||||
<!-- Contenu de la modal Gestion Utilisateur -->
|
||||
<div id="InformationUser">
|
||||
<div id="NomUser">
|
||||
<span>Nom : {{ app.user.nom }}</span>
|
||||
</div>
|
||||
<div id="NomUser">
|
||||
<span>Prenom : {{ app.user.prenom }}</span>
|
||||
</div>
|
||||
<div id="NomUser">
|
||||
<span>Email : {{ app.user.userIdentifier }}</span>
|
||||
</div>
|
||||
<div id="NomUser">
|
||||
<span>Roles : {{ app.user.getRolesAsString() }}</span>
|
||||
</div>
|
||||
<div class="btn-custom icon-container" data-bs-toggle="modal" data-bs-target="#modifModal">
|
||||
<i class="icon-medium"> {{ ux_icon('fluent-emoji-high-contrast:ten-oclock') }}</i>
|
||||
<span>Modifier</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal de Modification des Informations Utilisateur -->
|
||||
<div id="modifModal" class="modal" tabindex="-1" aria-labelledby="modifModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="modifModalLabel">Modifier Informations Utilisateur</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label for="newEmail" class="form-label">Nouvel Email</label>
|
||||
<input type="email" class="form-control" id="newEmail" placeholder="Entrez votre nouvel email">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="newNom" class="form-label">Nouveau Nom</label>
|
||||
<input type="text" class="form-control" id="newNom" placeholder="Entrez votre nouveau nom">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="newPrenom" class="form-label">Nouveau Prenom</label>
|
||||
<input type="text" class="form-control" id="newPrenom" placeholder="Entrez votre nouveau prenom">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Confirmer</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
8
templates/Modals/gestionTableModal.html.twig
Normal file
8
templates/Modals/gestionTableModal.html.twig
Normal file
@ -0,0 +1,8 @@
|
||||
<div id="tableModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="close" data-modal="tableModal">×</span>
|
||||
<h2>Gestion Table</h2>
|
||||
<!-- Contenu de la modal Gestion Table -->
|
||||
<p>Ajouter ici le formulaire ou les informations pour gérer les tables.</p>
|
||||
</div>
|
||||
</div>
|
8
templates/Modals/gestionUtilisateurModal.html.twig
Normal file
8
templates/Modals/gestionUtilisateurModal.html.twig
Normal file
@ -0,0 +1,8 @@
|
||||
<div id="userModal" class="modal">
|
||||
<div class="modal-content">
|
||||
<span class="close" data-modal="userModal">×</span>
|
||||
<h2>Gestion Utilisateur</h2>
|
||||
<!-- Contenu de la modal Gestion Utilisateur -->
|
||||
<p>Ajouter ici le formulaire ou les informations pour gérer les utilisateurs.</p>
|
||||
</div>
|
||||
</div>
|
@ -23,6 +23,6 @@
|
||||
<div class="container">
|
||||
<h1>Accès Refusé</h1>
|
||||
<p>Vous n'avez pas les permissions nécessaires pour accéder à cette page.</p>
|
||||
<a href="{{ path('app_login') }}" class="btn btn-primary">Se connecter</a>
|
||||
<a href="{{ path('app_login') }}" class="btn btn-primary">Ce connecter</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -26,13 +26,9 @@
|
||||
</div>
|
||||
|
||||
<div class="btn-update">
|
||||
<button class="btn-update">Modifier</button>
|
||||
<button>Modifier</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
<script src="{{ asset('js/test.js') }}" defer></script>
|
||||
{% endblock %}
|
@ -1,134 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block head %}
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Accueil{% endblock %}</title>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
||||
<link href="https://fonts.cdnfonts.com/css/brittany-signature" rel="stylesheet">
|
||||
</head>
|
||||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" href="{{ asset('css/modal.css') }}"> <!-- Ajout du fichier CSS -->
|
||||
<link rel="stylesheet" href="{{ asset('css/compte/index.css') }}"> <!-- Ajout du fichier CSS -->
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<!-- Top Bar -->
|
||||
<div class="top-bar">
|
||||
<div>
|
||||
Bonjour, {{ app.user.prenom }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Left Menu -->
|
||||
<div class="left-background">
|
||||
<img class="LogoHegre" src="{{ asset('asset/image/LogoHegre.png') }}">
|
||||
{% if is_granted('ROLE_ADMIN') %}
|
||||
<div class="nav-bar">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="btn-custom icon-container">
|
||||
<i class="icon-medium"> {{ ux_icon('grommet-icons:group') }}</i>
|
||||
<span>Gérer Utilisateur</span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="btn-custom icon-container">
|
||||
<i class="icon-medium"> {{ ux_icon('ic:outline-table-bar') }}</i>
|
||||
<span>Gérer Table</span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="btn-custom icon-container">
|
||||
<i class="icon-medium"> {{ ux_icon('bx:food-menu') }}</i>
|
||||
<span>Gestion Menu</span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="btn-custom icon-container">
|
||||
<i class="icon-medium"> {{ ux_icon('lsicon:badge-promotion-outline') }}</i>
|
||||
<span>Gestion Promotion</span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="btn-custom icon-container">
|
||||
<i class="icon-medium"> {{ ux_icon('fluent-emoji-high-contrast:ten-oclock') }}</i>
|
||||
<span>Voir tendances</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% elseif is_granted('ROLE_CUISINIER') %}
|
||||
<div class="nav-bar">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="btn-custom icon-container">
|
||||
<i class="icon-medium"> {{ ux_icon('icon-park-outline:view-list') }}</i>
|
||||
<span>Liste des commandes</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>
|
||||
<div class="btn-custom icon-container">
|
||||
<i class="icon-medium"> {{ ux_icon('grommet-icons:group') }}</i>
|
||||
<span>Je sais pas encore</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% elseif is_granted('ROLE_SERVEUR') %}
|
||||
<div class="nav-bar">
|
||||
<ul>
|
||||
<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>
|
||||
<ul>
|
||||
<li>
|
||||
<div class="btn-custom icon-container">
|
||||
<i class="icon-medium"> {{ ux_icon('icon-park-outline:view-list') }}</i>
|
||||
<span>Commande</span>
|
||||
</div>
|
||||
</li>
|
||||
</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_gestion_user">
|
||||
<!-- Contenu par défaut, ou vous pouvez laisser vide -->
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Include modals -->
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
<script src="{{ asset('js/test.js') }}" defer></script>
|
||||
{% endblock %}
|
@ -1,144 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block head %}
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Cuisine{% endblock %}</title>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
||||
<link href="https://fonts.cdnfonts.com/css/brittany-signature" rel="stylesheet">
|
||||
</head>
|
||||
{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" href="{{ asset('css/modal.css') }}"> <!-- Ajout du fichier CSS -->
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<style>
|
||||
#container_gestion_user {
|
||||
background-color: white;
|
||||
margin-left: 20%; /* Centrage vertical */
|
||||
margin-top: 5%;
|
||||
padding: 20px;
|
||||
border: 1px solid black;
|
||||
width: 75%; /* Largeur du contenu de la modal */
|
||||
height: 100%; /* Hauteur du contenu de la modal */
|
||||
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
|
||||
display: none;
|
||||
}
|
||||
|
||||
a{
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: initial;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<!-- Top Bar -->
|
||||
<div class="top-bar">
|
||||
<div>
|
||||
Bonjour, {{ app.user.prenom }}
|
||||
</div>
|
||||
<div class="user-role">
|
||||
Rôle : {{ app.user.getRolesAsString() }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Left Menu -->
|
||||
<div class="left-background">
|
||||
<img class="LogoHegre" src="{{ asset('asset/image/LogoHegre.png') }}">
|
||||
|
||||
<div class="nav-bar">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="btn-custom icon-container">
|
||||
<i class="icon-medium"> {{ ux_icon('grommet-icons:group') }}</i>
|
||||
<span data-modal="userModal">Gérer Utilisateur</span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="btn-custom icon-container">
|
||||
<i class="icon-medium"> {{ ux_icon('ic:outline-table-bar') }}</i>
|
||||
<span data-modal="tableModal">Gérer Table</span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="btn-custom icon-container">
|
||||
<i class="icon-medium"> {{ ux_icon('bx:food-menu') }}</i>
|
||||
<span>Gestion Menu</span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="btn-custom icon-container">
|
||||
<i class="icon-medium"> {{ ux_icon('lsicon:badge-promotion-outline') }}</i>
|
||||
<span>Gestion Promotion</span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="btn-custom icon-container">
|
||||
<i class="icon-medium"> {{ ux_icon('fluent-emoji-high-contrast:ten-oclock') }}</i>
|
||||
<span>Voir tendances</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</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>
|
||||
|
||||
<div id="container_gestion_user">
|
||||
<!-- Contenu par défaut, ou vous pouvez laisser vide -->
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.querySelector('.btn-info-compte').addEventListener('click', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
const contentContainer = document.getElementById('container-gestion-user');
|
||||
|
||||
// Vérifie si le contenu est déjà affiché
|
||||
if (container_gestion_user.style.display === 'block') {
|
||||
// Masquer la section "Compte" si elle est déjà affichée
|
||||
container_gestion_user.style.display = 'none';
|
||||
container_gestion_user.innerHTML = ''; // On efface le contenu pour éviter la réutilisation
|
||||
} else {
|
||||
// Afficher le conteneur et charger le contenu via AJAX
|
||||
fetch('/gestion-user')
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Erreur de chargement de la section Compte');
|
||||
}
|
||||
return response.text();
|
||||
})
|
||||
.then(html => {
|
||||
// Insérer le HTML dans le conteneur et l'afficher
|
||||
container_gestion_user.innerHTML = html;
|
||||
container_gestion_user.style.display = 'block';
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Erreur:', error);
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Include modals -->
|
||||
{% include 'Modals/gestionCompteModal.html.twig' %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
<script src="{{ asset('js/modal.js') }}"></script> <!-- Ajout du fichier JS -->
|
||||
{% endblock %}
|
@ -1,105 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<style>
|
||||
.form-container {
|
||||
max-width: 500px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
background-color: #f8f9fa;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
.form-container h1 {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.form-input {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 20px;
|
||||
width: 95%;
|
||||
padding: 10px;
|
||||
border: 1px solid #ced4da;
|
||||
border-radius: 4px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.form-input:focus {
|
||||
border-color: #007bff;
|
||||
box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.btn-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.btn-save {
|
||||
padding: 5px 10px;
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
background-color: #007bff;
|
||||
border-radius: 5px;
|
||||
font-weight: bold;
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.btn-list {
|
||||
padding: 5px 10px;
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
background-color: red;
|
||||
border-radius: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}Nouvelle Utilisateur{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="form-container">
|
||||
<h1>Modifier Utilisateurs ! ✅</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_errors(form) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ form_row(form.Nom, {'attr': {'class': 'form-input'}, 'label': 'Nom'}) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ form_row(form.Prenom, {'attr': {'class': 'form-input'}, 'label': 'Prénom'}) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ form_row(form.UserIdentifier, {'attr': {'class': 'form-input'}, 'label': 'Email'}) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ form_row(form.Password, {'attr': {'class': 'form-input'}, 'label': 'Password'}) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ form_row(form.Roles, {'attr': {'class': 'form-input'}, 'label': 'Roles'}) }}
|
||||
</div>
|
||||
<div class="btn-container">
|
||||
{{ form_row(form.Modifier, {'attr': {'class': 'btn-save'}, 'label': 'Enregistrer'}) }}
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
|
||||
<div class="btn-container">
|
||||
<a href="{{ path('app_index') }}" class="btn-list btn-primary">Annuler</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user