file => $c->stash->{filename},
);
- my $json_obj = $commit
- ? { sha1 => $commit->sha1, comment => $c->stash->{short_cmt}->($commit->comment) }
- : { };
+ my $json_obj = !$commit
+ ? { }
+ : {
+ sha1 => $commit->sha1,
+ comment => $c->stash->{short_cmt}->($commit->comment),
+ age => $c->stash->{time_since}->($commit->authored_time),
+ };
$c->response->content_type('application/json');
# XXX Make use of the json branch
var filename = cell.parent().find('.file-name').text();
$.getJSON('/fragment/Gitalist/[% Commit.sha1 %]/file_commit_info/'+filename, {}, function(commitInfo) {
cell.empty();
- cell.html('<a href="/Gitalist/'+commitInfo.sha1+'/commit">'+commitInfo.comment+'</a>');
+ cell.html('<a href="/Gitalist/'+commitInfo.sha1+'/commit">'+commitInfo.comment+'</a> '+commitInfo.age);
});
});
});