diff options
-rwxr-xr-x | programs/report.py | 17 | ||||
-rw-r--r-- | programs/templates/index.css | 34 | ||||
-rw-r--r-- | programs/templates/index.html | 40 |
3 files changed, 67 insertions, 24 deletions
diff --git a/programs/report.py b/programs/report.py index c48813c..9b5ab41 100755 --- a/programs/report.py +++ b/programs/report.py @@ -90,6 +90,14 @@ def escape(s): ##### Summary page generation ############################################################################# +def build_navbox(current_page): + def link(to): + if to == current_page: + return '<span>%s</span>' % to.title() + return '<a href="%s.html">%s</a>' % (to, to.title()) + + return ''.join([link(p) for p in ['index', 'changes', 'problems']]) + def testResult(run_name, full_name, status): html = '<a class="%(status)s" href="%(link)s">%(status)s</a>' % { 'status': status if status else 'skip', @@ -179,7 +187,7 @@ def buildTable(run_names, results): return (stack[0].name_html, stack[0].column_html) -def writeSummaryHtml(run_names, results, filename): +def writeSummaryHtml(run_names, results, resultsDir, page): names, columns = buildTable(run_names, results) def makeColumn(name, contents): @@ -187,9 +195,10 @@ def writeSummaryHtml(run_names, results, filename): column_html = ''.join([makeColumn(name, contents) for name, contents in zip(run_names, columns)]) group = '<div class="nameColumn"><a class="title" href="%s/index.html">%(name)s</a>' + names + '</div>' + filename = path.join(resultsDir, page + '.html') writefile(filename, templates['index'] % { - 'page': 'Your face', - 'showlinks': 'Navbar', + 'page': filename, + 'showlinks': build_navbox(page), 'group': group, 'columns': column_html }) @@ -262,7 +271,7 @@ def main(argv, config): for t in results.keys(): if filterFunc is None or filterFunc(results[t]): cut_results[t] = results[t] - writeSummaryHtml(run_names, cut_results, path.join(reportDir, page + '.html')) + writeSummaryHtml(run_names, cut_results, reportDir, page) os.link(path.join(templateDir, 'index.css'), path.join(reportDir, 'index.css')) diff --git a/programs/templates/index.css b/programs/templates/index.css index 4133d33..a2d9dbf 100644 --- a/programs/templates/index.css +++ b/programs/templates/index.css @@ -1,3 +1,37 @@ +body { + margin: 0; +} + +#navbox { + font-weight: bold; + text-decoration: none; + text-align: center; + background-color: #67a7c3; + color: white; + border-top: 1px solid #5689a0; + border-bottom: 1px solid #5689a0; + vertical-align: middle; + padding-top: 0.2em; + padding-bottom: 0.2em; +} + +#navbox * { + color: white; + border-left: 1px solid #67a7c3; + border-right: 1px solid #67a7c3; + padding-left: 0.75em; + padding-right: 0.75em; + padding-top: 0.2em; + padding-bottom: 0.2em; + text-decoration: none; +} + +#navbox a:hover { + background-color: #77bede; + border-left: 1px solid #ffffff; + border-right: 1px solid #ffffff; +} + div#table { margin-left: 1.75em; margin-right: 1.75em; diff --git a/programs/templates/index.html b/programs/templates/index.html index a79e9b6..0c95f08 100644 --- a/programs/templates/index.html +++ b/programs/templates/index.html @@ -2,24 +2,24 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <title>Result summary </title> - <link rel="stylesheet" href="index.css"/> - </head> - <body> - <h1>Result summary</h1> - <p> - Currently showing: %(page)s - </p> - <p> - Show: %(showlinks)s - </p> - <div id="table"> - <div id="tablebody"> - %(group)s - %(columns)s - </diV> - </div> - </body> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>Result summary </title> + <link rel="stylesheet" href="index.css"/> + </head> + <body> + <h1>Result summary</h1> + <p> + Currently showing: %(page)s + </p> + <div id="navbox"> + %(showlinks)s + </div> + <div id="table"> + <div id="tablebody"> + %(group)s + %(columns)s + </diV> + </div> + </body> </html> |