diff --git a/config/config.php b/config/config.php index 830d1bd..1a2bbb9 100644 --- a/config/config.php +++ b/config/config.php @@ -12,7 +12,8 @@ $base = ''; $login = ''; $mdp = ''; -$racine='/~kemondejar/WF-Website'; // /~kekentin/WF/WF-Website +//$racine='/~kemondejar/WF-Website'; // /~kekentin/WF/WF-Website +$racine='/WF-Website'; //Vues diff --git a/index.php b/index.php index cdbd6fb..b701244 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=dbkekentin;', 'kekentin', 'passwd');// ('pgsql:host=localhost;dbname=dbkekentin;', 'kekentin', 'passwd') +$co = new \Gateway\Connection('pgsql:host=localhost;dbname=postgres;', 'postgres', 'sucepute');// ('pgsql:host=localhost;dbname=dbkekentin;', 'kekentin', 'passwd') //twig $loader = new \Twig\Loader\FilesystemLoader('vue/templates'); diff --git a/public/styles/styleQuote.css b/public/styles/styleQuote.css index ae1fd7e..2e38bf8 100644 --- a/public/styles/styleQuote.css +++ b/public/styles/styleQuote.css @@ -148,17 +148,35 @@ body.light-mode .like-icon-none img{ margin-top: 2vh; display: flex; flex-direction: column; - overflow-y: scroll; + overflow-y: auto; height: 55vh; } +.comment_section::-webkit-scrollbar { + width: 8px; /* Largeur de la scrollbar */ +} + +.comment_section::-webkit-scrollbar-track { + background: #f1f1f1; /* Couleur de fond */ + border-radius: 8px; /* Arrondi pour modernité */ +} + +.comment_section::-webkit-scrollbar-thumb { + background-color: #888; /* Couleur du "curseur" */ + border-radius: 8px; /* Arrondi du curseur */ + border: 2px solid #f1f1f1; /* Petit espace autour pour l'effet moderne */ +} + + .comment_section::-webkit-scrollbar-thumb:hover { + background-color: #555; /* Couleur au survol */ +} + .com{ background-color: #fff; color: black; display: flex; font-family: "Lemon", sans-serif; flex-direction: column; - margin-top: 1vh; margin-bottom: 1vh; border-radius: 20px; padding : 2%; @@ -224,7 +242,19 @@ body.light-mode .like-icon-none img{ .infCom{ display: flex; justify-content: space-between; - margin-bottom: 1vh; + margin-bottom: -5px; +} + +.avatar{ + width: 40px; + height: 40px; + border-radius: 50%; + margin-right: 15px; +} + +.imgIcones{ + display: flex; + align-items: center; } .comAdd :focus { diff --git a/src/Entity/CommentaryEntity.php b/src/Entity/CommentaryEntity.php index eb8eb8f..b6f6528 100644 --- a/src/Entity/CommentaryEntity.php +++ b/src/Entity/CommentaryEntity.php @@ -7,18 +7,20 @@ class CommentaryEntity { private string $comment; private string $date; private string $user; + private string $img; /** * @param int $id_comment * @param string $comment * @param string $date */ - public function __construct(int $id_comment, string $comment, string $date, string $user) + public function __construct(int $id_comment, string $comment, string $date, string $user, string $img) { $this->id_comment = $id_comment; $this->comment = $comment; $this->date = $date; $this->user = $user; + $this->img = $img; } /** @@ -85,6 +87,21 @@ class CommentaryEntity { $this->user = $user; } + /** + * @return string $img + */ + public function getImg(): string + { + return $this->img; + } + /** + * @param string $img + */ + public function setImg(int $img): void + { + $this->img = $img; + } + } ?> \ No newline at end of file diff --git a/src/Gateway/CommentaryGateway.php b/src/Gateway/CommentaryGateway.php index 22a4754..5400543 100644 --- a/src/Gateway/CommentaryGateway.php +++ b/src/Gateway/CommentaryGateway.php @@ -41,7 +41,7 @@ class CommentaryGateway extends Gateway{ } public function findByQuote(int $id) : array{ - $query="SELECT c.id_comment, c.dateC, c.comment, u.username FROM Commentary c JOIN Users u ON u.id_user = c.users WHERE quote = :idQuote ORDER BY c.datec DESC"; + $query="SELECT c.id_comment, c.dateC, c.comment, u.username, i.imgPath FROM Commentary c JOIN Users u ON u.id_user = c.users JOIN Image i ON i.id_img = u.img WHERE quote = :idQuote ORDER BY c.datec DESC"; $this -> co -> executeQuery($query, array("idQuote" => array($id,PDO::PARAM_STR))); return $res = $this -> co -> getResults(); } diff --git a/src/Model/CommentaryModel.php b/src/Model/CommentaryModel.php index 0e947e9..c5e5a68 100644 --- a/src/Model/CommentaryModel.php +++ b/src/Model/CommentaryModel.php @@ -14,7 +14,7 @@ class CommentaryModel extends Model { $com = []; $res = $this->gateway->findByQuote($id); foreach ($res as $comments){ - $com[] = new CommentaryEntity($comments["id_comment"], $comments["comment"], $comments["datec"], $comments["username"]); + $com[] = new CommentaryEntity($comments["id_comment"], $comments["comment"], $comments["datec"], $comments["username"], $comments["imgpath"]); } return $com; } diff --git a/vue/templates/quote.html.twig b/vue/templates/quote.html.twig index e95f547..ffc43f9 100644 --- a/vue/templates/quote.html.twig +++ b/vue/templates/quote.html.twig @@ -44,9 +44,12 @@ {% for c in com %}