chore: merge development - resolve conflicts, keep .pyc files removed
Co-authored-by: dsaub <54474838+dsaub@users.noreply.github.com>
This commit is contained in:
@@ -51,12 +51,26 @@ p.price {
|
|||||||
background-color: #513CB0 !important;
|
background-color: #513CB0 !important;
|
||||||
color: #FFF;
|
color: #FFF;
|
||||||
}
|
}
|
||||||
|
.navbar.header .container-fluid {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
.navbar.header .navbar-brand img {
|
.navbar.header .navbar-brand img {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
.navbar.header .navbar-brand {
|
.navbar.header .navbar-brand {
|
||||||
color: #FFF !important;
|
color: #FFF !important;
|
||||||
}
|
}
|
||||||
|
.navbar.header .site-title-mobile {
|
||||||
|
color: #FFF;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
margin: 0;
|
||||||
|
max-width: calc(100% - 9rem);
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
.navbar.header .navbar-toggler {
|
.navbar.header .navbar-toggler {
|
||||||
border-color: #FFF !important;
|
border-color: #FFF !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,8 +79,8 @@
|
|||||||
</head>
|
</head>
|
||||||
<body class="d-flex flex-column min-vh-100">
|
<body class="d-flex flex-column min-vh-100">
|
||||||
{% cache 500 sidebar request.user.username %}
|
{% cache 500 sidebar request.user.username %}
|
||||||
<nav class="navbar navbar-expand-lg header" role="banner">
|
<nav class="navbar navbar-expand-md header" role="banner">
|
||||||
<div class="container-fluid align-items-center">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand" href="{% url 'home' %}">
|
<a class="navbar-brand" href="{% url 'home' %}">
|
||||||
<picture>
|
<picture>
|
||||||
<source
|
<source
|
||||||
@@ -96,23 +96,24 @@
|
|||||||
</picture>
|
</picture>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<span class="navbar-text fw-semibold ms-2 me-3 d-none d-xl-inline" style="color: #ffffff">Comercialmeria</span>
|
<span class="navbar-text fw-semibold site-title-mobile d-md-none">Comercialmeria</span>
|
||||||
|
|
||||||
<!-- Barra de búsqueda con sugerencias -->
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<form class="search-suggestions-container order-3 order-lg-0 w-100 w-lg-auto mt-2 mt-lg-0" method="GET" action="{% url 'search' %}" role="search" id="searchForm">
|
|
||||||
<div class="input-group">
|
|
||||||
<input class="form-control" type="search" name="q" id="searchInput" placeholder="Buscar productos..." aria-label="Buscar" autocomplete="off">
|
|
||||||
<button class="btn btn-outline-primary" type="submit">🔍</button>
|
|
||||||
</div>
|
|
||||||
<div class="search-suggestions" id="searchSuggestions"></div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<button class="navbar-toggler order-2 ms-2" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="collapse navbar-collapse order-4 order-lg-0 mt-2 mt-lg-0" id="navbarContent">
|
<div class="collapse navbar-collapse" id="navbarContent">
|
||||||
<div class="navbar-nav ms-lg-auto d-flex align-items-lg-center gap-2">
|
<span class="navbar-text fw-semibold me-3 d-none d-md-inline site-title-desktop" style="color: #ffffff">Comercialmeria</span>
|
||||||
|
<!-- Barra de búsqueda con sugerencias -->
|
||||||
|
<form class="search-suggestions-container" method="GET" action="{% url 'search' %}" role="search" id="searchForm">
|
||||||
|
<div class="input-group">
|
||||||
|
<input class="form-control" type="search" name="q" id="searchInput" placeholder="Buscar productos..." aria-label="Buscar" autocomplete="off">
|
||||||
|
<button class="btn btn-outline-primary" type="submit">🔍</button>
|
||||||
|
</div>
|
||||||
|
<div class="search-suggestions" id="searchSuggestions"></div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="navbar-nav ms-auto d-flex align-items-md-center gap-2 flex-wrap" role="navigation">
|
||||||
<a href="{% url 'view_cart' %}" class="nav-link position-relative btn btn-outline-primary btn-sm">
|
<a href="{% url 'view_cart' %}" class="nav-link position-relative btn btn-outline-primary btn-sm">
|
||||||
🛒 Carrito
|
🛒 Carrito
|
||||||
{% if cart_count > 0 %}
|
{% if cart_count > 0 %}
|
||||||
|
|||||||
@@ -118,6 +118,13 @@
|
|||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 767.98px) {
|
||||||
|
.hero-section h1 {
|
||||||
|
text-align: center;
|
||||||
|
text-wrap: balance;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,24 @@
|
|||||||
{% load vat_filters %}
|
{% load vat_filters %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
<div class="col-md-2 d-none d-lg-block">
|
<div class="col-12 d-lg-none mb-3">
|
||||||
<h5 class="categorias-titulo">Categorias</h5>
|
<button class="btn btn-outline-secondary" type="button" data-bs-toggle="collapse" data-bs-target="#mobileCategoriasCollapse" aria-expanded="false" aria-controls="mobileCategoriasCollapse">
|
||||||
|
Categorías
|
||||||
|
</button>
|
||||||
|
<div class="collapse mt-2" id="mobileCategoriasCollapse">
|
||||||
|
<ul class="list-group categorias-lista">
|
||||||
|
{% if categories %}
|
||||||
|
{% for category in categories %}
|
||||||
|
<li class="list-group-item categoria-item">
|
||||||
|
<a href="{% url 'categoria' category.id %}">{{ category.name }}</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-2 d-none d-lg-block">
|
||||||
|
<h5 class="categorias-titulo">Categorías</h5>
|
||||||
<ul class="list-group categorias-lista">
|
<ul class="list-group categorias-lista">
|
||||||
{% if categories %}
|
{% if categories %}
|
||||||
{% for category in categories %}
|
{% for category in categories %}
|
||||||
@@ -14,7 +30,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-md-10 grid">
|
<div class="col-12 col-lg-10 grid">
|
||||||
{% if products %}
|
{% if products %}
|
||||||
{% for producto in products %}
|
{% for producto in products %}
|
||||||
<div class="card card-producto mt-5" style="width: 18rem;">
|
<div class="card card-producto mt-5" style="width: 18rem;">
|
||||||
|
|||||||
+24
-18
@@ -1332,15 +1332,6 @@ class EndpointViewTests(TestCase):
|
|||||||
content_type="application/json",
|
content_type="application/json",
|
||||||
)
|
)
|
||||||
|
|
||||||
def _assert_navbar_responsive_structure(self, response):
|
|
||||||
content = response.content.decode()
|
|
||||||
search_form_index = content.find('id="searchForm"')
|
|
||||||
collapsed_menu_index = content.find('id="navbarContent"')
|
|
||||||
self.assertGreaterEqual(search_form_index, 0)
|
|
||||||
self.assertGreaterEqual(collapsed_menu_index, 0)
|
|
||||||
self.assertLess(search_form_index, collapsed_menu_index)
|
|
||||||
self.assertContains(response, "navbar navbar-expand-lg header")
|
|
||||||
|
|
||||||
def test_public_endpoints_render(self):
|
def test_public_endpoints_render(self):
|
||||||
public_routes = [
|
public_routes = [
|
||||||
reverse("home"),
|
reverse("home"),
|
||||||
@@ -1367,18 +1358,33 @@ class EndpointViewTests(TestCase):
|
|||||||
response = self.client.get(url)
|
response = self.client.get(url)
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
|
|
||||||
def test_navbar_search_is_visible_outside_collapsible_menu(self):
|
def test_index_shows_mobile_categories_toggle(self):
|
||||||
self._login(self.seller)
|
response = self.client.get(reverse("index"))
|
||||||
response = self.client.get(reverse("home"))
|
|
||||||
self.assertEqual(response.status_code, 200)
|
|
||||||
self._assert_navbar_responsive_structure(response)
|
|
||||||
self.assertContains(response, "Cerrar Sesión")
|
|
||||||
|
|
||||||
def test_navbar_search_structure_is_kept_for_anonymous_users(self):
|
self.assertEqual(response.status_code, 200)
|
||||||
|
self.assertContains(response, 'data-bs-target="#mobileCategoriasCollapse"')
|
||||||
|
self.assertContains(response, 'id="mobileCategoriasCollapse"')
|
||||||
|
self.assertContains(response, ">Categorías<")
|
||||||
|
def test_home_header_renders_mobile_title_outside_collapsible_menu(self):
|
||||||
response = self.client.get(reverse("home"))
|
response = self.client.get(reverse("home"))
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self._assert_navbar_responsive_structure(response)
|
self.assertContains(response, 'site-title-mobile d-md-none')
|
||||||
self.assertContains(response, "Iniciar Sesión")
|
self.assertContains(response, 'site-title-desktop')
|
||||||
|
def test_home_mobile_welcome_title_centered(self):
|
||||||
|
response = self.client.get(reverse("home"))
|
||||||
|
html = response.content.decode()
|
||||||
|
media_idx = html.find("@media (max-width: 767.98px)")
|
||||||
|
self.assertNotEqual(media_idx, -1)
|
||||||
|
|
||||||
|
rule_idx = html.find(".hero-section h1", media_idx)
|
||||||
|
self.assertNotEqual(rule_idx, -1)
|
||||||
|
|
||||||
|
block_end_idx = html.find("}", rule_idx)
|
||||||
|
self.assertNotEqual(block_end_idx, -1)
|
||||||
|
rule_block = html[rule_idx:block_end_idx]
|
||||||
|
|
||||||
|
self.assertIn("text-align: center", rule_block)
|
||||||
|
self.assertIn("text-wrap: balance", rule_block)
|
||||||
|
|
||||||
def test_login_required_endpoints_redirect_anonymous(self):
|
def test_login_required_endpoints_redirect_anonymous(self):
|
||||||
secured_get_routes = [
|
secured_get_routes = [
|
||||||
|
|||||||
Reference in New Issue
Block a user