Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#32443 closed Cleanup/optimization (fixed)

Remove "shifted" class from main when nav-sidebar is disabled.

Reported by: Amir Ajorloo Owned by: Amir Ajorloo
Component: contrib.admin Version: 3.1
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description (last modified by Mariusz Felisiak)

I faced an issue in disabling the nav-sidebar. When I disable the nav-sidebar using ‍‍‍admin.site.enable_nav_sidebar = False, the shifted class is still remaining, because this class is hard-coded in the main tag. Currently check both of shifted class of the main tag and the existence of the nav-sidebar together to apply the styles, but it can be more simple and prevent issues happening in the third-party modules.

In the below screenshot, the nav-sidebar is enabled and it's open. So the main tag should have the shifted class to move its content to right:
https://code.djangoproject.com/raw-attachment/ticket/32443/Screen%20Shot%202021-02-11%20at%2020.05.07.png

In this screenshot, the nav-sidebar is enabled but it's close and the main tag doesn’t have the shifted class:
https://code.djangoproject.com/raw-attachment/ticket/32443/Screen%20Shot%202021-02-11%20at%2020.05.19.png

Bug
In this screenshot, the nav-sidebar is disabled, but the main tag has shifted class (but it shouldn't):
https://code.djangoproject.com/raw-attachment/ticket/32443/Screen%20Shot%202021-02-11%20at%2020.05.37.png

Attachments (3)

Screen Shot 2021-02-11 at 20.05.07.png (101.6 KB ) - added by Amir Ajorloo 4 years ago.
opened nav side bar
Screen Shot 2021-02-11 at 20.05.19.png (94.5 KB ) - added by Amir Ajorloo 4 years ago.
closed nav side bar
Screen Shot 2021-02-11 at 20.05.37.png (82.4 KB ) - added by Amir Ajorloo 4 years ago.
disabled nav side bar

Download all attachments as: .zip

Change History (11)

by Amir Ajorloo, 4 years ago

opened nav side bar

by Amir Ajorloo, 4 years ago

closed nav side bar

by Amir Ajorloo, 4 years ago

disabled nav side bar

comment:1 by Amir Ajorloo, 4 years ago

Description: modified (diff)
Owner: changed from nobody to Amir Ajorloo
Status: newassigned

comment:2 by Amir Ajorloo, 4 years ago

Type: UncategorizedBug
UI/UX: set

comment:3 by Amir Ajorloo, 4 years ago

Description: modified (diff)

comment:4 by Amir Ajorloo, 4 years ago

Component: Uncategorizedcontrib.admin

comment:5 by Mariusz Felisiak, 4 years ago

Description: modified (diff)
Has patch: set
Summary: Remove shifted class from main when nav-sidebar is disabled.Remove "shifted" class from main when nav-sidebar is disabled.
Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization

comment:6 by Mariusz Felisiak, 4 years ago

Needs tests: set
Patch needs improvement: set

comment:7 by GitHub <noreply@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In 1710cdbe:

Fixed #32443 -- Removed "shifted" CSS class when admin's sidebar is disabled.

comment:8 by Mariusz Felisiak, 4 years ago

Needs tests: unset
Patch needs improvement: unset
Note: See TracTickets for help on using tickets.
Back to Top