I want to customize the project page (trac/templates/index.html).
I want to use a table to show more project-specific information. For instance the admin list of each project, the build status of each project. These information are stored in trac's database.
I am afraid that the default template engine is not able to give me there information. At least I have found nothing valuable from its documentaton.
So I decided to write a python script (on the server side) to generate these information as a JSON string. I injected also a chunk javascript to fetch the JSON from this python script by using Ajax.
But I do not know how to make my python script interpreted by trac.
Can anyone help me?
I've customized trac in a more simple way by adding an iframe
to the top of all trac project pages. You can do this by going to templates
directory in the trac environment directory, and adding a site.html
file.
I have something like:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/" py:strip="">
<!--! Custom match templates go here -->
<head py:match="head" py:attrs="select('@*')">
${select('*|comment()|text()[local-name()!="script"]')}
<link rel="stylesheet" type="text/css" href="http://mysite.com/nav.css" />
</head>
<body py:match="body" py:attrs="select('@*')">
<iframe src ="http://mysite.com/nav.html"
width="100%"
id="navbar-iframe"
height="30px"
frameborder="0"
marginheight="0"
scrolling="no"
marginwidth="0">
</iframe>
<div id="tdtracbody">
${select('*|text()')}
</div>
</body>
</html>