- Ajout de la table Favoris.

- Relation entre user et favoris en onetomany.
This commit is contained in:
2025-01-29 15:18:01 +01:00
parent 74288b17a9
commit c20f3bc933
5 changed files with 145 additions and 2 deletions

View File

@ -4,7 +4,6 @@
{% block body %}
<div>
<div class="w-1/2 py-2 flex flex-col justify-center mt-5 mx-auto">
<h1 class="text-2xl font-bold">Recherche de livre pour : {{ query }}</h1>
@ -41,7 +40,11 @@
</div>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
class="absolute top-2 right-2 w-6 h-6 cursor-pointer">
class="absolute top-2 right-2 w-6 h-6 cursor-pointer transition-colors duration-300"
x-data="{ liked: false }"
:fill="liked ? 'red' : 'none'"
:stroke="liked ? 'red' : 'currentColor'"
@click="liked = !liked">
<path stroke-linecap="round" stroke-linejoin="round"
d="M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12Z"/>
</svg>

View File

@ -23,5 +23,7 @@
{% endblock %}
{% block body %}{% endblock %}
</div>
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>
</body>
</html>