Start on UI for Quay
This commit is contained in:
parent
9278871381
commit
27ce5c00b2
10 changed files with 258 additions and 17 deletions
|
@ -8,3 +8,33 @@ function RepoListCtrl($scope, Restangular) {
|
|||
function LandingCtrl($scope) {
|
||||
|
||||
}
|
||||
|
||||
function RepoCtrl($scope, Restangular, $routeParams, $rootScope) {
|
||||
$rootScope.title = 'Loading...';
|
||||
|
||||
$scope.editDescription = function() {
|
||||
if (!$scope.repo.can_write) { return; }
|
||||
$('#descriptionEdit')[0].value = $scope.repo.description || '';
|
||||
$('#editModal').modal({});
|
||||
};
|
||||
|
||||
$scope.saveDescription = function() {
|
||||
$('#editModal').modal('hide');
|
||||
$scope.repo.description = $('#descriptionEdit')[0].value;
|
||||
$scope.repo.put();
|
||||
};
|
||||
|
||||
var namespace = $routeParams.namespace;
|
||||
var name = $routeParams.name;
|
||||
var tag = $routeParams.tag || 'latest';
|
||||
|
||||
var repositoryFetch = Restangular.one('repository/' + namespace + '/' + name);
|
||||
repositoryFetch.get().then(function(repo) {
|
||||
$rootScope.title = namespace + '/' + name;
|
||||
$scope.repo = repo;
|
||||
$scope.currentTag = repo.tags[tag] || repo.tags['latest'];
|
||||
}, function() {
|
||||
$scope.repo = null;
|
||||
$rootScope.title = 'Unknown Repository';
|
||||
});
|
||||
}
|
Reference in a new issue