Mercurial > mozilla > hg > talosnames
changeset 25:6ec941f8704a
css improvements
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 10 Jul 2012 23:19:29 -0700 |
parents | 56d267d847e1 |
children | c6a042aad739 |
files | talosnames/templates/index.html talosnames/web.py |
diffstat | 2 files changed, 45 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/talosnames/templates/index.html Tue Jul 10 21:36:24 2012 -0700 +++ b/talosnames/templates/index.html Tue Jul 10 23:19:29 2012 -0700 @@ -5,10 +5,33 @@ table, th, td { border: 1px solid black; } +dt { +font-style: italic; +font-weight: 550; +float: left; +clear: left; +padding-right: 1em; +} + +dd { clear: right; } + +dt::after { content: ": "; } + +.header { +font-weight: bold; +align: center; +text-align: center; +} + </style> +<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script> +<script> +$(document).ready(function() { +}); +</script> </head> <body> -<table> +<table id="data"> <tr> <th>Buildbot Suite</th> <th>Buildbot Command</th> @@ -30,7 +53,7 @@ {{for test in sorted(tests[suite].keys())}} <tr> - <td><b>{{test}}</b> + <td><div class="header">{{test}}</div> <dl> {{for attr in sorted(tests.get(suite, {})[test].keys())}} <dt>{{attr}}</dt>
--- a/talosnames/web.py Tue Jul 10 21:36:24 2012 -0700 +++ b/talosnames/web.py Tue Jul 10 23:19:29 2012 -0700 @@ -19,14 +19,7 @@ self.api = TalosNames() self.template = file(template).read() - def __call__(self, environ, start_response): - request = Request(environ) - response = Response(content_type='text/html', - body=self.render()) - return response(environ, start_response) - - def render(self): - template = tempita.HTMLTemplate(self.template) + # get data suites = sorted(self.api.suites.keys()) tests = {} for suite in suites: @@ -36,15 +29,25 @@ except: tests[suite] = None - data = {'suites': suites, - 'commands': self.api.buildbot_commands, - 'tbpl': dict([(suite, self.api.tbpl_name(suite)) - for suite in suites]), - 'tests': tests, - 'pprint': pprint.pformat, - 'api': self.api - } - return template.substitute(data) + self.data = {'suites': suites, + 'commands': self.api.buildbot_commands, + 'tbpl': dict([(suite, self.api.tbpl_name(suite)) + for suite in suites]), + 'tests': tests, + 'pprint': pprint.pformat, + 'api': self.api + } + + + def __call__(self, environ, start_response): + request = Request(environ) + response = Response(content_type='text/html', + body=self.render()) + return response(environ, start_response) + + def render(self): + template = tempita.HTMLTemplate(self.template) + return template.substitute(self.data) if __name__ == '__main__': from wsgiref import simple_server