A11y: improve/unify html-source for uncategorized products

This commit is contained in:
Richard Schreiber
2024-08-28 14:35:35 +02:00
committed by GitHub
parent 9ead82839a
commit 0c1072503c

View File

@@ -6,12 +6,15 @@
{% load eventsignal %} {% load eventsignal %}
{% load rich_text %} {% load rich_text %}
{% for tup in items_by_category %} {% 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 %} {% if tup.0 %}
<section aria-labelledby="category-{{ tup.0.id }}"{% if tup.0.description %} aria-describedby="category-info-{{ tup.0.id }}"{% endif %}>
<h3 id="category-{{ tup.0.id }}">{{ tup.0.name }}</h3> <h3 id="category-{{ tup.0.id }}">{{ tup.0.name }}</h3>
{% if tup.0.description %} {% if tup.0.description %}
<div id="category-info-{{ tup.0.id }}">{{ tup.0.description|localize|rich_text }}</div> <div id="category-info-{{ tup.0.id }}">{{ tup.0.description|localize|rich_text }}</div>
{% endif %} {% endif %}
{% else %}
<section aria-labelledby="category-none">
<h3 id="category-none" class="sr-only">{% trans "Uncategorized items" %}</h3>
{% endif %} {% endif %}
{% for item in tup.1 %} {% for item in tup.1 %}
{% if item.has_variations %} {% if item.has_variations %}