Add a table view to the repos list page

Fixes #104
This commit is contained in:
Joseph Schorr 2015-06-09 17:58:57 -04:00
parent 7043ddc935
commit 2b1bbcb579
16 changed files with 416 additions and 134 deletions

View file

@ -16,12 +16,14 @@
}]);
function RepoListCtrl($scope, $sanitize, $q, Restangular, UserService, ApiService) {
function RepoListCtrl($scope, $sanitize, $q, Restangular, UserService, ApiService, CookieService) {
$scope.namespace = null;
$scope.page = 1;
$scope.publicPageCount = null;
$scope.allRepositories = {};
$scope.loading = true;
$scope.resources = [];
$scope.showAsList = CookieService.get('quay.repoview') == 'list';
// When loading the UserService, if the user is logged in, create a list of
// relevant namespaces and collect the relevant repositories.
@ -48,6 +50,11 @@
}
});
$scope.setShowAsList = function(value) {
$scope.showAsList = value;
CookieService.putPermanent('quay.repoview', value ? 'list' : 'grid');
};
$scope.isOrganization = function(namespace) {
return !!UserService.getOrganization(namespace);
};
@ -97,11 +104,15 @@
'public': false,
'sort': true,
'namespace': namespace.name,
'last_modified': true,
'popularity': true
};
namespace.repositories = ApiService.listReposAsResource().withOptions(options).get(function(resp) {
return resp.repositories.map(findDuplicateRepo);
});
$scope.resources.push(namespace.repositories);
});
};
}