From f5a0e015aed0808c989ed639d5b69f02ba7cfca2 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Thu, 11 Jun 2015 13:56:40 +0300 Subject: [PATCH] Hide jobs with no failures When filtering the uncategorized page by a time window, completely hide jobs that have no uncategorized failures in said time window. Hide entries in the menu that have no hits in the window as well. This patch doesn't dynamically update any numbers to only show what is visible in the window. Also add debug info to web_server script. Change-Id: I2fd792a1a202a70a3dedd20316b3c4fdd8fcdc6e --- web/share/templates/uncategorized.html | 47 +++++++++++++++++++------- web_server.py | 1 + 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/web/share/templates/uncategorized.html b/web/share/templates/uncategorized.html index 0af1419b..6fd462cf 100644 --- a/web/share/templates/uncategorized.html +++ b/web/share/templates/uncategorized.html @@ -16,6 +16,10 @@ ev.preventDefault(); var generated = $('#generated-date').text(); var gen_date = Date.parse(generated); + + $("div.job").each(function () { + $(this).show(); + }); $( "li.log-link" ).each(function() { if (! $( this ).hasClass("dated") ) { var timestamp = $( this ).text().substr(0,16); @@ -30,6 +34,21 @@ $( this ).show(); } }); + $("div.job").each(function () { + var visible = $('ul li:visible', $(this)).size() + if (visible == 0) $(this).hide(); + else $(this).show(); + }); + $("#menu li").each(function () { + var h = $("a", this).attr('href').substring(1); + if ($('a[name="' + h + '"]').closest("div").is(":visible")){ + $(this).show(); + }else{ + $(this).hide(); + } + + }); + } $(function() { @@ -56,7 +75,7 @@ -