Start on the new build view

This commit is contained in:
Joseph Schorr 2015-02-26 17:45:28 -05:00
parent 5cc1c90021
commit e227d7e526
30 changed files with 816 additions and 11 deletions

View file

@ -11,9 +11,29 @@ angular.module('quay').directive('resourceView', function () {
restrict: 'C',
scope: {
'resource': '=resource',
'resources': '=resources',
'errorMessage': '=errorMessage'
},
controller: function($scope, $element) {
$scope.getState = function() {
if (!$scope.resources && !$scope.resource) {
return 'loading';
}
var resources = $scope.resources || [$scope.resource];
for (var i = 0; i < resources.length; ++i) {
var current = resources[i];
if (current.loading) {
return 'loading';
}
if (current.error) {
return 'error';
}
}
return 'ready';
};
}
};
return directiveDefinitionObject;