1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

changed to search landmark in filter sidebar in order to improve accessibility

This commit is contained in:
Ivan Castellano 2024-06-08 17:34:44 +02:00
parent adae619426
commit c08f018d15
2 changed files with 5 additions and 5 deletions

View File

@ -73,7 +73,7 @@
</div>
{% block filters %}
{% if cl.has_filters %}
<nav id="changelist-filter" aria-labelledby="changelist-filter-header">
<search id="changelist-filter" aria-labelledby="changelist-filter-header">
<h2 id="changelist-filter-header">{% translate 'Filter' %}</h2>
{% if cl.is_facets_optional or cl.has_active_filters %}<div id="changelist-filter-extra-actions">
{% if cl.is_facets_optional %}<h3>
@ -85,7 +85,7 @@
</h3>{% endif %}
</div>{% endif %}
{% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
</nav>
</search>
{% endif %}
{% endblock %}
</div>

View File

@ -873,7 +873,7 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
response = self.client.get(reverse("admin:admin_views_thing_changelist"))
self.assertContains(
response,
'<nav id="changelist-filter" aria-labelledby="changelist-filter-header">',
'<search id="changelist-filter" aria-labelledby="changelist-filter-header">',
msg_prefix="Expected filter not found in changelist view",
)
self.assertNotContains(
@ -928,7 +928,7 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
response = self.client.get(changelist_url)
self.assertContains(
response,
'<nav id="changelist-filter" aria-labelledby="changelist-filter-header">',
'<search id="changelist-filter" aria-labelledby="changelist-filter-header">',
)
filters = {
"chap__id__exact": {
@ -1068,7 +1068,7 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
)
self.assertContains(
response,
'<nav id="changelist-filter" aria-labelledby="changelist-filter-header">',
'<search id="changelist-filter" aria-labelledby="changelist-filter-header">',
)
self.assertContains(
response,