diff options
| author | Marijke Luttekes <mail@marijkeluttekes.dev> | 2024-01-24 14:11:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-24 14:11:54 +0100 |
| commit | e412d85b4626bc56eb25206a40c3529162ce5dfc (patch) | |
| tree | 2b38ccc073014d0eb421cafac3f0d8227e80c635 | |
| parent | 0450c9bdf1773297c61b4e36850ab997ffd5dde2 (diff) | |
Fixed #35115 -- Made admin's footer render in <footer> tag.
| -rw-r--r-- | django/contrib/admin/static/admin/css/base.css | 5 | ||||
| -rw-r--r-- | django/contrib/admin/static/admin/css/responsive.css | 6 | ||||
| -rw-r--r-- | django/contrib/admin/templates/admin/base.html | 2 | ||||
| -rw-r--r-- | docs/releases/5.1.txt | 4 | ||||
| -rw-r--r-- | tests/admin_views/tests.py | 7 |
5 files changed, 13 insertions, 11 deletions
diff --git a/django/contrib/admin/static/admin/css/base.css b/django/contrib/admin/static/admin/css/base.css index daf4699cac..3a80e3a3c9 100644 --- a/django/contrib/admin/static/admin/css/base.css +++ b/django/contrib/admin/static/admin/css/base.css @@ -893,11 +893,6 @@ a.deletelink:focus, a.deletelink:hover { } } -#footer { - clear: both; - padding: 10px; -} - /* COLUMN TYPES */ .colMS { diff --git a/django/contrib/admin/static/admin/css/responsive.css b/django/contrib/admin/static/admin/css/responsive.css index b9553415d7..df426ed991 100644 --- a/django/contrib/admin/static/admin/css/responsive.css +++ b/django/contrib/admin/static/admin/css/responsive.css @@ -451,14 +451,10 @@ input[type="submit"], button { @media (max-width: 767px) { /* Layout */ - #header, #content, #footer { + #header, #content { padding: 15px; } - #footer:empty { - padding: 0; - } - div.breadcrumbs { padding: 10px 15px; } diff --git a/django/contrib/admin/templates/admin/base.html b/django/contrib/admin/templates/admin/base.html index 1ca50e508d..f01a7ab61c 100644 --- a/django/contrib/admin/templates/admin/base.html +++ b/django/contrib/admin/templates/admin/base.html @@ -108,9 +108,9 @@ <br class="clear"> </div> <!-- END Content --> - {% block footer %}<div id="footer"></div>{% endblock %} </main> </div> + <footer id="footer">{% block footer %}{% endblock %}</footer> </div> <!-- END Container --> diff --git a/docs/releases/5.1.txt b/docs/releases/5.1.txt index 0cf249f3cf..9e8ff8c049 100644 --- a/docs/releases/5.1.txt +++ b/docs/releases/5.1.txt @@ -348,6 +348,10 @@ Miscellaneous * In order to improve accessibility, the admin's changelist filter is now rendered in a ``<nav>`` tag instead of a ``<div>``. +* In order to improve accessibility, the admin's footer is now rendered in + a ``<footer>`` tag instead of a ``<div>``, and also moved below the + ``<div id="main">`` element. + * :meth:`.SimpleTestCase.assertURLEqual` and :meth:`~django.test.SimpleTestCase.assertInHTML` now add ``": "`` to the ``msg_prefix``. This is consistent with the behavior of other assertions. diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index cb61c88941..5877abf781 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -1605,6 +1605,13 @@ class AdminViewBasicTest(AdminViewBasicTestCase): '<main id="content-start" class="content" tabindex="-1">', ) + def test_footer(self): + response = self.client.get(reverse("admin:index")) + self.assertContains(response, '<footer id="footer">') + self.client.logout() + response = self.client.get(reverse("admin:login")) + self.assertContains(response, '<footer id="footer">') + def test_aria_describedby_for_add_and_change_links(self): response = self.client.get(reverse("admin:index")) tests = [ |
