Add a namespace selector for choosing the namespace in the new repo view
This commit is contained in:
parent
d7148b1711
commit
1f0b142535
6 changed files with 75 additions and 6 deletions
|
@ -231,6 +231,36 @@ quayApp.directive('repoCircle', function () {
|
|||
});
|
||||
|
||||
|
||||
quayApp.directive('namespaceSelector', function () {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 0,
|
||||
templateUrl: '/static/directives/namespace-selector.html',
|
||||
replace: false,
|
||||
transclude: false,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'user': '=user',
|
||||
'namespace': '=namespace'
|
||||
},
|
||||
controller: function($scope, $element) {
|
||||
$scope.setNamespace = function(namespaceObj) {
|
||||
if (!namespaceObj) {
|
||||
namespaceObj = {'name': '', 'gravatar': ''};
|
||||
}
|
||||
$scope.namespaceObj = namespaceObj;
|
||||
$scope.namespace = namespaceObj.name || namespaceObj.username;
|
||||
};
|
||||
$scope.setNamespace($scope.user);
|
||||
|
||||
$scope.$watch('user', function(user) {
|
||||
$scope.setNamespace(user);
|
||||
});
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
});
|
||||
|
||||
|
||||
quayApp.directive('buildStatus', function () {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 0,
|
||||
|
|
Reference in a new issue