Opened 20 months ago

Closed 19 months ago

Last modified 19 months 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, 20 months 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, 20 months 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, 20 months 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, 19 months ago

Last edited 19 months ago by jay patel (previous) (diff)

comment:5 by Jay Patel, 19 months ago

Hi Maxim, Can I work on this ticket ?

comment:7 by Carlton Gibson, 19 months ago

Has patch: set

comment:8 by Mariusz Felisiak, 19 months ago

Owner: changed from Maxim Danilov to Jay Patel

comment:9 by Mariusz Felisiak, 19 months ago

Patch needs improvement: set

comment:10 by Mariusz Felisiak, 19 months ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:11 by GitHub <noreply@…>, 19 months 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@…>, 19 months 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, 19 months 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