From 2f7071ee9d047c2ab96dcac289e67884d1e7bef2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 28 Aug 2013 17:06:08 +0200 Subject: [PATCH] Tabify the eval page The different types of types (new, removed, newly failing, and so on) now each have their own tab. --- src/root/jobset-eval.tt | 141 ++++++++++++++++++----------------- src/root/static/js/common.js | 26 ++++--- 2 files changed, 90 insertions(+), 77 deletions(-) diff --git a/src/root/jobset-eval.tt b/src/root/jobset-eval.tt index 4f7e094d..0f3f014c 100644 --- a/src/root/jobset-eval.tt +++ b/src/root/jobset-eval.tt @@ -27,85 +27,92 @@ c.uri_for(c.controller('JobsetEval').action_for('view'),
Couldn't find an evaluation to compare to.
[% END %] + + +[% BLOCK renderSome %] + [% INCLUDE renderBuildListHeader unsortable=1 %] + [% size = builds.size; max = full ? size : 250; %] + [% INCLUDE renderBuildListBody builds=builds.slice(0, (size > max ? max : size) - 1) + hideProjectName=1 hideJobsetName=1 %] + [% IF size > max; params = c.req.params; params.full = 1 %] + ([% size - max %] more builds omitted) + [% END %] + [% INCLUDE renderBuildListFooter %] +[% END %] +
-
+
+ [% INCLUDE renderSome builds=nowFail %] +
- +
+ [% INCLUDE renderSome builds=nowSucceed %] +
- [% BLOCK renderSome %] - [% size = builds.size; max = full ? size : 30; %] - [% INCLUDE renderBuildListBody builds=builds.slice(0, (size > max ? max : size) - 1) - hideProjectName=1 hideJobsetName=1 %] - [% IF size > max; params = c.req.params; params.full = 1 %] - ([% size - max %] more builds omitted) - [% END %] - [% END %] +
+ [% INCLUDE renderSome builds=new %] +
- [% INCLUDE renderBuildListHeader unsortable=1 %] +
+ + + + + + [% size = removed.size; max = full ? size : 250; %] + [% FOREACH j IN removed.slice(0,(size > max ? max : size) - 1) %] + + + + + [% END %] + [% IF size > max; params = c.req.params; params.full = 1 %] + + [% END %] + +
JobSystem
[% INCLUDE renderJobName project=project.name jobset=jobset.name job=j.job %][% j.system %]
([% size - max %] more jobs omitted)
+
- [% IF unfinished.size > 0 %] - Queued jobs - [% INCLUDE renderSome builds=unfinished %] - [% END %] +
+ [% INCLUDE renderSome builds=stillFail %] +
- [% IF new.size > 0 %] - New jobs - [% INCLUDE renderSome builds=new %] - [% END %] - - [% IF removed.size > 0 %] - Removed jobs - [% size = removed.size; max = full ? size : 30; %] - [% FOREACH j IN removed.slice(0,(size > max ? max : size) - 1) %] - - - [% INCLUDE renderJobName project=project.name jobset=jobset.name job=j.job %] - [% j.system %] - - [% END %] - [% IF size > max; params = c.req.params; params.full = 1 %] - ([% size - max %] more jobs omitted) - [% END %] - [% END %] - - [% IF nowFail.size > 0 %] - Jobs that now fail - [% INCLUDE renderSome builds=nowFail %] - [% END %] - - [% IF nowSucceed.size > 0 %] - Jobs that now succeed - [% INCLUDE renderSome builds=nowSucceed %] - [% END %] - - [% IF stillFail.size > 0 %] - Jobs that still fail - [% INCLUDE renderSome builds=stillFail %] - [% END %] - - [% IF stillSucceed.size > 0 %] - Jobs that still succeed - [% INCLUDE renderSome builds=stillSucceed %] - [% END %] - - [% INCLUDE renderBuildListFooter %] - - [% IF c.user_exists %] -

- Release -

- [% END %] +
+ [% INCLUDE renderSome builds=stillSucceed %] +
+
+ [% INCLUDE renderSome builds=unfinished %]
diff --git a/src/root/static/js/common.js b/src/root/static/js/common.js index 44f52462..7477455b 100644 --- a/src/root/static/js/common.js +++ b/src/root/static/js/common.js @@ -50,18 +50,24 @@ $(document).ready(function() { $(".hydra-popover").popover({}); - /* Ensure that pressing the back button on another page - navigates back to the previously selected tab on this - page. */ - $('.nav-tabs').bind('show', function(e) { - var pattern = /#.+/gi; - var id = e.target.toString().match(pattern)[0]; - history.replaceState(null, "", id); - }); - $(function() { if (window.location.hash) { - $(".nav a[href='" + window.location.hash + "']").tab('show'); + $(".nav-tabs a[href='" + window.location.hash + "']").tab('show'); } + + /* If no tab is active, show the first one. */ + $(".nav-tabs").each(function() { + if ($("li.active", this).length > 0) return; + $("a", $("li", this).first()).tab('show'); + }); + + /* Ensure that pressing the back button on another page + navigates back to the previously selected tab on this + page. */ + $('.nav-tabs').bind('show', function(e) { + var pattern = /#.+/gi; + var id = e.target.toString().match(pattern)[0]; + history.replaceState(null, "", id); + }); }) });