#22298: Rename Media to Static
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner:
Type: Cleanup/optimization | Status: new
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by awol):
Replying to [comment:12 collinanderson]:
> As a data point, I use it a bunch. As Mark said on django-developers,
it's especially helpful for the admin. I'd be fine if we moved all support
for it there instead of forms itself.
I've just run into a situation where I am using CSS to brand the admin and
the media class is not being inserted in the base templates. I would
rather not have to override the templates since all I want to do is just
add a custom CSS file to every page. I interpreted the documentation of
the custom AdminSite feature to suggest that defining a Media class in my
custom site would achieve this. At the moment, not so much.
Effectively adding `{{ media.css }}` into the `extrastyles` block of
`base.html` addresses much of the issue. Unfortunately `login` and the
`delete_*confirm` templates (at least) would need additional modification
since they derive from `base_site.html` rather than `base.html`.
Ideally adding `'media': self.media` to the `each_context` function would
also be required, but I can already override that in my custom AdminSite.
I don't have a full understanding of the distinction between these
inheritance choices to know what the right change would be in that
context. I wouldn't want to dive in and change the inheritance without
knowing why they are `base_site` vs `base` templates.
Even if this functionality was moved into a `Static` class rather than
`Media`, for me the feature is desirable, it's a very convenient way to
brand the admin, but it's implementation at the moment is not consistent,
from what I am seeing.
I was going to add a ticket for this consistency issue, but if this is a
better ticket on which to hang the issue I'm happy.
--
Ticket URL: <https://code.djangoproject.com/ticket/22298#comment:13>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.91b21aa4cd9546baf70bc5cd4931d78d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.