about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2011-05-09 09:38:31 +0200
committerfranck cuny <franck@lumberjaph.net>2011-05-09 16:42:15 +0200
commitec18b6e5b6d99cdf0566af2805092ad5bdda9085 (patch)
treefe0f241e8717003ce66fdc3d9d7a9f44ca1b5027 /lib
parentimplement some of #12 (diff)
downloadjitterbug-ec18b6e5b6d99cdf0566af2805092ad5bdda9085.tar.gz
show more informations about a task (closes GH #55)
Signed-off-by: franck cuny <franck@lumberjaph.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/jitterbug/Task.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/jitterbug/Task.pm b/lib/jitterbug/Task.pm
index 24366c1..b435de3 100644
--- a/lib/jitterbug/Task.pm
+++ b/lib/jitterbug/Task.pm
@@ -8,12 +8,19 @@ get '/:task_id' => sub {
     my $task_id = params->{task_id};
 
     my $task = schema->resultset('Task')->find($task_id);
+    my $commit =
+      schema->resultset('Commit')->find( { sha256 => $task->sha256 } );
 
     if (!$task) {
         send_error("task does not exist!", 404);
     }
 
-    template 'task/index', {task => $task };
+    if (!$commit){
+        render_error("commit doesn't exists", 404);
+    }
+
+    my $content = from_json($commit->content);
+    template 'task/index', {task => $task, commit => $content };
 };
 
 1;