[Django] #33994: wrong position of {% block extrastyle %} in admin/base.html

5 views
Skip to first unread message

Django

unread,
Sep 7, 2022, 4:27:30 PM9/7/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim | Owner: nobody
Danilov |
Type: | Status: new
Cleanup/optimization |
Component: | Version: 4.0
contrib.admin | Keywords: admin, modeladmin,
Severity: Normal | templates
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
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>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33994>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 8, 2022, 3:13:30 AM9/8/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: admin, modeladmin, | Triage Stage: Accepted
templates |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* stage: Unreviewed => Accepted


Comment:

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?

--
Ticket URL: <https://code.djangoproject.com/ticket/33994#comment:1>

Django

unread,
Sep 8, 2022, 4:25:42 AM9/8/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: admin, modeladmin, | Triage Stage: Accepted
templates |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Maxim Danilov):

Replying to [comment:1 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33994#comment:2>

Django

unread,
Sep 8, 2022, 4:46:18 AM9/8/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: Maxim
Type: | Danilov
Cleanup/optimization | Status: assigned

Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: admin, modeladmin, | Triage Stage: Accepted
templates |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* owner: nobody => Maxim Danilov
* status: new => assigned


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33994#comment:3>

Django

unread,
Sep 14, 2022, 6:51:22 AM9/14/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: Maxim
Type: | Danilov
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: admin, modeladmin, | Triage Stage: Accepted
templates |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by jay-patel-cognoai):

Hi Maxim, Can I work on this ticket ?

--
Ticket URL: <https://code.djangoproject.com/ticket/33994#comment:4>

Django

unread,
Sep 14, 2022, 7:04:48 AM9/14/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: Maxim
Type: | Danilov
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: admin, modeladmin, | Triage Stage: Accepted
templates |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Jay Patel):

Hi Maxim, Can I work on this ticket ?

--
Ticket URL: <https://code.djangoproject.com/ticket/33994#comment:5>

Django

unread,
Sep 14, 2022, 8:22:57 AM9/14/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: Maxim
Type: | Danilov
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: admin, modeladmin, | Triage Stage: Accepted
templates |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Jay Patel):

I have created a PR https://github.com/django/django/pull/16055

--
Ticket URL: <https://code.djangoproject.com/ticket/33994#comment:6>

Django

unread,
Sep 14, 2022, 10:11:20 AM9/14/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: Maxim
Type: | Danilov
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: admin, modeladmin, | Triage Stage: Accepted
templates |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33994#comment:7>

Django

unread,
Sep 15, 2022, 4:51:59 AM9/15/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: Jay Patel
Type: | Status: assigned
Cleanup/optimization |

Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: admin, modeladmin, | Triage Stage: Accepted
templates |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* owner: Maxim Danilov => Jay Patel


--
Ticket URL: <https://code.djangoproject.com/ticket/33994#comment:8>

Django

unread,
Sep 15, 2022, 5:08:26 AM9/15/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: Jay Patel
Type: | Status: assigned
Cleanup/optimization |
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: admin, modeladmin, | Triage Stage: Accepted
templates |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33994#comment:9>

Django

unread,
Sep 15, 2022, 7:59:25 AM9/15/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: Jay Patel
Type: | Status: assigned
Cleanup/optimization |
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: admin, modeladmin, | Triage Stage: Ready for
templates | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/33994#comment:10>

Django

unread,
Sep 15, 2022, 8:34:16 AM9/15/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: Jay Patel
Type: | Status: closed

Cleanup/optimization |
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: fixed

Keywords: admin, modeladmin, | Triage Stage: Ready for
templates | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"a69b0e9cfe0af7cd2deaf55c069453c4c4598604" a69b0e9c]:
{{{
#!CommitTicketReference repository=""
revision="a69b0e9cfe0af7cd2deaf55c069453c4c4598604"
Fixed #33994 -- Corrected position of extrastyle and extrahead blocks in
admin base template.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33994#comment:11>

Django

unread,
Oct 10, 2022, 7:43:41 AM10/10/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: Jay Patel
Type: | Status: closed
Cleanup/optimization |
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: fixed
Keywords: admin, modeladmin, | Triage Stage: Ready for
templates | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"da8fa764134980ee1079f790cda6616f32cf9c44" da8fa764]:
{{{
#!CommitTicketReference repository=""
revision="da8fa764134980ee1079f790cda6616f32cf9c44"
Fixed #34081 -- Reverted "Fixed #33994 -- Corrected position of extrastyle


and extrahead blocks in admin base template."

This reverts commit a69b0e9cfe0af7cd2deaf55c069453c4c4598604.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33994#comment:12>

Django

unread,
Oct 10, 2022, 7:47:32 AM10/10/22
to django-...@googlegroups.com
#33994: wrong position of {% block extrastyle %} in admin/base.html
-------------------------------------+-------------------------------------
Reporter: Maxim Danilov | Owner: Jay Patel
Type: | Status: closed
Cleanup/optimization |
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: fixed
Keywords: admin, modeladmin, | Triage Stage: Accepted
templates |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Carlton Gibson (added)
* has_patch: 1 => 0
* easy: 1 => 0
* stage: Ready for checkin => Accepted


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33994#comment:13>

Reply all
Reply to author
Forward
0 new messages