However, trying to do something like:
{{{
{% extends "admin/base.html" %}
{% block bodyclass %}mymagicalbase {{ block.super }}{% endblock %}
}}}
does not work as desired, because subsequent templates [those which
inherit from base_site] define the `bodyclass` block without calling super
themselves; see
[https://github.com/django/django/search?q=bodyclass++path%3Adjango%2Fcontrib%2Fadmin%2Ftemplates&type=Code
GitHub search] demonstrating the files affected; with the notable
exception of app_index, which ''does'' call super.
By contrast, all of the templates which require `extrastyles` ''do'' call
super to ensure the template hierarchy's block representation is preserved
as the template author designed.
--
Ticket URL: <https://code.djangoproject.com/ticket/21371>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/21371#comment:1>
* owner: nobody => resry
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/21371#comment:2>
Comment (by resry):
I've submitted a pull request from my branch at
[https://github.com/resry/django/tree/ticket_21371 ticket_21371].
--
Ticket URL: <https://code.djangoproject.com/ticket/21371#comment:3>
Comment (by Keryn Knight <django@…>):
For completeness' sake, it looks like there was previously an attempt to
fix a small subset of the affected templates, in #7425
--
Ticket URL: <https://code.djangoproject.com/ticket/21371#comment:4>
* has_patch: 0 => 1
* needs_tests: 0 => 1
Comment:
Thanks Keryn, #7425 has been set as a duplicate.
--
Ticket URL: <https://code.djangoproject.com/ticket/21371#comment:5>
Comment (by pouete):
Hello !
I have a [[https://github.com/django/django/pull/2152|pull request]] to
address this ticket !
Fix+test cases
--
Ticket URL: <https://code.djangoproject.com/ticket/21371#comment:6>
* needs_better_patch: 0 => 1
* needs_tests: 1 => 0
Comment:
I've reviewed the pull request and left comments for improvement. Please
uncheck "Patch needs improvement" when it's updated.
--
Ticket URL: <https://code.djangoproject.com/ticket/21371#comment:7>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"f5123c7291e855713b59e739bad0e50a1d50d3ef"]:
{{{
#!CommitTicketReference repository=""
revision="f5123c7291e855713b59e739bad0e50a1d50d3ef"
Fixed #21371 -- Added the block.super to admin bodyclass blocks.
Thanks Keryn Knight for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21371#comment:8>