A11y: improve html-source with h3.sr-only for uncategorized products

This commit is contained in:
Richard Schreiber
2024-08-28 12:41:14 +02:00
parent c346e3a7f4
commit ed3fc15956
@@ -6,12 +6,12 @@
{% load eventsignal %}
{% load rich_text %}
{% for tup in items_by_category %}
<section {% if tup.0 %}aria-labelledby="category-{{ tup.0.id }}"{% else %}aria-label="{% trans "Uncategorized items" %}"{% endif %}{% if tup.0.description %} aria-describedby="category-info-{{ tup.0.id }}"{% endif %}>
{% if tup.0 %}
<h3 id="category-{{ tup.0.id }}">{{ tup.0.name }}</h3>
{% if tup.0.description %}
<div id="category-info-{{ tup.0.id }}">{{ tup.0.description|localize|rich_text }}</div>
{% endif %}
<section aria-labelledby="category-{{ tup.0.id|default:0 }}"{% if tup.0.description %} aria-describedby="category-info-{{ tup.0.id }}"{% endif %}>
<h3 id="category-{{ tup.0.id|default:0 }}"{% if not tup.0 %} class="sr-only"{% endif %}>
{% if tup.0 %}{{ tup.0.name }}{% else %}{% trans "Uncategorized items" %}{% endif %}
</h3>
{% if tup.0.description %}
<div id="category-info-{{ tup.0.id }}">{{ tup.0.description|localize|rich_text }}</div>
{% endif %}
{% for item in tup.1 %}
{% if item.has_variations %}