-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #35115 -- Made admin's footer render in <footer> tag. #17774
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Thank you for your contribution 💪
As it's your first contribution be sure to check out the patch review checklist.
If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!
If you have any design or process questions then you can ask in the Django forum.
Welcome aboard ⛵️!
</main> | ||
</div> | ||
{% block footer %}<footer id="footer"></footer>{% endblock %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we agreed on a different approach 🤔
{% block footer %}<footer id="footer"></footer>{% endblock %} | |
<footer id="footer">{% block footer %}{% endblock %}</footer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, I missed Thibaud's +1 on this decision. I disagree on this method for two reasons:
- It makes the footer element itself not overridable.
- The other elements, like the page header, also have the element defined within the block, so it feels more consistent to keep it that way.
Should we put this up for discussion here on in the ticket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes the footer element itself not overridable.
So, exactly the same as situation as with <main>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per Thibaud's comment it looks like we're doing folks a favor by forcing <footer>
here:
Is it clear enough to people who would override this, that with it outside main, they’d definitely need to use a
<footer>
tag? Otherwise their content would be outside a landmark (https://dequeuniversity.com/rules/axe/4.3/region).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put the block tags inside the element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can ask @thibaudcolas for the confirmation, if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's OK, either solution has pros and cons, I can understand enforcing the footer tags like this!
</main> | ||
</div> | ||
<footer id="footer">{% block footer %}{% endblock %}</footer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a small test? For example:
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index cb61c88941..429a79c062 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -1605,6 +1605,10 @@ 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">')
+
def test_aria_describedby_for_add_and_change_links(self):
response = self.client.get(reverse("admin:index"))
tests = [
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I added a test based on the existing header test!
Co-authored-by: Mariusz Felisiak <[email protected]>
@MHLut Thanks 👍 Welcome aboard ⛵ |
@felixxm Thank you for the help! Much appreciated. |
Fixes ticket #35115.
Important notes:
Puts the opening tags inside the block tags, also in the same style as the page header.clear
on the footer did nothing since the parent element is a flexbox.