Create a common repo-list-view control and use it everywhere

This allows users to choose grid view or table view in all repo lists

Fixes #732
This commit is contained in:
Joseph Schorr 2015-12-28 16:29:17 -05:00
parent 16f16e8a15
commit 3da8814787
13 changed files with 115 additions and 77 deletions

View file

@ -11,14 +11,13 @@
}]);
function RepoListCtrl($scope, $sanitize, $q, Restangular, UserService, ApiService, CookieService, Features) {
function RepoListCtrl($scope, $sanitize, $q, Restangular, UserService, ApiService, Features) {
$scope.namespace = null;
$scope.page = 1;
$scope.publicPageCount = null;
$scope.allRepositories = {};
$scope.loading = true;
$scope.resources = [];
$scope.showAsList = CookieService.get('quay.repoview') == 'list';
$scope.Features = Features;
// When loading the UserService, if the user is logged in, create a list of
@ -46,11 +45,6 @@
}
});
$scope.setShowAsList = function(value) {
$scope.showAsList = value;
CookieService.putPermanent('quay.repoview', value ? 'list' : 'grid');
};
$scope.isOrganization = function(namespace) {
return !!UserService.getOrganization(namespace);
};