From 6b786c7529e89f7540b7ce849be864a7759c2b9a Mon Sep 17 00:00:00 2001 From: "lucie.goigoux2" Date: Tue, 21 Nov 2023 15:37:45 +0100 Subject: [PATCH] modif de la view du choix des jeux ----> fonctionne ;) --- Project/php/controller/StudentController.php | 5 +- Project/php/templates/gamesList.html | 50 ++++++++++++-------- Project/php/templates/navBar.twig | 4 +- Project/php/templates/vocabList.html | 8 +++- 4 files changed, 40 insertions(+), 27 deletions(-) diff --git a/Project/php/controller/StudentController.php b/Project/php/controller/StudentController.php index 2b5697a..a8eed32 100755 --- a/Project/php/controller/StudentController.php +++ b/Project/php/controller/StudentController.php @@ -36,12 +36,13 @@ class StudentController extends UserController echo $twig->render('manageVocabView.html', ['vocabularies' => $vocab]); } - public function memoryChoice(): void { + public function ListVocChoice(): void { global $twig; global $user; + $jeu = $_POST['jeu']; $model = new MdlStudent(); $voc = $model->getAll(); - echo $twig->render('vocabList.html', ['vocabularies' => $voc, 'userID' => $user->getId(), 'userRole' => $user->getRoles()]); + echo $twig->render('vocabList.html', ['jeu' => $jeu, 'vocabularies' => $voc, 'userID' => $user->getId(), 'userRole' => $user->getRoles()]); } public function gameChoice(): void { diff --git a/Project/php/templates/gamesList.html b/Project/php/templates/gamesList.html index efe1cb9..8ef53b1 100755 --- a/Project/php/templates/gamesList.html +++ b/Project/php/templates/gamesList.html @@ -4,40 +4,48 @@ Users - - + table { + margin-top: 20px; + } + + {% include 'navBar.twig' %} -{% if vocabularies is defined %}
- {% for row in vocabularies %} + + + - {% endfor %}
-
- - + + + +
+
+
+ +
-{% endif %} - \ No newline at end of file + diff --git a/Project/php/templates/navBar.twig b/Project/php/templates/navBar.twig index dd55b4d..a2c3659 100755 --- a/Project/php/templates/navBar.twig +++ b/Project/php/templates/navBar.twig @@ -15,12 +15,12 @@ {% endif %} {% if 'student' in userRole%} - + {% endif %} {% if 'teacher' in userRole%} - + {% endif %} {% if userRole is empty %} diff --git a/Project/php/templates/vocabList.html b/Project/php/templates/vocabList.html index 41cbeeb..4d278ce 100755 --- a/Project/php/templates/vocabList.html +++ b/Project/php/templates/vocabList.html @@ -14,8 +14,12 @@ height: 100vh; } + .content { + text-align: center; + } + table { - border-spacing: 5%; + margin-top: 20px; } @@ -28,7 +32,7 @@ {% for row in vocabularies %} -
+