1f5e6df678
- Add new endpoints for retrieving the repo permissions for a robot account - Have the robots list return the number of repositories for which there are permissions - Other UI fixes
30 lines
No EOL
865 B
JavaScript
30 lines
No EOL
865 B
JavaScript
/**
|
|
* An element which displays a set of roles, and highlights the current role. This control also
|
|
* allows the current role to be changed.
|
|
*/
|
|
angular.module('quay').directive('roleGroup', function () {
|
|
var directiveDefinitionObject = {
|
|
priority: 0,
|
|
templateUrl: '/static/directives/role-group.html',
|
|
replace: false,
|
|
transclude: false,
|
|
restrict: 'C',
|
|
scope: {
|
|
'roles': '=roles',
|
|
'currentRole': '=currentRole',
|
|
'readOnly': '=readOnly',
|
|
'roleChanged': '&roleChanged'
|
|
},
|
|
controller: function($scope, $element) {
|
|
$scope.setRole = function(role) {
|
|
if ($scope.currentRole == role) { return; }
|
|
if ($scope.roleChanged) {
|
|
$scope.roleChanged({'role': role});
|
|
} else {
|
|
$scope.currentRole = role;
|
|
}
|
|
};
|
|
}
|
|
};
|
|
return directiveDefinitionObject;
|
|
}); |