Begin work on an image history tree view

This commit is contained in:
Joseph Schorr 2013-10-10 00:40:18 -04:00
parent d7ea1944e3
commit 9f094af1b2
9 changed files with 664 additions and 17 deletions

View file

@ -242,6 +242,10 @@ function RepoCtrl($scope, Restangular, $routeParams, $rootScope) {
return getMarkedDown(getFirstTextLine(commentString));
};
$scope.getTimeSince= function(createdTime) {
return moment($scope.parseDate(createdTime)).fromNow();
};
$scope.getMarkedDown = function(string) {
if (!string) { return ''; }
return getMarkedDown(string);
@ -253,6 +257,8 @@ function RepoCtrl($scope, Restangular, $routeParams, $rootScope) {
var imageFetch = Restangular.one('repository/' + namespace + '/' + name + '/tag/' + $scope.currentTag.name + '/images');
imageFetch.get().then(function(resp) {
$scope.imageHistory = resp.images;
var tree = new ImageHistoryTree(resp.images, $scope.currentTag.image, $scope.getCommentFirstLine, $scope.getTimeSince);
tree.draw('image-history-container');
});
};