Skip to content
Snippets Groups Projects
Commit 28ea64fd authored by GROSJEAN Herve's avatar GROSJEAN Herve
Browse files
parents 48cb4208 4213321a
Branches main
No related tags found
No related merge requests found
...@@ -33,15 +33,15 @@ a { ...@@ -33,15 +33,15 @@ a {
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background-color: #F5F5F5; background-color: $couleurPhoto;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
height: 6px; height: 6px;
background-color: #F5F5F5; background-color: #3cb5ec;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background-color: $couleurPhoto; background-color: #3cb5ec;
border-radius: 3px; border-radius: 3px;
} }
\ No newline at end of file
...@@ -153,16 +153,16 @@ a { ...@@ -153,16 +153,16 @@ a {
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background-color: #F5F5F5; background-color: #4270C8;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
height: 6px; height: 6px;
background-color: #F5F5F5; background-color: #3cb5ec;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background-color: #4270C8; background-color: #3cb5ec;
border-radius: 3px; border-radius: 3px;
} }
...@@ -243,6 +243,17 @@ body { ...@@ -243,6 +243,17 @@ body {
flex-wrap: wrap; flex-wrap: wrap;
} }
#comment {
width: max-content;
overflow-y: scroll;
}
.contentMsg {
background-color: whitesmoke;
border-radius: 3px;
margin-bottom: 2px;
}
@media only screen and (min-width: 800px) { @media only screen and (min-width: 800px) {
.cardPhoto { .cardPhoto {
height: 600px; height: 600px;
......
{"version":3,"sourceRoot":"","sources":["formulaire.scss","galerie.scss","nav.scss","photo.scss"],"names":[],"mappings":"AAGA;EACI;;;AAGJ;EACI;EACA;EACA,kBAVS;EAWT;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA,YArBY;EAsBZ;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;;AAGJ;AAAA;EAEI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA,kBA7EY;EA8EZ;;;AAGJ;EACI;;;AAGJ;EACI;EACA;;;AAGJ;EACI,kBA3FY;EA4FZ;EACA;;;AAEJ;EACI;EACA;;;AAGJ;EACI,kBArGY;EAsGZ;EACA;EACA;EACA;;;AAEJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI,OAxHS;;;ACEb;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA,kBAdU;EAeV;;;AAGJ;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;;;AAGJ;EACI,kBA5CU;EA6CV;;;AC1CJ;EACI;EACA;;;AAEJ;EACI,kBAPQ;EAQR;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA,kBAtBQ;EAuBR;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;;AAEJ;EACI;EACA;;;AAGJ;EACI;EACA,YAxCQ;EAyCR;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;IACI;IACA;;;EAEJ;IACI;IAEA;;;AC5DR;EACI;EACA;EACA;EACA;EACA;EACA;EACA,kBATU;EAUV;;;AAGJ;EACI;IACI;;;EAEJ;IACI;IACA","file":"index.css"} {"version":3,"sourceRoot":"","sources":["formulaire.scss","galerie.scss","nav.scss","photo.scss"],"names":[],"mappings":"AAGA;EACI;;;AAGJ;EACI;EACA;EACA,kBAVS;EAWT;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA,YArBY;EAsBZ;;;AAGJ;EACI;;;AAGJ;EACI;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;;;AAGJ;AAAA;EAEI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;EACA;EACA,kBA7EY;EA8EZ;;;AAGJ;EACI;;;AAGJ;EACI;EACA;;;AAGJ;EACI,kBA3FY;EA4FZ;EACA;;;AAEJ;EACI;EACA;;;AAGJ;EACI,kBArGY;EAsGZ;EACA;EACA;EACA;;;AAEJ;EACI;EACA;EACA;;;AAGJ;EACI;EACA;;;AAGJ;EACI,OAxHS;;;ACEb;EACI;;;AAGJ;EACI;EACA;EACA;EACA;EACA;EACA;EACA;EACA,kBAdU;EAeV;;;AAGJ;EACI;EACA;;;AAGJ;EACI;;;AAGJ;EACI;EACA;EACA;EACA;;;AAGJ;EACI,kBAnCU;;;AAsCd;EACI;EACA;;;AAGJ;EACI;EACA;;;AC1CJ;EACI;EACA;;;AAEJ;EACI,kBAPQ;EAQR;EACA;;;AAEJ;EACI;EACA;;;AAEJ;EACI;EACA;EACA;EACA;EACA;EACA,kBAtBQ;EAuBR;EACA;;;AAGJ;EACI;EACA;EACA;EACA;;;AAEJ;EACI;EACA;;;AAGJ;EACI;EACA,YAxCQ;EAyCR;EACA;EACA;;;AAGJ;EACI;EACA;EACA;EACA;EACA;;;AAGJ;EACI;IACI;IACA;;;EAEJ;IACI;IAEA;;;AC5DR;EACI;EACA;EACA;EACA;EACA;EACA;EACA,kBATU;EAUV;;;AAGJ;EACI;EACA;;;AAGJ;EACI;EACA;EACA;;;AAGJ;EACI;IACI;;;EAEJ;IACI;IACA","file":"index.css"}
\ No newline at end of file \ No newline at end of file
...@@ -6,11 +6,22 @@ $couleurPhoto:#4270C8; ...@@ -6,11 +6,22 @@ $couleurPhoto:#4270C8;
vertical-align: top; vertical-align: top;
border: solid black; border: solid black;
border-radius: 5px; border-radius: 5px;
width:fit-content; width: fit-content;
background-color:$couleurPhoto; background-color:$couleurPhoto;
flex-wrap: wrap; flex-wrap: wrap;
} }
#comment {
width: max-content;
overflow-y: scroll;
}
.contentMsg {
background-color: whitesmoke;
border-radius: 3px;
margin-bottom: 2px;
}
@media only screen and (min-width:800px){ @media only screen and (min-width:800px){
.cardPhoto { .cardPhoto {
height: 600px; height: 600px;
......
...@@ -69,7 +69,7 @@ class GalerieAddUserAction ...@@ -69,7 +69,7 @@ class GalerieAddUserAction
} }
header("Location: ../addUser/{$id}"); header("Location: ../addUser/{$id}");
exit(); exit();
} elseif($acce==2) { } elseif($acce==3) {
if($_SERVER['REQUEST_METHOD'] === 'GET') { if($_SERVER['REQUEST_METHOD'] === 'GET') {
$view = Twig::fromRequest($request); $view = Twig::fromRequest($request);
// affiche le formulaire // affiche le formulaire
......
...@@ -7,6 +7,7 @@ use App\Domain\Galerie; ...@@ -7,6 +7,7 @@ use App\Domain\Galerie;
use App\Domain\User; use App\Domain\User;
use App\Domain\Photos; use App\Domain\Photos;
use App\Domain\User2galerie; use App\Domain\User2galerie;
use App\Domain\Commentaire;
use phpDocumentor\Reflection\Type; use phpDocumentor\Reflection\Type;
use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Message\ServerRequestInterface as Request;
...@@ -16,20 +17,20 @@ use Slim\Views\Twig; ...@@ -16,20 +17,20 @@ use Slim\Views\Twig;
class AfficherPhotoAction class AfficherPhotoAction
{ {
public function __invoke(Request $request, Response $response, $args): Response public function __invoke(Request $request, Response $response, $args): Response
{ {
$id = intval($args['id']); $id = intval($args['id']);
if ($_SERVER['REQUEST_METHOD'] === 'GET') { if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$view = Twig::fromRequest($request); $view = Twig::fromRequest($request);
$url['getAccueil'] = ['route' => '/', 'name' => 'Accueil', 'method' => 'GET']; $url['getAccueil'] = ['route' => '/', 'name' => 'Accueil', 'method' => 'GET'];
$url['getGalerieList'] = ['route' => '../galeries', 'name' => 'Galerie', 'method' => 'GET']; $url['getGalerieList'] = ['route' => '../galeries', 'name' => 'Galerie', 'method' => 'GET'];
if(isset($_SESSION['user']) && !is_null($_SESSION['user'])) { if(isset($_SESSION['user']) && !is_null($_SESSION['user'])) {
$user = User::where('email', '=', $_SESSION['user'])->first(); $user = User::where('email', '=', $_SESSION['user'])->first();
$id_user = $user->id_user; $id_user = $user->id_user;
$url['getMonCompte'] = ['route' => "../monCompte/$id_user", 'name' => 'mon compte', 'method' => 'GET']; $url['getMonCompte'] = ['route' => "../monCompte/$id_user", 'name' => 'mon compte', 'method' => 'GET'];
$url['deconnexionPost'] = ['route' => '../deconnexion', 'name' => 'Deconnexion', 'method' => 'POST']; $url['deconnexionPost'] = ['route' => '../deconnexion', 'name' => 'Deconnexion', 'method' => 'POST'];
} else { } else {
$url['inscriptionGet'] = ['route' => '../inscription', 'name' => 'Inscription', 'method' => 'GET']; $url['inscriptionGet'] = ['route' => '../inscription', 'name' => 'Inscription', 'method' => 'GET'];
$url['connexionGet'] = ['route' => '../connexion', 'name' => 'Connexion', 'method' => 'GET']; $url['connexionGet'] = ['route' => '../connexion', 'name' => 'Connexion', 'method' => 'GET'];
...@@ -66,11 +67,14 @@ class AfficherPhotoAction ...@@ -66,11 +67,14 @@ class AfficherPhotoAction
$url['getPhotoDelete'] = "../photoDelete/{$id}"; $url['getPhotoDelete'] = "../photoDelete/{$id}";
$url['getPhotoUpdate'] = "../photoUpdate/{$id}"; $url['getPhotoUpdate'] = "../photoUpdate/{$id}";
$url['postMessage'] = "../sendMessage/$id}"; $url['postMessage'] = "../sendMessage/$id}";
$photo = Photos::where("id_photo","=",$id)->get(); $photo = Photos::where("id_photo","=",$id)->get();
$photoNext = Photos::where("id_galerie","=",$photo[0]->id_galerie)->where("id_photo",">",$id)->first(); $photoNext = Photos::where("id_galerie","=",$photo[0]->id_galerie)->where("id_photo",">",$id)->first();
$photoPrev = Photos::where("id_galerie","=",$photo[0]->id_galerie)->where("id_photo","<",$id)->get()->last(); $photoPrev = Photos::where("id_galerie","=",$photo[0]->id_galerie)->where("id_photo","<",$id)->get()->last();
$commentaires = Commentaire::where("id_photo","=",$id)->get();
/* $crea = User::select("nom")->where("id_user","=",$user2gal->id_user)->first();
$data['createur'] = $crea->nom; */
if($photoPrev != null) { if($photoPrev != null) {
$idprev = $photoPrev->id_photo; $idprev = $photoPrev->id_photo;
} else { } else {
...@@ -81,16 +85,19 @@ class AfficherPhotoAction ...@@ -81,16 +85,19 @@ class AfficherPhotoAction
} else { } else {
$idnext = $id; $idnext = $id;
} }
$url['getImagePrev'] = "../img/$idprev"; $url['getImagePrev'] = "../img/$idprev";
$url['getImageNext'] = "../img/$idnext"; $url['getImageNext'] = "../img/$idnext";
$data['urls'] = $url; $data['urls'] = $url;
$data['photo'][] = ['titre' => $photo[0]->titre, 'imageUrl' => $photo[0]->imageUrl, 'idPhoto' => $photo[0]->id_photo, 'idGalerie' => $photo[0]->id_galerie, 'motscles' => $photo[0]->motsCles, 'date' => $photo[0]->date]; $data['photo'][] = ['titre' => $photo[0]->titre, 'imageUrl' => $photo[0]->imageUrl, 'idPhoto' => $photo[0]->id_photo, 'idGalerie' => $photo[0]->id_galerie, 'motscles' => $photo[0]->motsCles, 'date' => $photo[0]->date];
foreach ($commentaires as $comm) {
$data['commentaires'][] = ['id_commentaire' => $comm->id_commentaire, 'id_photo' => $comm->id_photo,'id_user' => $comm->id_user,'content' => $comm->content,'date' => $comm->date];
}
return $view->render($response, 'Photo.html.twig', $data); return $view->render($response, 'Photo.html.twig', $data);
}else { }else {
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
header("Location: $actual_link"); header("Location: $actual_link");
......
...@@ -6,49 +6,56 @@ ...@@ -6,49 +6,56 @@
<link href="../css/index.css" rel="stylesheet" type="text/css"> <link href="../css/index.css" rel="stylesheet" type="text/css">
</head> </head>
<div class="navi"> <div class="navi">
<nav> <nav>
<ul> <ul>
{% for url in nav %} {% for url in nav %}
{% if url.method == "GET" %} {% if url.method == "GET" %}
<li><a href="{{url.route}}">{{url.name}}</a></li> <li><a href="{{url.route}}">{{url.name}}</a></li>
{% elseif url.method == "POST" %} {% elseif url.method == "POST" %}
<li> <li>
<form method="POST" action="{{url.route}}"> <form method="POST" action="{{url.route}}">
<button type="submit">{{url.name}}</button> <button type="submit">{{url.name}}</button>
</form> </form>
</li> </li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</ul> </ul>
</nav> </nav>
</div>
<body>
<div>
{% if acces == 3 %}
<a class="btnn btnn-a" href="{{urls.getPhotoUpdate}}">Modifier la photo</a>
<a class="btnn btnn-a" href="{{urls.getPhotoDelete}}">Supprimer la photo</a>
{% endif %}
{% if acces == 2 %}
<a class="btnn btnn-a" href="{{urls.getPhotoUpdate}}">Modifier la photo</a>
<a class="btnn btnn-a" href="{{urls.getPhotoDelete}}">Supprimer la photo</a>
{% endif %}
<a class="btnn btnn-a" href="{{urls.getImagePrev}}">prev</a>
<a class="btnn btnn-a" href="{{urls.getImageNext}}">next</a>
</div> </div>
<body>
<div>
{% if acces == 3 %}
<a class="btnn btnn-a" href="{{urls.getPhotoUpdate}}">Modifier la photo</a>
<a class="btnn btnn-a" href="{{urls.getPhotoDelete}}">Supprimer la photo</a>
{% endif %}
{% if acces == 2 %}
<a class="btnn btnn-a" href="{{urls.getPhotoUpdate}}">Modifier la photo</a>
<a class="btnn btnn-a" href="{{urls.getPhotoDelete}}">Supprimer la photo</a>
{% endif %}
<a class="btnn btnn-a" href="{{urls.getImagePrev}}">prev</a>
<a class="btnn btnn-a" href="{{urls.getImageNext}}">next</a>
</div>
<div class="cardPhoto"> <div class="cardPhoto">
{% for picture in photo %} {% for picture in photo %}
<h1>{{ picture.titre }}</h1> <h1>{{ picture.titre }}</h1>
<div class="taillePhoto"> <div class="taillePhoto">
<img id="photoGrand" src="{{ picture.imageUrl }}" alt="photo"> <img id="photoGrand" src="{{ picture.imageUrl }}" alt="photo">
</div> </div>
<div class="photoInfos"> <div class="photoInfos">
<p>date d'ajout : {{ picture.date }}</p> <p>date d'ajout : {{ picture.date }}</p>
<p>mots clés : {{ picture.motscles }}</p> <p>mots clés : {{ picture.motscles }}</p>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
<div> <div id="comment" class="cardPhoto">
<h2>Commentaires</h2>
{% for comments in commentaires %}
<div class="contentMsg">
<p> {{ comments.id_user }}</p>
<p> {{ comments.content }}</p>
</div>
{% endfor %}
<form action="{{ urls.postMessage }}" method="post"> <form action="{{ urls.postMessage }}" method="post">
<div class="form-group"> <div class="form-group">
<input class="form-control" id="message-input-content" name="message-input-content" type="text" placeholder="Message"> <input class="form-control" id="message-input-content" name="message-input-content" type="text" placeholder="Message">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment