feat: wishlist
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
{% load i18n %}
|
||||
{% if is_wishlisted %}
|
||||
<form action="" hx-post="{% url 'web:delete_from_wishlist' pk=product.pk %}" hx-swap="none">
|
||||
<input type="hidden" name="product" value="{{ product.pk }}">
|
||||
{% csrf_token %}
|
||||
<button class="flex items-center justify-center py-2.5 px-5 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-primary-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700">
|
||||
{% include 'components/icons/like.svg' %}
|
||||
{% translate 'Quitar de la lista de deseados' %}
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form action="" hx-post="{% url 'web:add_to_wishlist' %}" hx-swap="none">
|
||||
<input type="hidden" name="product" value="{{ product.pk }}">
|
||||
{% csrf_token %}
|
||||
<button class="flex items-center justify-center py-2.5 px-5 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-primary-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700">
|
||||
{% include 'components/icons/like.svg' %}
|
||||
{% translate 'Añadir a lista de deseados' %}
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
@@ -51,15 +51,11 @@
|
||||
</div>
|
||||
|
||||
<div class="my-4 sm:gap-4 sm:items-center sm:flex sm:m-8">
|
||||
<a
|
||||
href="#"
|
||||
title=""
|
||||
class="flex items-center justify-center py-2.5 px-5 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-primary-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700"
|
||||
role="button"
|
||||
>
|
||||
{% include 'components/icons/like.svg' %}
|
||||
{% translate 'Añadir a lista de deseados' %}
|
||||
</a>
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
<div hx-get="{% url 'web:wishlist_button' pk=product.pk %}" hx-trigger="load, updated-wishlist">
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% include 'components/cart/add_to_cart.html' %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user