Sha256: 3403d4cfd0baa13c3ee6c81b92128eaa9e8179e5b929fb33cdd28aaecf968bc4
Contents?: true
Size: 890 Bytes
Versions: 4
Compression:
Stored size: 890 Bytes
Contents
import re from trac.log import logger_factory from trac.core import * from trac.web import IRequestHandler from trac.util import Markup from trac.web.chrome import add_stylesheet, add_script, \ INavigationContributor, ITemplateProvider from trac.web.href import Href class QueryWebUiAddon(Component): implements(INavigationContributor) def __init__(self): pass # INavigationContributor methods def get_active_navigation_item(self, req): if re.search('query', req.path_info): return "query-addon" else: return "" def get_navigation_items(self, req): src = req.href.chrome("Billing/query.js") if re.search('query', req.path_info): yield 'mainnav', "query-addon", \ Markup("""<script language="javascript" type="text/javascript" src="%s"></script>"""%src)
Version data entries
4 entries across 4 versions & 1 rubygems