feat: changed TPV behaviour
This commit is contained in:
@@ -3,8 +3,7 @@
|
||||
<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 rounded-full px-1.5 py-2 text-l font-medium text-gray-900 focus:outline-none bg-white 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">
|
||||
<button>
|
||||
{% include 'components/icons/liked.svg' %}
|
||||
</button>
|
||||
</form>
|
||||
@@ -12,8 +11,7 @@
|
||||
<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 rounded-full px-1.5 py-2 text-l font-medium text-gray-900 focus:outline-none bg-white 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">
|
||||
<button>
|
||||
{% include 'components/icons/like.svg' %}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
{{ page }}
|
||||
|
||||
<ul class="mb-4 grid gap-4 sm:grid-cols-2 md:mb-8 lg:grid-cols-3 xl:grid-cols-4">
|
||||
{% for product in page %}
|
||||
<li>
|
||||
@@ -8,6 +10,7 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
|
||||
{% if has_previous_page %}
|
||||
<button type="button"
|
||||
class="rounded-lg border border-gray-200 bg-white px-5 py-2.5 text-sm font-medium text-gray-900
|
||||
|
||||
+3
-2
@@ -1,13 +1,14 @@
|
||||
from django.urls import path
|
||||
from django.conf.urls.i18n import i18n_patterns
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.urls import path
|
||||
from django.utils.text import gettext_lazy as _
|
||||
|
||||
from web.views.components import (
|
||||
cart,
|
||||
cart_dropdown,
|
||||
list_products,
|
||||
wishlist_button,
|
||||
list_wishlisted_products,
|
||||
wishlist_button,
|
||||
)
|
||||
from web.views.users import login, logout, my_account, register, reset_password
|
||||
from web.views.web import (
|
||||
|
||||
@@ -6,11 +6,11 @@ from django.views.generic import TemplateView
|
||||
from shop.filters import ProductFilter
|
||||
from shop.models import (
|
||||
CartItem,
|
||||
CustomerAddress,
|
||||
Product,
|
||||
ProductPrice,
|
||||
WishlistedProduct,
|
||||
CustomerAddress,
|
||||
ShippingMethod,
|
||||
WishlistedProduct,
|
||||
)
|
||||
from web.mixins import FilteredQuerysetMixin, PaginatedQuerysetMixin
|
||||
from web.settings import ANONYMOUS_CART_ID_COOKIE_NAME
|
||||
|
||||
+5
-5
@@ -2,17 +2,17 @@ from django.http.response import HttpResponse, JsonResponse
|
||||
from django.shortcuts import get_object_or_404, redirect, reverse
|
||||
from django.utils.text import gettext_lazy as _
|
||||
from django.views.decorators.http import require_http_methods
|
||||
from django.views.generic import TemplateView, CreateView
|
||||
from django.views.generic import CreateView, TemplateView
|
||||
|
||||
from shop.models import (
|
||||
CartItem,
|
||||
Product,
|
||||
ProductCategory,
|
||||
WishlistedProduct,
|
||||
CustomerAddress,
|
||||
ShippingMethod,
|
||||
Order,
|
||||
OrderLine,
|
||||
Product,
|
||||
ProductCategory,
|
||||
ShippingMethod,
|
||||
WishlistedProduct,
|
||||
)
|
||||
from shop.utils import create_order_from_cart
|
||||
from web.forms import CreateOrderForm
|
||||
|
||||
Reference in New Issue
Block a user