Skip to content

Commit

Permalink
Fixed #35115 -- Made admin's footer render in <footer> tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
MHLut committed Jan 24, 2024
1 parent 0450c9b commit e412d85
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
5 changes: 0 additions & 5 deletions django/contrib/admin/static/admin/css/base.css
Expand Up @@ -893,11 +893,6 @@ a.deletelink:focus, a.deletelink:hover {
}
}

#footer {
clear: both;
padding: 10px;
}

/* COLUMN TYPES */

.colMS {
Expand Down
6 changes: 1 addition & 5 deletions django/contrib/admin/static/admin/css/responsive.css
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/admin/templates/admin/base.html
Expand Up @@ -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 -->

Expand Down
4 changes: 4 additions & 0 deletions docs/releases/5.1.txt
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions tests/admin_views/tests.py
Expand Up @@ -1605,6 +1605,13 @@ def test_main_content(self):
'<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 = [
Expand Down

0 comments on commit e412d85

Please sign in to comment.