changeset 44:10e59c3ae847

filter by active/disabled
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 12 Aug 2012 23:45:36 -0700
parents 4e8c839dcdec
children c1cbb79a6aaf
files talosnames/templates/index.html talosnames/web.py
diffstat 2 files changed, 26 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/talosnames/templates/index.html	Sun Aug 12 23:27:28 2012 -0700
+++ b/talosnames/templates/index.html	Sun Aug 12 23:45:36 2012 -0700
@@ -48,7 +48,7 @@
 }
 
 .disabled {
-background-color: #888;
+background-color: #AAA;
 }
 
 </style>
@@ -109,7 +109,7 @@
 <table id="data">
 
 <tr>
-g  <th class="buildbot">Buildbot Suite</th>
+  <th class="buildbot">Buildbot Suite</th>
   <th class="command">Buildbot PerfConfigurator Command</th>
   <th class="tbpl">TBPL Name</th>
   <th class="paint">Paint</th>
--- a/talosnames/web.py	Sun Aug 12 23:27:28 2012 -0700
+++ b/talosnames/web.py	Sun Aug 12 23:45:36 2012 -0700
@@ -96,18 +96,30 @@
         # make a local copy of the data
         data = self.data.copy()
 
-        # filter by TBPL letter
-        if request and 'tbpl' in request.GET:
-            tbplnames = []
-            for name in request.GET.getall('tbpl'):
-                if not name.startswith('Talos'):
-                    name = 'Talos ' + name
-                tbplnames.append(name)
-            suites = []
-            for suite, value in self.data['tbpl'].items():
-                if value in tbplnames:
-                    suites.append(suite)
-            data['suites'] = sorted(suites)
+        if request :
+            # filter by TBPL letter
+            if 'tbpl' in request.GET:
+                tbplnames = []
+                for name in request.GET.getall('tbpl'):
+                    if not name.startswith('Talos'):
+                        name = 'Talos ' + name
+                    tbplnames.append(name)
+                suites = []
+                for suite, value in self.data['tbpl'].items():
+                    if value in tbplnames:
+                        suites.append(suite)
+                data['suites'] = sorted(suites)
+
+            # filter by disabled
+            if 'show' in request.GET:
+                show = request.GET['show']
+                if show == 'active':
+                    data['suites'] = [i for i in data['suites']
+                                      if data['enabled'][i]]
+                elif show == 'disabled':
+                    data['suites'] = [i for i in data['suites']
+                                      if not data['enabled'][i]]
+
 
         contents = file(template).read()
         _template = tempita.HTMLTemplate(contents)