Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#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)

comment:1 by Carlton Gibson, 2 years ago

Triage Stage: UnreviewedAccepted

OK, yes, this seems right. I would think both extrastyle and extrahead 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?

in reply to:  1 comment:2 by Maxim Danilov, 2 years ago

Replying to Carlton Gibson:

OK, yes, this seems right. I would think both extrastyle and extrahead 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 Carlton Gibson, 2 years ago

Owner: changed from nobody to Maxim Danilov
Status: newassigned

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:4 by jay patel, 2 years ago

Hi Maxim, Can I work on this ticket ?

Version 0, edited 2 years ago by jay patel (next)

comment:5 by Jay Patel, 2 years ago

Hi Maxim, Can I work on this ticket ?

comment:7 by Carlton Gibson, 2 years ago

Has patch: set

comment:8 by Mariusz Felisiak, 2 years ago

Owner: changed from Maxim Danilov to Jay Patel

comment:9 by Mariusz Felisiak, 2 years ago

Patch needs improvement: set

comment:10 by Mariusz Felisiak, 2 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:11 by GitHub <noreply@…>, 2 years ago

Resolution: fixed
Status: assignedclosed

In a69b0e9c:

Fixed #33994 -- Corrected position of extrastyle and extrahead blocks in admin base template.

comment:12 by GitHub <noreply@…>, 2 years ago

In da8fa764:

Fixed #34081 -- Reverted "Fixed #33994 -- Corrected position of extrastyle and extrahead blocks in admin base template."

This reverts commit a69b0e9cfe0af7cd2deaf55c069453c4c4598604.

comment:13 by Mariusz Felisiak, 2 years ago

Cc: Carlton Gibson added
Easy pickings: unset
Has patch: unset
Triage Stage: Ready for checkinAccepted

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.

Note: See TracTickets for help on using tickets.
Back to Top