From ec18b6e5b6d99cdf0566af2805092ad5bdda9085 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Mon, 9 May 2011 09:38:31 +0200 Subject: show more informations about a task (closes GH #55) Signed-off-by: franck cuny --- lib/jitterbug/Task.pm | 9 ++++++++- public/css/style.css | 2 +- views/task/index.tt | 31 +++++++++++++++++++++++++++---- 3 files changed, 36 insertions(+), 6 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; diff --git a/public/css/style.css b/public/css/style.css index bcd6154..378d6f6 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -232,7 +232,6 @@ 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;} @@ -243,6 +242,7 @@ font-family:Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",m .commit .name{float:left; width: 100%;} .commit .name .date{color:#888;font-size:90%;} +.commit .name .date_started{color:#888;font-size:90%;} .commit .name .author{font-weight: bolder;line-height:2em} .commit .gravatar{border:1px solid #d0d0d0;padding:2px;background-color:white;float:left;margin-right:.7em;} diff --git a/views/task/index.tt b/views/task/index.tt index 25bdeb9..ca9ba46 100644 --- a/views/task/index.tt +++ b/views/task/index.tt @@ -1,6 +1,29 @@
-
-

Task <: $task.id :>

- started : <: $task.started_when :> -
+
+

Task <: $task.id :>

+
+
+
<: $commit.message :>
+
+
+ +
+
<: $commit.author.name :>
+
pushed on <: $commit.timestamp :>
+
+
+
+
+ commit   <: $commit.id :>
+ <: if $commit.ref { :> + on      <: $commit.ref :> + <: } :> +
+ <: if $commit.build.start_time { :> + started <: $task.started_when :> + <: } :> +
+
+
+
-- cgit v1.2.3