From 7e222db2393e93c851ad43019636c3c06bbbaa1a Mon Sep 17 00:00:00 2001 From: franck cuny Date: Sat, 25 Sep 2010 17:24:13 +0200 Subject: sort commits; show under the appropriate box --- lib/jitterbug/Project.pm | 2 ++ public/css/style.css | 2 +- views/layouts/main.tt | 4 +++- views/project/index.tt | 5 ++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/jitterbug/Project.pm b/lib/jitterbug/Project.pm index be62921..0d2db8e 100644 --- a/lib/jitterbug/Project.pm +++ b/lib/jitterbug/Project.pm @@ -24,6 +24,8 @@ get '/:project' => sub { push @builds, from_json($res) if $res; } + @builds = sort {$b->{timestamp} cmp $a->{timestamp}} @builds; + template 'project/index', { project => $project, builds => \@builds, %$desc }; }; diff --git a/public/css/style.css b/public/css/style.css index 1e33a4e..6cce1f1 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -207,7 +207,7 @@ pre { overflow:hidden; } -#display_test_result { +.display_test_result { background: black; color: white; } diff --git a/views/layouts/main.tt b/views/layouts/main.tt index 2512de7..cf3f0e0 100644 --- a/views/layouts/main.tt +++ b/views/layouts/main.tt @@ -9,8 +9,10 @@ $(document).ready(function() { $('.builds a').click(function() { var url = $(this).attr("href"); + var id = $(this).parents('.commit').attr('id'); + console.log("id => " + id); $.getJSON(url, null, function(data) { - $("#display_test_result").html("
" + data.content + "
");
+            $("#result-" + id).html("
" + data.content + "
");
           });
           return false;
       })})
diff --git a/views/project/index.tt b/views/project/index.tt
index ff17e98..877a803 100644
--- a/views/project/index.tt
+++ b/views/project/index.tt
@@ -28,11 +28,10 @@
             
         
     
+    
+
:} -
-
- -- cgit v1.2.3