Opened 11 years ago
Closed 11 years ago
#21371 closed Cleanup/optimization (fixed)
Admin templates use a `bodyclass` block without ever calling super.
Reported by: | Owned by: | resry | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | yes | UI/UX: | no |
Description
A reasonable expectation is, I think, to be able to subsume the admin/base_site.html
template to do a few tweaks for display purposes, by throwing it in an earlier INSTALLED_APP or into one of the paths set in TEMPLATE_DIRS; for the most part, this works as expected.
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 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.
Change History (8)
comment:1 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 11 years ago
comment:4 by , 11 years ago
For completeness' sake, it looks like there was previously an attempt to fix a small subset of the affected templates, in #7425
comment:5 by , 11 years ago
Has patch: | set |
---|---|
Needs tests: | set |
Thanks Keryn, #7425 has been set as a duplicate.
comment:7 by , 11 years ago
Needs tests: | unset |
---|---|
Patch needs improvement: | set |
I've reviewed the pull request and left comments for improvement. Please uncheck "Patch needs improvement" when it's updated.
comment:8 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I've submitted a pull request from my branch at ticket_21371.