Make product cards fully clickable
All checks were successful
Build and Push Docker Image / build (push) Successful in 27s
All checks were successful
Build and Push Docker Image / build (push) Successful in 27s
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
{% url 'detail' item.category.slug item.slug as item_url %}
|
||||
<article class="item-card{% if item.id in favorite_item_ids %} is-favorite{% endif %}" data-item-card="{{ item.id }}">
|
||||
<a class="item-card-media-link" href="{% url 'detail' item.category.slug item.slug %}" aria-label="Открыть товар {{ item.name }}">
|
||||
<a class="item-card-overlay" href="{{ item_url }}" aria-label="Открыть товар {{ item.name }}" tabindex="-1" aria-hidden="true"></a>
|
||||
<a class="item-card-media-link" href="{{ item_url }}" aria-label="Открыть товар {{ item.name }}">
|
||||
{% with primary_image=item.primary_image %}
|
||||
<div class="item-card-image">
|
||||
{% if primary_image %}
|
||||
@@ -44,7 +46,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<a class="item-card-title-link" href="{% url 'detail' item.category.slug item.slug %}" aria-label="Открыть товар {{ item.name }}">
|
||||
<a class="item-card-title-link" href="{{ item_url }}" aria-label="Открыть товар {{ item.name }}">
|
||||
<h2 class="item-card-title">{{ item.name }}</h2>
|
||||
</a>
|
||||
<div class="item-card-footer">
|
||||
|
||||
@@ -104,15 +104,17 @@
|
||||
</h2>
|
||||
{% for sale_item in sidebar_sale_items %}
|
||||
<div class="sidebar-mini-card">
|
||||
{% url 'detail' sale_item.category.slug sale_item.slug as sale_item_url %}
|
||||
<a class="sidebar-mini-card__overlay" href="{{ sale_item_url }}" aria-label="Открыть товар {{ sale_item.name }}" tabindex="-1" aria-hidden="true"></a>
|
||||
{% with img=sale_item.primary_image %}
|
||||
{% if img %}
|
||||
<a href="{% url 'detail' sale_item.category.slug sale_item.slug %}" class="sidebar-mini-card__img-link">
|
||||
<a href="{{ sale_item_url }}" class="sidebar-mini-card__img-link">
|
||||
<img src="{{ img.image.url }}" alt="{{ img.alt|default:sale_item.name }}">
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
<div class="sidebar-mini-card__body">
|
||||
<a href="{% url 'detail' sale_item.category.slug sale_item.slug %}" class="sidebar-mini-card__name">{{ sale_item.name }}</a>
|
||||
<a href="{{ sale_item_url }}" class="sidebar-mini-card__name">{{ sale_item.name }}</a>
|
||||
<span class="sidebar-mini-card__price">{{ sale_item.display_price }} руб.</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -130,15 +132,17 @@
|
||||
</h2>
|
||||
{% for new_item in sidebar_new_items %}
|
||||
<div class="sidebar-mini-card">
|
||||
{% url 'detail' new_item.category.slug new_item.slug as new_item_url %}
|
||||
<a class="sidebar-mini-card__overlay" href="{{ new_item_url }}" aria-label="Открыть товар {{ new_item.name }}" tabindex="-1" aria-hidden="true"></a>
|
||||
{% with img=new_item.primary_image %}
|
||||
{% if img %}
|
||||
<a href="{% url 'detail' new_item.category.slug new_item.slug %}" class="sidebar-mini-card__img-link">
|
||||
<a href="{{ new_item_url }}" class="sidebar-mini-card__img-link">
|
||||
<img src="{{ img.image.url }}" alt="{{ img.alt|default:new_item.name }}">
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
<div class="sidebar-mini-card__body">
|
||||
<a href="{% url 'detail' new_item.category.slug new_item.slug %}" class="sidebar-mini-card__name">{{ new_item.name }}</a>
|
||||
<a href="{{ new_item_url }}" class="sidebar-mini-card__name">{{ new_item.name }}</a>
|
||||
<span class="sidebar-mini-card__price">{{ new_item.display_price }} руб.</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user