-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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 #32443 -- Removed "shifted" CSS class when admin's sidebar is disabled. #13986
Fixed #32443 -- Removed "shifted" CSS class when admin's sidebar is disabled. #13986
Conversation
@felixxm |
Hi @theSinner. I see you're new here, so I'll point you to the contributing guidelines. It looks like you're trying to fix a bug in the admin sidebar that was added in Django 3.1. The first thing is to create a ticket in the issue tracker clearly explaining the bug and how to reproduce it. In this case I would suggest attaching some screenshots as that will help a lot. |
Hi @pope1ni |
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.
@theSinner Thanks for this patch 👍 Can we add a small assertion? e.g.
diff --git a/tests/admin_views/test_nav_sidebar.py b/tests/admin_views/test_nav_sidebar.py
index b3d4955b19..0f2733f0ee 100644
--- a/tests/admin_views/test_nav_sidebar.py
+++ b/tests/admin_views/test_nav_sidebar.py
@@ -43,6 +43,7 @@ class AdminSidebarTests(TestCase):
def test_sidebar_disabled(self):
response = self.client.get(reverse('test_without_sidebar:index'))
+ self.assertContains(response, '<div class="main" id="main">')
self.assertNotContains(response, '<nav class="sticky" id="nav-sidebar">')
def test_sidebar_unauthenticated(self):
…lways false. Add assertion in the test_sidebar_not_on_index to make sure the main tag doesnt have the shifted class
buildbot, test on selenium. |
I was reading the |
@theSinner Thanks 👍 Welcome aboard ⛵ |
Hi
I faced an issue in disabling the nav-sidebar. When I disable the nav-sidebar using
admin.site.enable_nav_sidebar = False
, theshifted
class is still remaining, because this class is hard-coded in themain
tag. I remove the hard-coded class and add theshifted
class whenever we have theside-navbar
element on the page.