#32443: Remove "shifted" class from main when nav-sidebar is disabled.
-------------------------------------+-------------------------------------
Reporter: Amir Ajorloo | Owner: Amir
Type: | Ajorloo
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 3.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):
* has_patch: 0 => 1
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted
Old description:
> 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:
> [[Image(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:
> [[Image(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):
> [[Image(https://code.djangoproject.com/raw-
> attachment/ticket/32443/Screen%20Shot%202021-02-11%20at%2020.05.37.png)]]
New description:
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:
[[Image(https://code.djangoproject.com/raw-
attachment/ticket/32443/Screen%20Shot%202021-02-11%20at%2020.05.07.png,
80%)]]
In this screenshot, the nav-sidebar is enabled but it's close and the main
tag doesn’t have the shifted class:
[[Image(https://code.djangoproject.com/raw-
attachment/ticket/32443/Screen%20Shot%202021-02-11%20at%2020.05.19.png,
80%)]]
Bug
In this screenshot, the nav-sidebar is disabled, but the main tag has
shifted class (but it shouldn't):
[[Image(https://code.djangoproject.com/raw-
attachment/ticket/32443/Screen%20Shot%202021-02-11%20at%2020.05.37.png,
80%)]]
--
Comment:
[https://github.com/django/django/pull/13986 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/32443#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.309579d2a6ad02df56a3ae769463d875%40djangoproject.com.