diff --git a/static/directives/repo-list-table.html b/static/directives/repo-list-table.html index ce6ba9d98..4707551b8 100644 --- a/static/directives/repo-list-table.html +++ b/static/directives/repo-list-table.html @@ -24,7 +24,8 @@ + style="width: 70px" + ng-if="loggedIn"> Star @@ -48,9 +49,10 @@ - + + star-toggled="starToggled({'repository': repository})"> + diff --git a/static/directives/repo-star.html b/static/directives/repo-star.html index 198cdcd83..40b2a654f 100644 --- a/static/directives/repo-star.html +++ b/static/directives/repo-star.html @@ -1,5 +1,5 @@ + class="star-icon" ng-click="toggleStar()" ng-show="loggedIn"> diff --git a/static/js/directives/ui/repo-list-table.js b/static/js/directives/ui/repo-list-table.js index 4b9b59fdd..f6d19eaad 100644 --- a/static/js/directives/ui/repo-list-table.js +++ b/static/js/directives/ui/repo-list-table.js @@ -13,7 +13,7 @@ angular.module('quay').directive('repoListTable', function () { 'namespaces': '=namespaces', 'starToggled': '&starToggled' }, - controller: function($scope, $element, $filter, TableService) { + controller: function($scope, $element, $filter, TableService, UserService) { $scope.repositories = null; $scope.orderedRepositories = []; @@ -93,6 +93,8 @@ angular.module('quay').directive('repoListTable', function () { }); buildOrderedRepositories(); + + $scope.loggedIn = !UserService.currentUser().anonymous; }, /* deep */ true); } }; diff --git a/static/js/directives/ui/repo-star.js b/static/js/directives/ui/repo-star.js index 6160222d8..b456a08bd 100644 --- a/static/js/directives/ui/repo-star.js +++ b/static/js/directives/ui/repo-star.js @@ -13,6 +13,8 @@ angular.module('quay').directive('repoStar', function () { starToggled: '&starToggled' }, controller: function($scope, $element, UserService, ApiService) { + $scope.loggedIn = false; + // Star a repository or unstar a repository. $scope.toggleStar = function() { if ($scope.repository.is_starred) { @@ -46,6 +48,10 @@ angular.module('quay').directive('repoStar', function () { $scope.starToggled({'repository': $scope.repository}); }, ApiService.errorDisplay('Could not unstar repository')); }; + + $scope.$watch('repository', function() { + $scope.loggedIn = !UserService.currentUser().anonymous; + }); } };