Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
85b5c6eb91 | |||
da9e7057bc | |||
918c6fe6dc | |||
e624949fc3 |
@ -1,28 +0,0 @@
|
|||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
const datas = {{ datas | tojson }};
|
|
||||||
|
|
||||||
datas.items.forEach((book, index) => {
|
|
||||||
const openModalBtn = document.getElementById(`openModalBtn-${index + 1}`);
|
|
||||||
const closeModalSvg = document.getElementById(`closeModalSvg-${index + 1}`);
|
|
||||||
const closeModalBtn = document.getElementById(`closeModalBtn-${index + 1}`);
|
|
||||||
const modal = document.getElementById(`myModal-${index + 1}`);
|
|
||||||
|
|
||||||
if (openModalBtn) {
|
|
||||||
openModalBtn.addEventListener('click', () => {
|
|
||||||
modal.classList.remove('hidden');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (closeModalSvg) {
|
|
||||||
closeModalSvg.addEventListener('click', () => {
|
|
||||||
modal.classList.add('hidden');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (closeModalBtn) {
|
|
||||||
closeModalBtn.addEventListener('click', () => {
|
|
||||||
modal.classList.add('hidden');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
BIN
public/img/logo-cropped.ico
Normal file
BIN
public/img/logo-cropped.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
@ -66,6 +66,7 @@ class RegistrationController extends AbstractController
|
|||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
$this->addFlash('success', 'Votre compte a été créé avec succès !');
|
$this->addFlash('success', 'Votre compte a été créé avec succès !');
|
||||||
|
|
||||||
return $this->redirectToRoute('home');
|
return $this->redirectToRoute('home');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,9 +39,13 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||||||
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Favoris::class)]
|
#[ORM\OneToMany(mappedBy: 'user', targetEntity: Favoris::class)]
|
||||||
private Collection $favoris;
|
private Collection $favoris;
|
||||||
|
|
||||||
|
#[ORM\OneToMany(mappedBy: 'id_user', targetEntity: Avis::class)]
|
||||||
|
private Collection $avis;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->favoris = new ArrayCollection();
|
$this->favoris = new ArrayCollection();
|
||||||
|
$this->avis = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -169,4 +173,34 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Collection<int, Avis>
|
||||||
|
*/
|
||||||
|
public function getAvis(): Collection
|
||||||
|
{
|
||||||
|
return $this->avis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addAvi(Avis $avi): static
|
||||||
|
{
|
||||||
|
if (!$this->avis->contains($avi)) {
|
||||||
|
$this->avis->add($avi);
|
||||||
|
$avi->setIdUser($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeAvi(Avis $avi): static
|
||||||
|
{
|
||||||
|
if ($this->avis->removeElement($avi)) {
|
||||||
|
// set the owning side to null (unless already changed)
|
||||||
|
if ($avi->getIdUser() === $this) {
|
||||||
|
$avi->setIdUser(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,6 +170,7 @@
|
|||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"assets/app.js",
|
"assets/app.js",
|
||||||
|
"assets/js/modal.js",
|
||||||
"assets/styles/app.css",
|
"assets/styles/app.css",
|
||||||
"config/packages/webpack_encore.yaml",
|
"config/packages/webpack_encore.yaml",
|
||||||
"package.json",
|
"package.json",
|
||||||
|
@ -24,12 +24,15 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="flex flex-row w-1/4">
|
<div class="flex flex-row w-1/4">
|
||||||
{% if book.volumeInfo.imageLinks is defined and book.volumeInfo.imageLinks.smallThumbnail is defined %}
|
{% if book.volumeInfo.imageLinks is defined and book.volumeInfo.imageLinks.smallThumbnail is defined %}
|
||||||
<img src="{{ book.volumeInfo.imageLinks.smallThumbnail }}" class="p-2">
|
<img src="{{ book.volumeInfo.imageLinks.smallThumbnail }}" class="p-2 w-[200px] h-[250] object-cover">
|
||||||
{% endif %}
|
{% else %}
|
||||||
</div>
|
<img src="https://fakeimg.pl/550x750?text=no+cover" class="p-2 object-cover">
|
||||||
<div class="w-9/12">
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="w-9/12">
|
||||||
{% if book.volumeInfo.publisher is defined %}
|
{% if book.volumeInfo.publisher is defined %}
|
||||||
<p class="p-2 italic font-bold">Aux éditions :
|
<p class="p-2 italic font-bold">Aux éditions :
|
||||||
<span class="font-normal">{{ book.volumeInfo.publisher }}</span>
|
<span class="font-normal">{{ book.volumeInfo.publisher }}</span>
|
||||||
@ -192,7 +195,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
function toggleLike(idGoogle, liked, element, bookDetails) {
|
function toggleLike(idGoogle, liked, element, bookDetails) {
|
||||||
const url = liked
|
const url = liked
|
||||||
? "{{ path('unlike', {'idGoogle': 'PLACEHOLDER'}) }}".replace('PLACEHOLDER', idGoogle)
|
? "{{ path('unlike', {'idGoogle': 'PLACEHOLDER'}) }}".replace('PLACEHOLDER', idGoogle)
|
||||||
: "{{ path('like', {'idGoogle': 'PLACEHOLDER'}) }}".replace('PLACEHOLDER', idGoogle);
|
: "{{ path('like', {'idGoogle': 'PLACEHOLDER'}) }}".replace('PLACEHOLDER', idGoogle);
|
||||||
|
|
||||||
@ -265,6 +268,8 @@ document.querySelectorAll('.like-button').forEach(button => {
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
<div id="myModal-{{ loop.index }}" class="fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center hidden z-50">
|
<div id="myModal-{{ loop.index }}" class="fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center hidden z-50">
|
||||||
<div class="relative bg-white p-6 rounded-lg w-1/3 max-h-screen overflow-y-auto">
|
<div class="relative bg-white p-6 rounded-lg w-1/3 max-h-screen overflow-y-auto">
|
||||||
<div class="flex mx-auto flex-row w-1/4">
|
<div class="flex flex-row w-1/4">
|
||||||
{% if book.volumeInfo.imageLinks is defined and book.volumeInfo.imageLinks.smallThumbnail is defined %}
|
{% if book.volumeInfo.imageLinks is defined and book.volumeInfo.imageLinks.smallThumbnail is defined %}
|
||||||
<img src="{{ book.volumeInfo.imageLinks.smallThumbnail }}" class="p-2">
|
<img src="{{ book.volumeInfo.imageLinks.smallThumbnail }}" class="p-2 w-[200px] h-[250] object-cover">
|
||||||
|
{% else %}
|
||||||
|
<img src="https://fakeimg.pl/550x750?text=no+cover" class="p-2 object-cover">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<svg id="closeModalSvg-{{ loop.index }}" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
<svg id="closeModalSvg-{{ loop.index }}" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
{% block title %}Bienvenue!
|
{% block title %}Bienvenue!
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</title>
|
</title>
|
||||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text></svg>">
|
<link rel="icon" href="{{ asset('img/logo-cropped.ico') }}" type="image/x-icon"/>
|
||||||
{% block stylesheets %}
|
{% block stylesheets %}
|
||||||
{{ encore_entry_link_tags('app') }}
|
{{ encore_entry_link_tags('app') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Reference in New Issue
Block a user