diff options
author | franck cuny <franck@lumberjaph.net> | 2011-05-02 21:43:31 +0200 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2011-05-09 16:42:15 +0200 |
commit | e4a521e5c0d6621edeb27df6d0c73e5648ae756a (patch) | |
tree | 16cfa6ec511daaf79e4c55128858a75ae80c04a2 | |
parent | Try again to unuglify the commit description (diff) | |
download | jitterbug-e4a521e5c0d6621edeb27df6d0c73e5648ae756a.tar.gz |
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 <franck@lumberjaph.net>
Diffstat (limited to '')
-rw-r--r-- | lib/jitterbug.pm | 10 | ||||
-rw-r--r-- | public/css/style.css | 4 | ||||
-rw-r--r-- | 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 75ee154..bcd6154 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; @@ -229,6 +232,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 @@ <div class="first"> <h3>Repositories (<: $projects.size() :>)</h3> - : for $projects -> $project { <div class="repo"> - <h3><a href="<: $uri_base :>project/<: $project.name :>"><: $project.name :></a></h3> + <h3><a class="<: $project.last_build_status :>" href="<: $uri_base :>project/<: $project.name :>"><: $project.name :></a></h3> <div class="repo-body"> <p class="desc"><: $project.description :></p> :if $project.last_build.timestamp { |