#33994 closed Cleanup/optimization (fixed)
wrong position of {% block extrastyle %} in admin/base.html
Reported by: | Maxim Danilov | Owned by: | Jay Patel |
---|---|---|---|
Component: | contrib.admin | Version: | 4.0 |
Severity: | Normal | Keywords: | admin, modeladmin, templates |
Cc: | Carlton Gibson | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
in admin/base.html
{% block extrastyle %}{% endblock %} goes before {% block responsive %}...{% endblock %}
i use extrastyle block to add my_extra.css styles to add extra css rules everywhere in admin.
This is logically correct.
But it works not correctly, because after in template exists other block with responsive.css or responsive_rtl.css.
I can override block responsive to add my extra styles behind all css. But the Name of block extrastyle says: it should be done here.
Probably we can change the position of extrastyle block, to made it as a last block_for_css in <header> of the admin/base.html?
.... <head> .... <-- not here {% block extrastyle %}{% endblock %} not here -- > .... {% block responsive %} .... {% endblock %} <-- here {% block extrastyle %}{% endblock %} here --> {% block blockbots %}...{% endblock %} <-- or here {% block extrastyle %}{% endblock %} or here -- > </head>
Change History (13)
follow-up: 2 comment:1 by , 2 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 2 years ago
Replying to Carlton Gibson:
OK, yes, this seems right. I would think both
extrastyle
andextrahead
would rightly be just before the</head>
. Let's take it for review and see if any issues are raised. Fancy doing a PR Maxim?
i am not sure that i able to do it, but it can be my first PR in Django :*-)
Right now i read about Submitting patches/Claiming”tickets.
comment:3 by , 2 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
I'm sure you are Maxim! Let's do it: I'm happy to help if you need it. 😀
Fork on GitHub. Make the change. Open a PR — we'll go from there.
comment:7 by , 2 years ago
Has patch: | set |
---|
comment:8 by , 2 years ago
Owner: | changed from | to
---|
comment:9 by , 2 years ago
Patch needs improvement: | set |
---|
comment:10 by , 2 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
comment:13 by , 2 years ago
Cc: | added |
---|---|
Easy pickings: | unset |
Has patch: | unset |
Triage Stage: | Ready for checkin → Accepted |
Patch was reverted as it introduced a regression, see #34081. It's not an "easy picking" as admin's CSS files rely strongly on on the current order. Maybe it's not worth the additional complexity.
OK, yes, this seems right. I would think both
extrastyle
andextrahead
would rightly be just before the</head>
. Let's take it for review and see if any issues are raised. Fancy doing a PR Maxim?