parent
de41c613e4
commit
e3ed2c8a92
4 changed files with 15 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Reference in a new issue