Mercurial > bitten > bitten-test
changeset 120:b63ed684c29c
Show the list of reports generated on the build page.
author | cmlenz |
---|---|
date | Mon, 08 Aug 2005 14:27:20 +0000 |
parents | 430c518ebb14 |
children | 381233a91db6 |
files | bitten/trac_ext/htdocs/build.css bitten/trac_ext/templates/build.cs bitten/trac_ext/web_ui.py |
diffstat | 3 files changed, 26 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/bitten/trac_ext/htdocs/build.css +++ b/bitten/trac_ext/htdocs/build.css @@ -16,6 +16,16 @@ #content.build #builds td.failed { background: #d99; } #content.build #builds td.in-progress { background: #ff9; } -#content.build .log { overflow: auto; white-space: pre; } +#content.build .reports { + background: #d7d7d7; + float: right; + font-size: 90%; + margin: .5em 0 .5em 1em; + padding: .5em; +} +#content.build .reports h3 { margin: 0; } +#content.build .reports ul { margin: 0; padding: 0; list-style: none; } + +#content.build .log { clear: right; overflow: auto; white-space: pre; } #content.build .log .warning { color: #660; font-weight: bold; } #content.build .log .error { color: #900; font-weight: bold; }
--- a/bitten/trac_ext/templates/build.cs +++ b/bitten/trac_ext/templates/build.cs @@ -161,6 +161,13 @@ var:build.started_delta ?> ago)<br />Took: <?cs var:build.duration ?></p><?cs each:step = build.steps ?> <h2><?cs var:step.name ?> (<?cs var:step.duration ?>)</h2> + <?cs if:len(step.reports) ?> + <div class="reports"><h3>Generated Reports</h3><ul> + <?cs each:report = step.reports ?> + <li class="<?cs var:report.type ?>"><?cs var:report.type ?></li> + <?cs /each ?> + </ul></div> + <?cs /if ?> <p><?cs var:step.description ?></p> <div class="log"><?cs each:item = step.log ?><code class="<?cs var:item.level ?>"><?cs
--- a/bitten/trac_ext/web_ui.py +++ b/bitten/trac_ext/web_ui.py @@ -32,6 +32,7 @@ from trac.web.main import IRequestHandler from trac.wiki import wiki_to_html from bitten.model import BuildConfig, TargetPlatform, Build, BuildStep, BuildLog +from bitten.store import ReportStore class ILogFormatter(Interface): @@ -450,6 +451,13 @@ message = format(level, message) items.append({'level': level, 'message': message}) steps[-1]['log'] = items + + store = ReportStore(self.env) + reports = [] + for report in store.retrieve_reports(build, step): + reports.append({'type': report.attr['type']}) + steps[-1]['reports'] = reports + hdf['steps'] = steps return hdf