Twig pour profil (en attente du controleur) + page quote

pull/17/head
Leni BEAULATON 6 months ago
parent 37de485a71
commit 564fc00329

@ -1 +1,21 @@
@import url(./style.css); @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;
}

@ -33,7 +33,7 @@
public function getDataUser(int $id){ public function getDataUser(int $id){
$res = $this->gateway->findDataUser($id); $res = $this->gateway->findDataUser($id);
foreach($res as $sources){ foreach($res as $sources){
$src[] = new sourceEntity( $src[] = new User(
$sources['id_user'], $sources['id_user'],
$sources['username'], $sources['username'],
$sources['pssword'], $sources['pssword'],
@ -47,28 +47,28 @@
public function setUsername(int $id, string $newUsername){ public function setUsername(int $id, string $newUsername){
$res = $this->gateway->updateUsername($id,$newUsername); $res = $this->gateway->updateUsername($id,$newUsername);
$src[] = new sourceEntity($res[0]['username']); $src[] = $res[0]['username'];
return $src; return $src;
} }
public function setEmail(int $id, string $newEmail){ public function setEmail(int $id, string $newEmail){
$res = $this->gateway->updateEmail($id,$newEmail); $res = $this->gateway->updateEmail($id,$newEmail);
$src[] = new sourceEntity($res[0]['email']); $src[] = $res[0]['email'];
return $src; return $src;
} }
public function setImg(int $id, int $newImg){ public function setImg(int $id, int $newImg){
$res = $this->gateway->updateImg($id,$newImg); $res = $this->gateway->updateImg($id,$newImg);
$src[] = new sourceEntity($res[0]['img']); $src[] = $res[0]['img'];
return $src; return $src;
} }
public function setPassWd(int $id, string $newPassWd){ public function setPassWd(int $id, string $newPassWd){
$res = $this->gateway->updatePasswd($id,$newPassWd); $res = $this->gateway->updatePasswd($id,$newPassWd);
$src[] = new sourceEntity($res[0]['pssword']); $src[] = $res[0]['pssword'];
return $src; return $src;
} }

@ -1,74 +1,18 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="../public/styles/styleProfil.css" media="screen">
<title>Wiki Fantasy : Profil</title>
<link id="favicon" rel="icon" href="../../images/iconeSombre.ico"> <!-- Par défaut sombre -->
<link href="https://fonts.googleapis.com/css2?family=Lemon&display=swap" rel="stylesheet">
<script defer src="../public/script/theme-toggle.js"></script>
<script defer src="../public/script/changeData.js"></script>
</head>
<body>
<div class="container">
<div class="header">
<div class="nav">
<img src="../images/coeur.svg" alt="coeur" width="67px" height="67px" onmousedown="return false">
<img id="theme-icon" src="../images/light.svg" alt="toggle theme" width="72px" height="37px" onmousedown="return false" onclick="toggleTheme()">
<img src="../images/quizz.svg" alt="quizz" width="51px" height="82px" onmousedown="return false">
</div>
<div class="logo">
<img src="../images/WIKIFANTASY.png" alt="Logo" width="227px" height="106px" onmousedown="return false" >
</div>
</div>
</div>
<div class="login">
<h1>▶ Profil ◀</h1>
<?php <?php
include ('../src/Entity/userEntity.php');
echo "<img src='{$u->getImg()}' class='imageProfil' onmousedown='return false'/>";
// Nom d'utilisateur
echo "<p id='username' class='infoProfil'>
<strong>{$u->getUsername()}
<img class='imgModify' src='../images/modify.svg' onclick='editFieldUsername(\"username\")'/>
</strong>
</p>";
// Email
echo "<p id='email' class='infoProfil'>
<strong>{$u->getEmail()}
<img class='imgModify' src='../images/modify.svg' onclick='editFieldEmail(\"email\")'/>
</strong>
</p>";
// Mot de passe // appele avec index.php ne pas mettre si controleur fonctionnel
echo "<p id='passwd' class='infoProfil'> require __DIR__ . '/../vendor/autoload.php';
<strong>{$u->getHidenPasswd()}
<img class='imgModify' src='../images/modify.svg' onclick='editFieldPassWd(\"passwd\")'/> $loader = new \Twig\Loader\FilesystemLoader('templates');
</strong> $twig = new \Twig\Environment($loader, [
</p>"; 'cache' => false,
]);
//
echo $twig->render('profil.html', array(
'srcUsername' => "Test User",
'srcEmail' => "test@gmail.com",
'srcPasswd' => "*****",
'srcImg' => "../images/imageProfil.png",
));
?> ?>
<div class="languageDiv">
<p class="languageTitle">Language :</p>
</div>
<img class="languageImage" src="../images/drapeauFrance.png" onmousedown="return false"/>
<div class="createQuote">
<a href="rien" class="createQuote">Ajouter une citation</a>
</div>
<div class="buttonSudmiteDiv">
<button class="buttonSudmite">Se déconnecter</button>
</div>
</div>
</body>
</html>

@ -8,7 +8,12 @@
'cache' => false, '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( echo $twig->render('quote.html.twig', array(
'srcImg' => "../default.jpg", 'srcImg' => "../default.jpg",
'nameCarac' => "default", 'nameCarac' => "default",

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="../public/styles/styleProfil.css" media="screen"> <link rel="stylesheet" type="text/css" href="../public/styles/styleProfil.css" media="screen">
<title>Wiki Fantasy : Profil</title> <title>Wiki Fantasy : Profil</title>
<link id="favicon" rel="icon" href="../../images/iconeSombre.ico"> <!-- Par défaut sombre --> <link id="favicon" rel="icon" href="../images/iconeSombre.ico"> <!-- Par défaut sombre -->
<link href="https://fonts.googleapis.com/css2?family=Lemon&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Lemon&display=swap" rel="stylesheet">
<script defer src="../public/script/theme-toggle.js"></script> <script defer src="../public/script/theme-toggle.js"></script>
<script defer src="../public/script/changeData.js"></script> <script defer src="../public/script/changeData.js"></script>
@ -28,15 +28,15 @@
<h1>▶ Profil ◀</h1> <h1>▶ Profil ◀</h1>
<img src="../images/imageProfil.png" class="imageProfil" onmousedown="return false"/> <img src="{{ srcImg }}" class="imageProfil" onmousedown="return false"/>
<p class="infoProfil"> <strong> Tyler De Dordogne</strong><img class='imgModify' src='../images/modify.svg'/></p> <p class="infoProfil"> <strong>{{ srcUsername }}</strong><img class='imgModify' src='../images/modify.svg'/></p>
<p class="infoProfil"> <strong> user@wikiFantasy.com</strong><img class='imgModify' src='../images/modify.svg'/></p> <p class="infoProfil"> <strong> {{ srcEmail }}</strong><img class='imgModify' src='../images/modify.svg'/></p>
<p class="infoProfil"> <strong> *********</strong><img class='imgModify' src='../images/modify.svg'/></p> <p class="infoProfil"> <strong>{{ srcPasswd }}</strong><img class='imgModify' src='../images/modify.svg'/></p>
<div class="languageDiv"> <div class="languageDiv">

@ -1,36 +1,10 @@
<html>
<body> <div class="divQuote">
<div class="Quote_container"> <img class="imgQuote" src="../../images/vador.webp"/>
<img class="image_carac" src="{{ srcImg }}" alt="{{ nameCarac }}"> <p class="quote"> <strong>"Je suis ton père"</strong></p>
<h1 class="quote_content"> <p class="textQuote"> Star Wars V : L'Empire contre-attaque (1h45)</p>
<strong> <p class="textQuote">Dark Vador</p>
{{ quoteContent }} <p class="textQuote">1980</p>
</strong>
</h1>
<ul>
<li>
{{ sourceName }}
</li>
<li>
{{ nameCarac }}
</li>
<li>
{{ dateSortie }}
</li>
</ul>
<div class="like">
<p>
{{ nbLike }}
</p>
</div>
</div>
<div class="Comment_Container">
{% if comment|length > 0%} <div>
{% for com in comment %}
<p class="userCom">{{ com.user }}</p>
<p class="com">{{ com.content }}</p>
{% endfor %} </div>
{% endif %}
</div> </div>
</body> </body>
</html> </html>
Loading…
Cancel
Save