Opened 19 years ago
Last modified 19 years ago
#1908 closed defect
add_stylesheet() should be able to handle plugin's resource — at Version 2
Reported by: | Owned by: | Christopher Lenz | |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | general | Version: | devel |
Severity: | normal | Keywords: | chrome |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
In r2064, trac.web.chrome.add_stylesheet()
always makes a href to standard htdocs
location. So webadmin and helloworldplugin cannot
use its own css file.
Attached patch checks whether the specified stylesheet file is in trac's standard
htdocs directory.
If exist, makes href /trac/css/xxx.cs
, or /proj/chrome/css/xxx.cs
.
BTW, This means plugin cannot override existing one. Is it good?
I think it might be ok that we always make link via /proj/chrome/
…
Change History (4)
by , 19 years ago
Attachment: | chrome.py-plugin-aware-add_stylesheet.patch added |
---|
by , 19 years ago
Attachment: | chrome.py-plugin-aware-add_stylesheet-2.patch added |
---|
Replaced. Previous attachment contains unused codes for my debug, sorry
comment:1 by , 19 years ago
Milestone: | → 0.9 |
---|---|
Owner: | changed from | to
Priority: | normal → low |
Status: | new → assigned |
Note that this is only true if you have the htdocs_location
set in trac.ini. If the option is omitted or left blank, the /chrome/
path will be used for all static file URLs.
Anyway, I'm planning to improve both add_stylesheet
and the ITemplateProvider
extension point to fix this issue.
Patch of add_stylesheet() to support plugin's stylesheet