Comments (7)
@zuck thanks for the suggestion, I think it is an useful feature and it could be extended to external js too.
I will add it in the next release, if you have any other idea feel free to suggest it.
from django-admin-interface.
Ping here! I could try making a PR if that helps.
from django-admin-interface.
@merwok as you can see here there is an old unused field that in the past was used to store custom extra css.
The textarea fields containing the css/js code could work, but it is terrible to have working code pasted in a textarea (like many systems does).
Now the necessity seems to have the possibility to upload a custom css file and why not, also a custom js file.
The best solution would be to add an additional model with a css/js file using a foreign key to the theme, but I think that this solution would go to over engineering the db for doing a simple thing. So, I would add two fields to the theme model: extra_css
and extra_js
(with file extension validator).
Let me know what do you think about it.
from django-admin-interface.
I think I misunderstood the original request!
I don’t want to import extra CSS; I already do customizations that I need (mostly on object add/edit page) with extra JS and CSS in overriden admin/change_form.html
templates. What I’d like is to move all the admin-interface CSS from the HTML template into a CSS template, so that the HTML pages only need link rel=stylesheet
. It would make the source shorter (good for view source!) and let the browser cache the stylesheet (using the appropriate cache headers based on a checksum or version, for invalidation).
from django-admin-interface.
There should be no inline javascript/css at all. It is better to not have anything inline to follow content security policy best practices.
from django-admin-interface.
from django-admin-interface.
@zuck the solution suggested by @merwok solves your problems?
If not, could you be more specific about what you would like to do but you can't do?
Frankly it is my intention to close this issue because I don't want to add some potentially dangerous fields (a user with theme permissions could inject malicious code that would be executed by all users in all pages).
from django-admin-interface.
Related Issues (20)
- Logo & Favicon not rendering HOT 18
- Improved style for userlink block HOT 5
- Language Chooser dropdown keeps style across different OS HOT 11
- Fiedsets as tabs CSS issue HOT 6
- Unicode Characters Not Slugified Properly in Inlines Tabs HOT 1
- "support show_change_link with related modal" feature is missing since version 0.20.0 HOT 4
- Language chooser is broken with `prefix_default_language=False` HOT 2
- Filter Input Fields collapsing on different layouts HOT 1
- Adding Support for `django-rosetta` Package HOT 1
- TemplateDoesNotExist with use django-nested-admin HOT 2
- Bug in display of related links with autocomplete fields HOT 5
- django.db.utils.ProgrammingError: relation "admin_interface_theme" does not exist HOT 2
- Unnecessary warning for missing django.middleware.locale.LocaleMiddleware if using customized middleware HOT 4
- Enable possibility to use a static file as logo HOT 18
- Object of type Theme is not JSON serializable HOT 20
- The default View Site link not showing in the mobile version HOT 1
- Popup window freezes in Chrome after save HOT 4
- Django admin date_hierarchy linking is not working anymore HOT 6
- Related modal window includes the header. HOT 4
- Serving static files with Amazon S3 and signed querystring problem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-admin-interface.