[Trac-tickets] [The Trac Project] #2873: Provide "alternate
stylesheets"
The Trac Project
noreply at edgewall.com
Tue Mar 14 09:53:36 CST 2006
#2873: Provide "alternate stylesheets"
-------------------------+--------------------------------------------------
Reporter: anonymous | Owner: jonas
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: general | Version: 0.9.2
Severity: normal | Keywords:
-------------------------+--------------------------------------------------
It would be great if Trac provided alternate stylesheets in its generated
html. (I didn't see anything similar in 0.9.4)
Here's a patch against ''trac-0.9.2/trac/web/chrome.py'':
{{{
--- chrome.py.orig 2005-12-05 13:20:16.000000000 -0500
+++ chrome.py 2006-03-14 10:42:59.000000000 -0500
@@ -51,6 +51,15 @@
href = Href(req.cgi_location).chrome
add_link(req, 'stylesheet', href(filename), mimetype=mimetype)
+def add_alt_stylesheet(req, filename, mimetype='text/css'):
+ """Add a linke to an alternate stylesheet
+ """
+ if filename.startswith('common/') and 'htdocs_location' in
req.hdf:
+ href = Href(req.hdf['htdocs_location'])
+ filename = filename[7:]
+ else:
+ href = Href(req.cgi_location).chrome
+ add_link(req, 'alternate stylesheet', href(filename), title='alt
style', mimetype=mimetype)
class INavigationContributor(Interface):
"""Extension point interface for components that contribute items to
the
@@ -212,6 +221,7 @@
add_link(req, 'search', self.env.href.search())
add_link(req, 'help', self.env.href.wiki('TracGuide'))
add_stylesheet(req, 'common/css/trac.css')
+ add_alt_stylesheet(req, 'common/css/trac-alt.css')
icon = self.config.get('project', 'icon')
if icon:
if not icon.startswith('/') and icon.find('://') == -1:
}}}
--
Ticket URL: <http://projects.edgewall.com/trac/ticket/2873>
The Trac Project <http://trac.edgewall.com/>
More information about the Trac-Tickets
mailing list