Mercurial > bitten > bitten-test
diff bitten/web_ui.py @ 814:77ff2e80b69d
Make size and style of charts configurable (applying patch from #426).
author | hodgestar |
---|---|
date | Wed, 15 Sep 2010 20:49:01 +0000 |
parents | 29a5793c452a |
children | 7c80375d4817 |
line wrap: on
line diff
--- a/bitten/web_ui.py +++ b/bitten/web_ui.py @@ -20,6 +20,7 @@ from genshi.builder import tag from trac.attachment import AttachmentModule, Attachment from trac.core import * +from trac.config import Option from trac.mimeview.api import Context from trac.resource import Resource from trac.timeline import ITimelineEventProvider @@ -150,6 +151,11 @@ implements(IRequestHandler, IRequestFilter, INavigationContributor) + # Configuration options + + chart_style = Option('bitten', 'chart_style', 'height: 220px; width: 220px;', doc= + """Style attribute for charts. Mostly useful for setting the height and width.""") + # INavigationContributor methods def get_active_navigation_item(self, req): @@ -427,6 +433,7 @@ chart_generators.append({ 'href': req.href.build(config.name, 'chart/' + category), 'category': category, + 'style': self.config.get('bitten', 'chart_style'), }) data['config']['charts'] = chart_generators