Start on mobilification of repo view

This commit is contained in:
Joseph Schorr 2015-04-20 17:42:33 -04:00
parent 79caf2dab2
commit a4cacd7307
31 changed files with 265 additions and 91 deletions

View file

@ -18,12 +18,6 @@ angular.module('quay').directive('prototypeManager', function () {
$scope.clearCounter = 0;
$scope.newForWholeOrg = true;
$scope.roles = [
{ 'id': 'read', 'title': 'Read', 'kind': 'success' },
{ 'id': 'write', 'title': 'Write', 'kind': 'success' },
{ 'id': 'admin', 'title': 'Admin', 'kind': 'primary' }
];
$scope.setRole = function(role, prototype) {
var params = {
'orgname': $scope.organization.name,

View file

@ -28,13 +28,6 @@ angular.module('quay').directive('repositoryPermissionsTable', function () {
'repository': '=repository'
},
controller: function($scope, $element, ApiService, Restangular, UtilService) {
// TODO(jschorr): move this to a service.
$scope.roles = [
{ 'id': 'read', 'title': 'Read', 'kind': 'success' },
{ 'id': 'write', 'title': 'Write', 'kind': 'success' },
{ 'id': 'admin', 'title': 'Admin', 'kind': 'primary' }
];
$scope.permissionResources = {'team': {}, 'user': {}};
$scope.permissionCache = {};
$scope.permissions = {};

View file

@ -14,12 +14,6 @@ angular.module('quay').directive('repositoryTokensTable', function () {
'hasTokens': '=hasTokens'
},
controller: function($scope, $element, ApiService, Restangular, UtilService) {
$scope.roles = [
{ 'id': 'read', 'title': 'Read', 'kind': 'success' },
{ 'id': 'write', 'title': 'Write', 'kind': 'success' },
{ 'id': 'admin', 'title': 'Admin', 'kind': 'primary' }
];
$scope.hasTokens = false;
var loadTokens = function() {

View file

@ -15,13 +15,6 @@ angular.module('quay').directive('robotsManager', function () {
controller: function($scope, $element, ApiService, $routeParams, CreateService, Config) {
$scope.ROBOT_PATTERN = ROBOT_PATTERN;
// TODO(jschorr): move this to a service.
$scope.roles = [
{ 'id': 'read', 'title': 'Read', 'kind': 'success' },
{ 'id': 'write', 'title': 'Write', 'kind': 'success' },
{ 'id': 'admin', 'title': 'Admin', 'kind': 'primary' }
];
$scope.robots = null;
$scope.loading = false;
$scope.shownRobot = null;

View file

@ -10,12 +10,14 @@ angular.module('quay').directive('roleGroup', function () {
transclude: false,
restrict: 'C',
scope: {
'roles': '=roles',
'roles': '@roles',
'currentRole': '=currentRole',
'readOnly': '=readOnly',
'roleChanged': '&roleChanged'
},
controller: function($scope, $element) {
controller: function($scope, $element, RolesService) {
$scope.fullRoles = RolesService[$scope.roles];
$scope.setRole = function(role) {
if ($scope.currentRole == role) { return; }
if ($scope.roleChanged) {
@ -24,6 +26,14 @@ angular.module('quay').directive('roleGroup', function () {
$scope.currentRole = role;
}
};
$scope.getRoleInfo = function(role) {
var found = null;
$scope.fullRoles.forEach(function(r) {
if (r.id == role) { found = r; }
});
return found;
};
}
};
return directiveDefinitionObject;