From 564fc00329b07f20df0929bbbf903c63e01bcbf8 Mon Sep 17 00:00:00 2001 From: beaulaton Date: Fri, 25 Oct 2024 15:26:08 +0200 Subject: [PATCH] Twig pour profil (en attente du controleur) + page quote --- public/styles/styleQuote.css | 22 +++++++- src/Model/userModel.php | 10 ++-- vue/profil.php | 92 +++++++-------------------------- vue/quote.php | 5 ++ vue/{ => templates}/profil.html | 10 ++-- vue/templates/quote.html.twig | 40 +++----------- 6 files changed, 61 insertions(+), 118 deletions(-) rename vue/{ => templates}/profil.html (76%) diff --git a/public/styles/styleQuote.css b/public/styles/styleQuote.css index e0e9625..5eedd8c 100644 --- a/public/styles/styleQuote.css +++ b/public/styles/styleQuote.css @@ -1 +1,21 @@ -@import url(./style.css); \ No newline at end of file +@import url(./style.css); + +body.dark-mode .divQuote{ + background-color: black; + width: 30%; + margin-left: 2%; + margin-top: 3%; + border-radius: 25px; + border: 2px solid transparent; +} + +body.dark-mode .imgQuote{ + border-radius: 15%; + width: 60%; +} + +body.dark-mode .textQuote, .quote{ + font-family: "Lemon", serif; + font-size: 20px; +} + diff --git a/src/Model/userModel.php b/src/Model/userModel.php index 7300c4d..adc7012 100644 --- a/src/Model/userModel.php +++ b/src/Model/userModel.php @@ -33,7 +33,7 @@ public function getDataUser(int $id){ $res = $this->gateway->findDataUser($id); foreach($res as $sources){ - $src[] = new sourceEntity( + $src[] = new User( $sources['id_user'], $sources['username'], $sources['pssword'], @@ -47,28 +47,28 @@ public function setUsername(int $id, string $newUsername){ $res = $this->gateway->updateUsername($id,$newUsername); - $src[] = new sourceEntity($res[0]['username']); + $src[] = $res[0]['username']; return $src; } public function setEmail(int $id, string $newEmail){ $res = $this->gateway->updateEmail($id,$newEmail); - $src[] = new sourceEntity($res[0]['email']); + $src[] = $res[0]['email']; return $src; } public function setImg(int $id, int $newImg){ $res = $this->gateway->updateImg($id,$newImg); - $src[] = new sourceEntity($res[0]['img']); + $src[] = $res[0]['img']; return $src; } public function setPassWd(int $id, string $newPassWd){ $res = $this->gateway->updatePasswd($id,$newPassWd); - $src[] = new sourceEntity($res[0]['pssword']); + $src[] = $res[0]['pssword']; return $src; } diff --git a/vue/profil.php b/vue/profil.php index 0c2efc8..9e338bf 100644 --- a/vue/profil.php +++ b/vue/profil.php @@ -1,74 +1,18 @@ - - - - - - - Wiki Fantasy : Profil - - - - - - - -
-
- - -
-
- -
-

▶ Profil ◀

- - getImg()}' class='imageProfil' onmousedown='return false'/>"; - - // Nom d'utilisateur - echo "

- {$u->getUsername()} - - -

"; - - // Email - echo "

- {$u->getEmail()} - - -

"; - - // Mot de passe - echo "

- {$u->getHidenPasswd()} - - -

"; - ?> - -
-

Language :

-
- - - - - -
- -
- -
- - + false, + ]); + // + + echo $twig->render('profil.html', array( + 'srcUsername' => "Test User", + 'srcEmail' => "test@gmail.com", + 'srcPasswd' => "*****", + 'srcImg' => "../images/imageProfil.png", + )); +?> \ No newline at end of file diff --git a/vue/quote.php b/vue/quote.php index 5c0a13b..175e30c 100644 --- a/vue/quote.php +++ b/vue/quote.php @@ -8,7 +8,12 @@ 'cache' => false, ]); // + echo $twig->render('head.html.twig', array( + 'title' => "Quote", + 'style' => "../public/styles/styleQuote.css", + )); + echo $twig->render('bandeau.html.twig'); echo $twig->render('quote.html.twig', array( 'srcImg' => "../default.jpg", 'nameCarac' => "default", diff --git a/vue/profil.html b/vue/templates/profil.html similarity index 76% rename from vue/profil.html rename to vue/templates/profil.html index 977a6fc..b32e8d6 100644 --- a/vue/profil.html +++ b/vue/templates/profil.html @@ -5,7 +5,7 @@ Wiki Fantasy : Profil - + @@ -28,15 +28,15 @@

▶ Profil ◀

- + -

Tyler De Dordogne

+

{{ srcUsername }}

-

user@wikiFantasy.com

+

{{ srcEmail }}

-

*********

+

{{ srcPasswd }}

diff --git a/vue/templates/quote.html.twig b/vue/templates/quote.html.twig index c35ecd8..6a70fb7 100644 --- a/vue/templates/quote.html.twig +++ b/vue/templates/quote.html.twig @@ -1,36 +1,10 @@ - - -
- {{ nameCarac }} -

- - {{ quoteContent }} - -

-
    -
  • - {{ sourceName }} -
  • -
  • - {{ nameCarac }} -
  • -
  • - {{ dateSortie }} -
  • -
- -
-
- {% if comment|length > 0%}
- {% for com in comment %} -

{{ com.user }}

-

{{ com.content }}

- {% endfor %}
- {% endif %} + +
+ +

"Je suis ton père"

+

Star Wars V : L'Empire contre-attaque (1h45)

+

Dark Vador

+

1980

\ No newline at end of file