Mercurial > mozilla > hg > talosnames
changeset 32:1a9ec766f2b0
add a thing for tbpl short names
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 23 Jul 2012 13:22:29 -0700 |
parents | c6580ad2612f |
children | 15f17eeb1813 |
files | talosnames/templates/index.html talosnames/web.py |
diffstat | 2 files changed, 36 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/talosnames/templates/index.html Tue Jul 17 21:36:05 2012 -0700 +++ b/talosnames/templates/index.html Mon Jul 23 13:22:29 2012 -0700 @@ -31,10 +31,43 @@ text-align: center; } +.tbpl_initial { +font-weight: bold; +color: green; +} + +.true { +background-color: green; +} + +.false { +background-color: red; +} + </style> <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script> + +<script> +// In order to get anything working with Config.js +// We have to stub a bunch of stuff for no reason +BuildbotDBUser = null; +PushlogJSONParser = null; +</script> +<script src="http://hg.mozilla.org/users/mstange_themasta.com/tinderboxpushlog/raw-file/tip/js/Config.js"></script> + + <script> $(document).ready(function() { + +$('td.tbpl').each(function() { + +var text = $(this).text(); +if (text.length && Config.testNames[text]) { +$(this).html(text + '(<span class="tbpl_initial">' + Config.testNames[text] + '</span>)'); +} + +}); + }); </script> </head>
--- a/talosnames/web.py Tue Jul 17 21:36:05 2012 -0700 +++ b/talosnames/web.py Mon Jul 23 13:22:29 2012 -0700 @@ -18,7 +18,6 @@ def __init__(self, **kw): self.api = TalosNames() - self.template = file(template).read() # get data suites = sorted(self.api.suites.keys()) @@ -69,8 +68,9 @@ return response(environ, start_response) def render(self): - template = tempita.HTMLTemplate(self.template) - return template.substitute(self.data) + contents = file(template).read() + _template = tempita.HTMLTemplate(contents) + return _template.substitute(self.data) if __name__ == '__main__': from wsgiref import simple_server