Addition of `AdminSite.media` for adding JS and CSS files globally to every admin page
- Dominant language
- No language data
- Stars
- 188
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
### Code of Conduct
- [x] I agree to follow Django's Code of Conduct
### Feature Description
I propose adding the property `media` to `AdminSite` class, with similar functionality as `ModelAdmin.media`. The main reason for it is making it easy to add any JS/CSS globally for every admin page, and it will make the media management more consistent across the admin.
The main benefit will be the ability to separate this from the templates completely and in future, maybe moving all hard-coded media html tags to AdminSite.media thus making the template cleaner and making it possible to take advantage of `Media` merging logic.
### Problem
Currently, to add JS script or a CSS file that will be used on every page in admin. It is necessary to extend one of the base templates and manually add the script or link tag. Any kind of conditional media management requires having if statements and extending the `AdminSite.each_context`.
### Request or proposal
proposal
### Additional Details
_No response_
### Implementation Suggestions
Implementation would require adding the `AdminSite.media` property and small modification to the "admin/base.html" template.
It is important to point out, that this would be completely backwards compatible.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.