diff --git a/.github/workflows/runtests.yml b/.github/workflows/runtests.yml index 3948413..411272a 100644 --- a/.github/workflows/runtests.yml +++ b/.github/workflows/runtests.yml @@ -19,6 +19,7 @@ jobs: - name: Run tests env: DJANGO_SETTINGS_MODULE: config.settings + DEBUG: True run: pytest --cov && coverage xml - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4.0.1 diff --git a/config/settings/base.py b/config/settings/base.py index ea595fc..afce2dd 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -219,5 +219,3 @@ SIMPLE_JWT = { } TAILWIND_APP_NAME = "theme" - -ITEMS_PER_PAGE = 10 diff --git a/config/settings/environ.py b/config/settings/environ.py index 106b14c..d0bc024 100644 --- a/config/settings/environ.py +++ b/config/settings/environ.py @@ -48,3 +48,5 @@ REDSYS_MERCHANT_CODE = env.str("REDSYS_MERCHANT_CODE", "999008881") REDSYS_TERMINAL = env.str("REDSYS_TERMINAL", "001") REDSYS_CURRENCY_CODE = env.str("REDSYS_CURRENCY_CODE", "978") REDSYS_TPV_DOMAIN = env.str("REDSYS_TPV_DOMAIN", "") + +ITEMS_PER_PAGE = env.int("ITEMS_PER_PAGE", 10) diff --git a/requirements.txt b/requirements.txt index 7ee39fb..b205331 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ boto3==1.34.105 celery==5.4.0 -django==5.0.6 +django==5.1.3 django-cors-headers==3.13.0 django-cryptography==1.1 -django-debug-toolbar==3.7.0 +django-debug-toolbar==4.4.6 django-extensions==3.2.0 django-filter==23.1 django-environ==0.10.0 @@ -13,13 +13,13 @@ django-storages==1.13.2 django-tailwind==3.8.0 django-unfold==0.12.0 dj-database-url==1.0.0 -djangorestframework-simplejwt==5.3.0 +djangorestframework-simplejwt==5.3.1 drf-spectacular==0.26.1 ipython==8.16.1 Pillow==10.0.1 psycopg2-binary==2.9.9 pyDes==2.0.1 redis==4.5.4 -requests==2.31.0 +requests==2.32.3 uvicorn==0.21.1 xmltodict==0.13.0 diff --git a/shop/filters.py b/shop/filters.py index 0ac0faa..47fbd10 100644 --- a/shop/filters.py +++ b/shop/filters.py @@ -5,6 +5,9 @@ from shop.models import Product class ProductFilter(django_filters.FilterSet): + name = django_filters.CharFilter( + field_name="name", lookup_expr="icontains", label=_("Nombre") + ) tags = django_filters.BaseInFilter(field_name="tags", label=_("Etiquetas")) class Meta: diff --git a/shop/templates/components/products/list_filters.html b/shop/templates/components/products/list_filters.html new file mode 100644 index 0000000..759e0e0 --- /dev/null +++ b/shop/templates/components/products/list_filters.html @@ -0,0 +1,34 @@ +
+
+
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+
diff --git a/shop/templates/shop/index.html b/shop/templates/shop/index.html index ef36639..4852db2 100644 --- a/shop/templates/shop/index.html +++ b/shop/templates/shop/index.html @@ -3,7 +3,30 @@ {% load static %} {% block main %} -
- -
+
+ {% include 'components/products/list_filters.html' %} +
+
+
+
+
+ +
+
+
+
{% endblock %} diff --git a/shop/templates/shop/list_products.html b/shop/templates/shop/list_products.html index de9b3ad..84fa387 100644 --- a/shop/templates/shop/list_products.html +++ b/shop/templates/shop/list_products.html @@ -1,21 +1,5 @@ -{% extends 'theme/base.html' %} - +{% load i18n %} {% load static %} - -{% block main %} -
-
-
- {% for product in products %} - {% include 'components/product_card.html' %} - {% endfor %} -
- -
-
-
-
-{% endblock %} +{% for product in products %} + {% include 'components/product_card.html' %} +{% endfor %} diff --git a/theme/templates/theme/base.html b/theme/templates/theme/base.html index 4e3614f..efb3fdb 100644 --- a/theme/templates/theme/base.html +++ b/theme/templates/theme/base.html @@ -12,8 +12,8 @@ {% block extra_js %} {% endblock %} - -
+ +
{% block main %} {% endblock %}