Add route and page to enable experiment

This commit is contained in:
Ian Minoso 2016-09-20 17:10:09 -04:00
parent 24327f4964
commit 4dd6166d21
4 changed files with 35 additions and 2 deletions

View file

@ -10,7 +10,7 @@
});
}]);
function RepoViewCtrl($scope, $routeParams, $location, $timeout, ApiService, UserService, AngularPollChannel, ImageLoaderService) {
function RepoViewCtrl($scope, $routeParams, $location, $timeout, ApiService, UserService, AngularPollChannel, ImageLoaderService, CookieService) {
$scope.namespace = $routeParams.namespace;
$scope.name = $routeParams.name;
@ -60,9 +60,10 @@
$scope.repositoryResource = ApiService.getRepoAsResource(params).get(function(repo) {
$scope.repository = repo;
$scope.viewScope.repository = repo;
$scope.publicRepoExperiment = CookieService.get('quay.public-repo-exp') == 'true';
// Flag for new repo page experiment
$scope.newRepoExperiment = ($scope.repository.is_public && $scope.user.username != $scope.repository.namespace && $scope.publicRepoExperiment) ? true : false;
$scope.newRepoExperiment = $scope.repository.is_public && $scope.user.username != $scope.repository.namespace && $scope.publicRepoExperiment;
// Load the remainder of the data async, so we don't block the initial view from
// showing.