1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 19:26:48 +00:00

fix(templates): icon-only buttons, selects and delete pages have accessible names

An accessibility scan (axe-core, WCAG 2 A/AA) of every page found 87
elements without a name. Icon-only buttons and links (the navbar's
administration menu on every page, the add/create buttons, the flavor
delete and back buttons) get a title, which is also their tooltip; the
labels of the language, architecture, chipset and filter selects point
at them; the memory bar is named. The shared delete confirmation page
had an empty <title> and heading, as no view passes "title": it says
"Delete <object>". The power-off form's aria-label was misspelled.
This commit is contained in:
catborise 2026-10-19 16:07:11 +03:00
parent ea7030d2a1
commit 64057f8d05
21 changed files with 28 additions and 26 deletions

View file

@ -6,7 +6,7 @@
{% block content %}
<div class="row">
<div class="col-lg-12">
<a href="{% url 'admin:group_create' %}" class="btn btn-success btn-header float-end">
<a href="{% url 'admin:group_create' %}" class="btn btn-success btn-header float-end" title="{% trans "Create Group" %}">
{% bs_icon 'plus-circle-fill' %}
</a>
{% include 'search_block.html' %}

View file

@ -9,7 +9,7 @@
{% block page_heading %}{{ title }}{% endblock page_heading %}
{% block page_heading_extra %}
<a href="{% url 'admin:user_create' %}" class="btn btn-success btn-header float-end">
<a href="{% url 'admin:user_create' %}" class="btn btn-success btn-header float-end" title="{% trans "Create User" %}">
{% bs_icon 'plus-circle-fill' %}
</a>
{% include 'search_block.html' %}

View file

@ -39,6 +39,8 @@ class AdminTestCase(TestCase):
response = self.client.get(reverse("admin:group_delete", args=[group_id]))
self.assertEqual(response.status_code, 200)
# the shared confirmation page names what it deletes
self.assertContains(response, "<title>Delete Updated Group Test</title>", html=True)
response = self.client.post(reverse("admin:group_delete", args=[group_id]))
self.assertRedirects(response, reverse("admin:group_list"))