From 82b2b047c5214e65ea3393011ea07d7774129283 Mon Sep 17 00:00:00 2001 From: "maxime.rocher" Date: Wed, 15 Jan 2025 14:01:41 +0100 Subject: [PATCH] modifs CSS +ajout font --- index.php | 2 +- public/styles/style.css | 7 +++++++ public/styles/styleQuoteLittle.css | 1 + src/Entity/quizEntity.php | 4 ---- src/Gateway/QuizGateway.php | 2 +- src/Model/QuizModel.php | 25 +------------------------ vue/accueilQuiz.php | 5 ++--- vue/quiz.php | 11 ++--------- vue/templates/accueilQuiz.html.twig | 14 ++++++-------- 9 files changed, 21 insertions(+), 50 deletions(-) diff --git a/index.php b/index.php index 16fd97a..a92283c 100644 --- a/index.php +++ b/index.php @@ -15,7 +15,7 @@ if(!isset($_SESSION['theme'])){ require_once __DIR__ . '/config/config.php'; require __DIR__ . '/vendor/autoload.php'; -$co = new \Gateway\Connection('pgsql:host=localhost;dbname=postgres;', 'postgres', 'sucepute'); +$co = new \Gateway\Connection('pgsql:host=localhost;dbname=wikifantasy3;', 'postgres', 'sucepute'); //$co = new \Gateway\Connection('pgsql:host=localhost;dbname=dbkekentin;', 'kekentin', 'passwd'); //twig diff --git a/public/styles/style.css b/public/styles/style.css index 9732f66..290006e 100644 --- a/public/styles/style.css +++ b/public/styles/style.css @@ -1,5 +1,6 @@ /* @import url('https://fonts.googleapis.com/css2?family=Lemon&display=swap'); */ @import url(./styleScroll.css); +@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap'); :root { --main-dark-background-color: #120B1D; --main-dark-text-color : #ffffff; @@ -14,6 +15,12 @@ --main-light-other-color : #46BE73; } + +*{ + font-family: "roboto", sans-serif; + font-weight: 600; +} + /* Général */ body{ font-family: "Lemon", serif; diff --git a/public/styles/styleQuoteLittle.css b/public/styles/styleQuoteLittle.css index e285d3f..7a0bd81 100644 --- a/public/styles/styleQuoteLittle.css +++ b/public/styles/styleQuoteLittle.css @@ -37,6 +37,7 @@ a.link-citation:hover { justify-content: space-around; width: 100%; margin: 0 auto; + font-size: medium; } a.link-citation { diff --git a/src/Entity/quizEntity.php b/src/Entity/quizEntity.php index e5f31da..8299b80 100644 --- a/src/Entity/quizEntity.php +++ b/src/Entity/quizEntity.php @@ -49,8 +49,4 @@ class QuizEntity { $this->nb_questions = $nb_questions; } - - - - } diff --git a/src/Gateway/QuizGateway.php b/src/Gateway/QuizGateway.php index 9bf4ff1..5edce73 100644 --- a/src/Gateway/QuizGateway.php +++ b/src/Gateway/QuizGateway.php @@ -36,7 +36,7 @@ class QuizGateway extends Gateway public function findAll() : array { - $query = "SELECT * FROM Quiz"; + $query = "SELECT id_quiz, title, imgPath FROM Quiz q JOIN Image i on q.img = i.id_img"; $this -> co -> executeQuery($query); return $this -> co -> getResults(); } diff --git a/src/Model/QuizModel.php b/src/Model/QuizModel.php index dfa15de..2284a83 100644 --- a/src/Model/QuizModel.php +++ b/src/Model/QuizModel.php @@ -30,31 +30,8 @@ class QuizModel extends Model{ return $this -> gateway -> delete($id_quiz); } - public function getAllQuiz() : array - { - $q = $this -> gateway -> findAll(); - - $quizzes = []; - - foreach ($q as $quiz) { - $quizzes[] = new quizEntity( - $quiz['id_quiz'], - $quiz['nb_questions'] - ); - } - return $quizzes; - - } - public function listQuiz() : array { - $q = $this -> gateway -> findAll(); - $quizIds = []; - - foreach ($q as $quiz) { - $quizIds[] = $quiz['id_quiz']; - } - - return $quizIds; + } } \ No newline at end of file diff --git a/vue/accueilQuiz.php b/vue/accueilQuiz.php index e8de906..98eed7b 100644 --- a/vue/accueilQuiz.php +++ b/vue/accueilQuiz.php @@ -10,8 +10,7 @@ echo $twig->render('head.html.twig', [ echo $twig->render('bandeau.html.twig'); -echo $twig->render('accueilQuiz.html.twig', [ - 'quiz' => $quizs, - 'titre' => "Quiz" +echo $twig->render('quiz.html.twig', [ + 'quizList' => $quizIds ]); ?> \ No newline at end of file diff --git a/vue/quiz.php b/vue/quiz.php index e0cfbb2..f522f41 100644 --- a/vue/quiz.php +++ b/vue/quiz.php @@ -1,22 +1,15 @@ render('head.html.twig', [ 'title' => "Quiz", 'style' => "../public/styles/styleQuiz.css", 'scripts' => array("../public/script/theme-toggle-double-param.js") ]); - // Rendu du bandeau echo $twig->render('bandeau.html.twig'); echo $twig->render('quiz.html.twig', [ - 'idQuiz'=>$id , - 'question' => $question, - 'id'=>$idquestion, - 'nb' => $num + 1, - 'nbFinal' => $nbQuestion]); -?> - + 'quizList' => $quizs +]); diff --git a/vue/templates/accueilQuiz.html.twig b/vue/templates/accueilQuiz.html.twig index b794610..47083ee 100644 --- a/vue/templates/accueilQuiz.html.twig +++ b/vue/templates/accueilQuiz.html.twig @@ -1,19 +1,17 @@

Liste des Quiz

- \ No newline at end of file +