Modify ↓
#12550 closed defect (fixed)
can't find image specified in theme.css
Reported by: | galen_liu | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | high | Component: | ThemeEnginePlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description (last modified by )
Customize theme: Advanced
with style:
#banner { background: url(header-bg2.png); }
and I put header-bg2.png
in my <trac_project>/htdocs/
The ThemeEnginePlugin can't find it.
Fix method:
-
admin.py
97 97 return self._send_screenshot(req, data, path_info[11:]) 98 98 elif path_info == 'theme.css': 99 99 req.send_file(os.path.join(self.env.path, 'htdocs', 'theme.css'), 'text/css') 100 100 elif path_info.endswith('.png'): 101 req.send_file(os.path.join(self.env.path, 'htdocs', path_info), 'image/png') 102 elif path_info.endswith('.jpg'): 103 req.send_file(os.path.join(self.env.path, 'htdocs', path_info), 'image/jpeg') 104 101 105 raise HTTPNotFound("The requested URL was not found on this server") 102 106 103 107 def _send_screenshot(self, req, data, name):
Attachments (2)
Change History (10)
comment:1 Changed 9 years ago by
Description: | modified (diff) |
---|---|
Summary: | can't find iamge specified in theme.css → can't find image specified in theme.css |
Changed 9 years ago by
Attachment: | t12550.patch added |
---|
comment:2 Changed 9 years ago by
Owner: | changed from Olemis Lang to Ryan J Ollos |
---|---|
Status: | new → accepted |
Changed 9 years ago by
Attachment: | t12550.1.patch added |
---|
comment:4 Changed 9 years ago by
Simplified patch in attachment:t12550.1.patch. The refactoring portion of attachment:t12550.patch was committed in [15011].
comment:6 Changed 9 years ago by
If you can confirm that it's working well for you, I will create a tag for release 2.2.2.
Note: See
TracTickets for help on using
tickets.
A workaround is to use
../chrome/site/header-bg2.png
.Since
theme.css
is located in the environmenthtdocs
directory, we could just let Trac serve the file from the path/chrome/site/theme.css
. That change would allow you to useurl(header-bg2.png)
intheme.css
.Proposed changes in attachment:t12550.patch.