- Ajout d'une image par défaut lorsqu'il n'y en a aucune.

This commit is contained in:
2025-02-13 22:33:27 +01:00
parent 918c6fe6dc
commit da9e7057bc
2 changed files with 14 additions and 9 deletions

View File

@ -24,12 +24,15 @@
{% endif %}
</div>
<div class="flex">
<div class="flex flex-row w-1/4">
{% if book.volumeInfo.imageLinks is defined and book.volumeInfo.imageLinks.smallThumbnail is defined %}
<img src="{{ book.volumeInfo.imageLinks.smallThumbnail }}" class="p-2">
{% endif %}
</div>
<div class="w-9/12">
<div class="flex flex-row w-1/4">
{% if book.volumeInfo.imageLinks is defined and book.volumeInfo.imageLinks.smallThumbnail is defined %}
<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 %}
</div>
<div class="w-9/12">
{% if book.volumeInfo.publisher is defined %}
<p class="p-2 italic font-bold">Aux éditions :
<span class="font-normal">{{ book.volumeInfo.publisher }}</span>
@ -192,7 +195,7 @@
<script>
function toggleLike(idGoogle, liked, element, bookDetails) {
const url = liked
const url = liked
? "{{ path('unlike', {'idGoogle': 'PLACEHOLDER'}) }}".replace('PLACEHOLDER', idGoogle)
: "{{ path('like', {'idGoogle': 'PLACEHOLDER'}) }}".replace('PLACEHOLDER', idGoogle);