fix: styling
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
id="theme-toggle"
|
||||
type="button"
|
||||
aria-label="switchtheme"
|
||||
class="text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none rounded-lg text-sm p-2.5 cursor-pointer">
|
||||
class="text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none rounded-lg text-sm p-4 cursor-pointer">
|
||||
{% include 'components/icons/moon.svg' %}
|
||||
{% include 'components/icons/sun.svg' %}
|
||||
</button>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<!-- Cart -->
|
||||
<div id="myCartDropdown1"
|
||||
class="absolute top-10 z-10 w-56 divide-y divide-gray-100 overflow-hidden overflow-y-auto rounded-lg bg-white antialiased shadow dark:divide-gray-600 dark:bg-gray-700 right-0 p-4 hidden"
|
||||
class="absolute top-12 z-10 w-65 divide-y divide-gray-100 overflow-hidden overflow-y-auto rounded-lg bg-white antialiased shadow dark:divide-gray-600 dark:bg-gray-700 right-0 p-4 hidden"
|
||||
>
|
||||
<div>
|
||||
{% if cart.items.count == 0 %}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
id="userDropdownButton1"
|
||||
data-dropdown-toggle="userDropdown1" type="button"
|
||||
aria-label="show menu"
|
||||
class="inline-flex items-center rounded-lg justify-center p-2 hover:bg-gray-100 dark:hover:bg-gray-700 text-sm font-medium leading-none text-gray-900 dark:text-white cursor-pointer">
|
||||
class="inline-flex items-center rounded-lg justify-center p-4 hover:bg-gray-100 dark:hover:bg-gray-700 text-sm font-medium leading-none text-gray-900 dark:text-white cursor-pointer">
|
||||
{% include 'components/icons/user.svg' %}
|
||||
<span class="hidden sm:flex">
|
||||
{% translate 'Mi cuenta' %}
|
||||
@@ -58,12 +58,12 @@
|
||||
|
||||
<!-- User account dropdown -->
|
||||
<div id="userDropdown1"
|
||||
class="absolute top-10 hidden z-10 w-56 divide-y divide-gray-100 overflow-hidden overflow-y-auto rounded-lg bg-white antialiased shadow dark:divide-gray-600 dark:bg-gray-700 right-0">
|
||||
class="absolute top-12 hidden z-12 w-56 divide-y divide-gray-100 overflow-hidden overflow-y-auto rounded-lg bg-white antialiased shadow dark:divide-gray-600 dark:bg-gray-700 right-0">
|
||||
{% include 'components/users/user_dropdown.html' %}
|
||||
</div>
|
||||
{% else %}
|
||||
<a href="{% url 'web:login' %}"
|
||||
class="inline-flex items-center rounded-lg justify-center p-2 hover:bg-gray-100 dark:hover:bg-gray-700 text-sm font-medium leading-none text-gray-900 dark:text-white">
|
||||
class="inline-flex items-center rounded-lg justify-center p-4 hover:bg-gray-100 dark:hover:bg-gray-700 text-sm font-medium leading-none text-gray-900 dark:text-white">
|
||||
Inicia sesión
|
||||
</a>
|
||||
{% endif %}
|
||||
@@ -73,7 +73,7 @@
|
||||
data-collapse-toggle="ecommerce-navbar-menu-1" aria-controls="ecommerce-navbar-menu-1"
|
||||
aria-expanded="false"
|
||||
aria-label="show menu"
|
||||
class="inline-flex lg:hidden items-center justify-center hover:bg-gray-100 rounded-md dark:hover:bg-gray-700 p-2 text-gray-900 dark:text-white cursor-pointer">
|
||||
class="inline-flex lg:hidden items-center justify-center hover:bg-gray-100 rounded-md dark:hover:bg-gray-700 p-4 text-gray-900 dark:text-white cursor-pointer">
|
||||
<span class="sr-only">
|
||||
{% translate 'Abrir menú' %}
|
||||
</span>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div>
|
||||
{% include 'components/products/list_filters.html' %}
|
||||
<section
|
||||
class="p-8"
|
||||
class="px-8"
|
||||
hx-get="
|
||||
{% url 'web:list_products' %}{% querystring request.GET %}{% if filter_by_category %}{% querystring category=category.id %}{% endif %}"
|
||||
hx-trigger="load"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
<ul class="mb-4 grid gap-4 sm:grid-cols-2 md:mb-8 lg:grid-cols-3 xl:grid-cols-4">
|
||||
<ul class="mb-4 grid gap-4 sm:grid-cols-2 md:mb-8 lg:grid-cols-3 xl:grid-cols-4 3xl:grid-cols-5">
|
||||
{% for product in page %}
|
||||
<li>
|
||||
{% include 'components/product_card.html' %}
|
||||
@@ -9,32 +9,37 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<div class="flex justify-center items-center">
|
||||
{% 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
|
||||
hover:bg-gray-100 hover:text-primary-700 focus:z-10 focus:outline-none focus:ring-4
|
||||
focus:ring-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700
|
||||
dark:hover:text-white dark:focus:ring-gray-700 cursor-pointer"
|
||||
hx-get="{% url 'web:list_products' %}{% querystring page=page.previous_page_number %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#products"
|
||||
hx-swap="innerHTML"
|
||||
>
|
||||
{% translate 'Anterior' %}
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if has_next_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
|
||||
hover:bg-gray-100 hover:text-primary-700 focus:z-10 focus:outline-none focus:ring-4
|
||||
focus:ring-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700
|
||||
dark:hover:text-white dark:focus:ring-gray-700 cursor-pointer"
|
||||
hx-get="{% url 'web:list_products' %}{% querystring page=page.next_page_number %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#products"
|
||||
hx-swap="innerHTML"
|
||||
>
|
||||
{% translate 'Siguiente' %}
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{% 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
|
||||
hover:bg-gray-100 hover:text-primary-700 focus:z-10 focus:outline-none focus:ring-4
|
||||
focus:ring-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700
|
||||
dark:hover:text-white dark:focus:ring-gray-700 cursor-pointer"
|
||||
hx-get="{% url 'web:list_products' %}{% querystring page=page.previous_page_number %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#products"
|
||||
hx-swap="innerHTML"
|
||||
>
|
||||
{% translate 'Anterior' %}
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if has_next_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
|
||||
hover:bg-gray-100 hover:text-primary-700 focus:z-10 focus:outline-none focus:ring-4
|
||||
focus:ring-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700
|
||||
dark:hover:text-white dark:focus:ring-gray-700 cursor-pointer"
|
||||
hx-get="{% url 'web:list_products' %}{% querystring page=page.next_page_number %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#products"
|
||||
hx-swap="innerHTML"
|
||||
>
|
||||
{% translate 'Siguiente' %}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
<span class="flex justify-center items-center text-lg text-gray-900 dark:text-gray-400 mt-4">
|
||||
{% blocktranslate %}Página {{ current_page }} de {{ num_pages }}{% endblocktranslate %}
|
||||
</span>
|
||||
|
||||
@@ -37,6 +37,8 @@ class ListProducts(TemplateView, FilteredQuerysetMixin, PaginatedQuerysetMixin):
|
||||
page = self.get_paginated_queryset(qs)
|
||||
|
||||
return {
|
||||
"current_page": page.number,
|
||||
"num_pages": page.paginator.num_pages,
|
||||
"page": page,
|
||||
"has_next_page": page.has_next(),
|
||||
"has_previous_page": page.has_previous(),
|
||||
|
||||
Reference in New Issue
Block a user