From b28268d75688f971f39a24065797ff068cbf5f7b Mon Sep 17 00:00:00 2001 From: franck cuny Date: Mon, 2 May 2011 21:43:31 +0200 Subject: implement some of #12 for each project, check the status of the last build. If there is a FAIL on one version, the project name is in RED, else GREEN. Signed-off-by: franck cuny --- lib/jitterbug.pm | 10 +++++++++- public/css/style.css | 4 ++++ views/index.tt | 3 +-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/jitterbug.pm b/lib/jitterbug.pm index 0febc01..dadfbe8 100644 --- a/lib/jitterbug.pm +++ b/lib/jitterbug.pm @@ -42,8 +42,16 @@ sub _get_projects { my $json = from_json($last_commit->content); $proj_desc->{last_build} = $json; $proj_desc->{last_build_author} = $json->{author}{name}; + # get the status of the last build + my $last_build_status = "PASS"; + foreach my $version (keys %{$json->{build}->{version}}){ + if ($json->{build}->{version}->{$version} eq "FAIL"){ + $last_build_status = "FAIL"; + last; + } + } + $proj_desc->{last_build_status} = $last_build_status; } - push @projects, $proj_desc; } diff --git a/public/css/style.css b/public/css/style.css index d22b898..76572df 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -167,6 +167,9 @@ font-family: sans-serif; margin: 1.2em 0 0.6em 0; } +a.FAIL{color:red} +a.PASS{color:green} + p { line-height: 1.5em; margin: 1.6em 0; @@ -228,6 +231,7 @@ font-family:Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",m .commit .builds span.PASS{color:green} .commit .builds span.FAIL{color:red} + .repo{border:1px solid #d8d8d8;background-color:#f0f0f0;margin:0;margin:0 0 10px 0;padding:8px 10px 0 10px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} .repo h3{margin:0;font-size:14px;white-space:nowrap;} .repo p.desc{margin:0 0 3px 0;font-size:12px;color:#444;} diff --git a/views/index.tt b/views/index.tt index a6e0919..19e9c84 100644 --- a/views/index.tt +++ b/views/index.tt @@ -17,10 +17,9 @@

Repositories (<: $projects.size() :>)

- : for $projects -> $project {
-

<: $project.name :>

+

<: $project.name :>

<: $project.description :>

:if $project.last_build.timestamp { -- cgit 1.4.1