changeset 36:c945731f06d0

better default value
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 23 Jul 2012 14:50:55 -0700
parents 88d280049e2f
children 0d5cd3dccbec
files talosnames/templates/index.html talosnames/web.py
diffstat 2 files changed, 29 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/talosnames/templates/index.html	Mon Jul 23 13:57:14 2012 -0700
+++ b/talosnames/templates/index.html	Mon Jul 23 14:50:55 2012 -0700
@@ -44,6 +44,10 @@
 background-color: red;
 }
 
+.fold {
+color: blue;
+}
+
 </style>
 <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
 
@@ -59,6 +63,7 @@
 <script>
 $(document).ready(function() {
 
+// color paint/chrome boxes appropriately
 function mark_boolean(selector) {
 $(selector).each(function() {
 var text = $(this).text();
@@ -69,8 +74,6 @@
 }
 });
 }
-
-// color paint/chrome boxes appropriately
 mark_boolean('td.paint');
 mark_boolean('td.chrome');
 
@@ -82,6 +85,20 @@
 }
 });
 
+// add a hide/unhide button
+$('div.testname').after('<a class="fold">[+]</a>');
+$('dl.testattributes').hide();
+$('.fold').click(function() {
+var text = $(this).text();
+if (text == '[+]') {
+$(this).next('.testattributes').show();
+$(this).text('[-]');
+} else if (text == '[-]') {
+$(this).next('.testattributes').hide();
+$(this).text('[+]');
+}
+});
+
 });
 </script>
 </head>
@@ -112,8 +129,9 @@
 
       {{for test in sorted(tests[suite].keys())}}
       <tr>
-        <td><div class="header">{{test}}</div>
-          <dl>
+        <td>
+          <div class="header testname">{{test}}</div>
+          <dl class="testattributes">
             {{for attr in sorted(tests.get(suite, {})[test].keys())}}
             <dt>{{attr}}</dt>
             <dd>{{tests[suite][test][attr]}}</dd>
--- a/talosnames/web.py	Mon Jul 23 13:57:14 2012 -0700
+++ b/talosnames/web.py	Mon Jul 23 14:50:55 2012 -0700
@@ -57,7 +57,13 @@
                     raise AssertionError
                 paint[suite] = _paint
                 chrome[suite] = _chrome
-                graphserver.setdefault(suite, {})[test] = [self.api.graphserver_name(test + extension) or ('','')]
+
+                # get graphserver data
+                names = self.api.graphserver_name(test + extension)
+                if names:
+                    graphserver.setdefault(suite, {})[test] = [names]
+                else:
+                    graphserver.setdefault(suite, {})[test] = None
         self.data['graphserver'] = graphserver
         self.data['paint'] = paint
         self.data['chrome'] = chrome