Further fixes to make everything work nicely with Github Enterprise

This commit is contained in:
Joseph Schorr 2014-11-26 12:54:02 -05:00
parent b7a489813a
commit 52b7896835
4 changed files with 84 additions and 69 deletions

View file

@ -1,7 +1,10 @@
<span class="trigger-description-element" ng-switch on="trigger.service"> <span class="trigger-description-element" ng-switch on="trigger.service">
<span ng-switch-when="github"> <span ng-switch-when="github">
<i class="fa fa-github fa-lg" style="margin-right: 6px" data-title="GitHub" bs-tooltip="tooltip.title"></i> <i class="fa fa-github fa-lg" style="margin-right: 6px" data-title="GitHub" bs-tooltip="tooltip.title"></i>
Push to GitHub repository <a href="https://github.com/{{ trigger.config.build_source }}" target="_new">{{ trigger.config.build_source }}</a> Push to GitHub <span ng-if="KeyService.isEnterprise('github-trigger')">Enterprise</span> repository
<a href="{{ KeyService['githubTriggerEndpoint'] }}{{ trigger.config.build_source }}" target="_new">
{{ trigger.config.build_source }}
</a>
<div style="margin-top: 4px; margin-left: 26px; font-size: 12px; color: gray;" ng-if="!short"> <div style="margin-top: 4px; margin-left: 26px; font-size: 12px; color: gray;" ng-if="!short">
<div> <div>
<span class="trigger-description-subtitle">Branches/Tags:</span> <span class="trigger-description-subtitle">Branches/Tags:</span>

View file

@ -1729,14 +1729,22 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
keyService['githubEndpoint'] = oauth['GITHUB_LOGIN_CONFIG']['GITHUB_ENDPOINT']; keyService['githubEndpoint'] = oauth['GITHUB_LOGIN_CONFIG']['GITHUB_ENDPOINT'];
keyService['githubTriggerEndpoint'] = oauth['GITHUB_TRIGGER_CONFIG']['GITHUB_ENDPOINT'];
keyService['githubTriggerAuthorizeUrl'] = oauth['GITHUB_TRIGGER_CONFIG']['AUTHORIZE_ENDPOINT']; keyService['githubTriggerAuthorizeUrl'] = oauth['GITHUB_TRIGGER_CONFIG']['AUTHORIZE_ENDPOINT'];
keyService['githubLoginScope'] = 'user:email'; keyService['githubLoginScope'] = 'user:email';
keyService['googleLoginScope'] = 'openid email'; keyService['googleLoginScope'] = 'openid email';
keyService.isEnterprise = function(service) { keyService.isEnterprise = function(service) {
var isGithubEnterprise = keyService['githubLoginUrl'].indexOf('https://github.com/') < 0; switch (service) {
return service == 'github' && isGithubEnterprise; case 'github':
return keyService['githubLoginUrl'].indexOf('https://github.com/') < 0;
case 'github-trigger':
return keyService['githubTriggerAuthorizeUrl'].indexOf('https://github.com/') < 0;
}
return false;
}; };
keyService.getExternalLoginUrl = function(service, action) { keyService.getExternalLoginUrl = function(service, action) {
@ -4806,7 +4814,9 @@ quayApp.directive('triggerDescription', function () {
'trigger': '=trigger', 'trigger': '=trigger',
'short': '=short' 'short': '=short'
}, },
controller: function($scope, $element) { controller: function($scope, $element, KeyService, TriggerService) {
$scope.KeyService = KeyService;
$scope.TriggerService = TriggerService;
} }
}; };
return directiveDefinitionObject; return directiveDefinitionObject;

View file

@ -59,13 +59,13 @@ function PlansCtrl($scope, $location, UserService, PlanService, $routeParams) {
$scope.signedIn = function() { $scope.signedIn = function() {
$('#signinModal').modal('hide'); $('#signinModal').modal('hide');
PlanService.handleNotedPlan(); PlanService.handleNotedPlan();
}; };
$scope.buyNow = function(plan) { $scope.buyNow = function(plan) {
PlanService.notePlan(plan); PlanService.notePlan(plan);
if ($scope.user && !$scope.user.anonymous) { if ($scope.user && !$scope.user.anonymous) {
PlanService.handleNotedPlan(); PlanService.handleNotedPlan();
} else { } else {
$('#signinModal').modal({}); $('#signinModal').modal({});
} }
@ -77,7 +77,7 @@ function PlansCtrl($scope, $location, UserService, PlanService, $routeParams) {
if ($scope && $routeParams['trial-plan']) { if ($scope && $routeParams['trial-plan']) {
$scope.buyNow($routeParams['trial-plan']); $scope.buyNow($routeParams['trial-plan']);
} }
}, /* include the personal plan */ true); }, /* include the personal plan */ true);
} }
@ -94,7 +94,7 @@ function TutorialCtrl($scope, AngularTour, AngularTourSignals, UserService, Conf
'steps': [ 'steps': [
{ {
'title': 'Welcome to the ' + Config.REGISTRY_TITLE_SHORT + ' tutorial!', 'title': 'Welcome to the ' + Config.REGISTRY_TITLE_SHORT + ' tutorial!',
'templateUrl': '/static/tutorial/welcome.html' 'templateUrl': '/static/tutorial/welcome.html'
}, },
{ {
'title': 'Sign in to get started', 'title': 'Sign in to get started',
@ -235,7 +235,7 @@ function RepoListCtrl($scope, $sanitize, Restangular, UserService, ApiService) {
$scope.namespace = null; $scope.namespace = null;
$scope.page = 1; $scope.page = 1;
$scope.publicPageCount = null; $scope.publicPageCount = null;
// Monitor changes in the user. // Monitor changes in the user.
UserService.updateUserIn($scope, function() { UserService.updateUserIn($scope, function() {
loadMyRepos($scope.namespace); loadMyRepos($scope.namespace);
@ -269,7 +269,7 @@ function RepoListCtrl($scope, $sanitize, Restangular, UserService, ApiService) {
} }
var options = {'public': false, 'sort': true, 'namespace': namespace}; var options = {'public': false, 'sort': true, 'namespace': namespace};
$scope.user_repositories = ApiService.listReposAsResource().withOptions(options).get(function(resp) { $scope.user_repositories = ApiService.listReposAsResource().withOptions(options).get(function(resp) {
return resp.repositories; return resp.repositories;
}); });
@ -318,7 +318,7 @@ function LandingCtrl($scope, UserService, ApiService, Features, Config) {
if (namespace == $scope.user.username) { if (namespace == $scope.user.username) {
return true; return true;
} }
if ($scope.user.organizations) { if ($scope.user.organizations) {
for (var i = 0; i < $scope.user.organizations.length; ++i) { for (var i = 0; i < $scope.user.organizations.length; ++i) {
var org = $scope.user.organizations[i]; var org = $scope.user.organizations[i];
@ -483,7 +483,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
$scope.currentPullCommand = $scope.pullCommands[0]; $scope.currentPullCommand = $scope.pullCommands[0];
}; };
$scope.showNewBuildDialog = function() { $scope.showNewBuildDialog = function() {
$scope.buildDialogShowCounter++; $scope.buildDialogShowCounter++;
}; };
@ -655,7 +655,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
$scope.setImage = function(imageId, opt_updateURL) { $scope.setImage = function(imageId, opt_updateURL) {
if (!$scope.images) { return; } if (!$scope.images) { return; }
var image = null; var image = null;
for (var i = 0; i < $scope.images.length; ++i) { for (var i = 0; i < $scope.images.length; ++i) {
var currentImage = $scope.images[i]; var currentImage = $scope.images[i];
@ -691,7 +691,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
// We must find a good default. // We must find a good default.
for (tagName in repo.tags) { for (tagName in repo.tags) {
if (!proposedTag || tagName == 'latest') { if (!proposedTag || tagName == 'latest') {
proposedTag = repo.tags[tagName]; proposedTag = repo.tags[tagName];
} }
} }
} }
@ -702,7 +702,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
if ($scope.tree) { if ($scope.tree) {
$scope.tree.setTag(proposedTag.name); $scope.tree.setTag(proposedTag.name);
} }
if (opt_updateURL) { if (opt_updateURL) {
$location.search('image', null); $location.search('image', null);
@ -871,7 +871,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
}; };
var listImages = function() { var listImages = function() {
var params = {'repository': namespace + '/' + name}; var params = {'repository': namespace + '/' + name};
$scope.imageHistory = ApiService.listRepositoryImagesAsResource(params).get(function(resp) { $scope.imageHistory = ApiService.listRepositoryImagesAsResource(params).get(function(resp) {
$scope.images = resp.images; $scope.images = resp.images;
$scope.specificImages = []; $scope.specificImages = [];
@ -971,7 +971,7 @@ function BuildPackageCtrl($scope, Restangular, ApiService, DataFileService, $rou
return dockerfilePath; return dockerfilePath;
}; };
var processBuildPack = function(uint8array) { var processBuildPack = function(uint8array) {
var archiveread = function(files) { var archiveread = function(files) {
var getpath = function(file) { var getpath = function(file) {
return file.path; return file.path;
@ -1056,7 +1056,7 @@ function BuildPackageCtrl($scope, Restangular, ApiService, DataFileService, $rou
$scope.accessDenied = true; $scope.accessDenied = true;
return; return;
} }
$rootScope.title = 'Repository Build Pack - ' + resp['display_name']; $rootScope.title = 'Repository Build Pack - ' + resp['display_name'];
$scope.repobuild = resp; $scope.repobuild = resp;
$scope.repo = { $scope.repo = {
@ -1115,7 +1115,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
$('#confirmRestartBuildModal').modal('hide'); $('#confirmRestartBuildModal').modal('hide');
var subdirectory = ''; var subdirectory = '';
if (build['job_config']) { if (build['job_config']) {
subdirectory = build['job_config']['build_subdir'] || ''; subdirectory = build['job_config']['build_subdir'] || '';
} }
@ -1159,7 +1159,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
$scope.processANSI = function(message, container) { $scope.processANSI = function(message, container) {
var filter = container.logs._filter = (container.logs._filter || ansi2html.create()); var filter = container.logs._filter = (container.logs._filter || ansi2html.create());
// Note: order is important here. // Note: order is important here.
var setup = filter.getSetupHtml(); var setup = filter.getSetupHtml();
var stream = filter.addInputToStream(message); var stream = filter.addInputToStream(message);
@ -1194,7 +1194,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
if ($scope.pollChannel) { if ($scope.pollChannel) {
$scope.pollChannel.stop(); $scope.pollChannel.stop();
} }
// Create a new channel for polling the build status and logs. // Create a new channel for polling the build status and logs.
var conductStatusAndLogRequest = function(callback) { var conductStatusAndLogRequest = function(callback) {
getBuildStatusAndLogs(build, callback); getBuildStatusAndLogs(build, callback);
@ -1230,7 +1230,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
return endIndex; return endIndex;
}; };
var getBuildStatusAndLogs = function(build, callback) { var getBuildStatusAndLogs = function(build, callback) {
var params = { var params = {
'repository': namespace + '/' + name, 'repository': namespace + '/' + name,
'build_uuid': build.id 'build_uuid': build.id
@ -1258,9 +1258,9 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
'start': $scope.logStartIndex 'start': $scope.logStartIndex
}; };
ApiService.getRepoBuildLogsAsResource(params, true).withOptions(options).get(function(resp) { ApiService.getRepoBuildLogsAsResource(params, true).withOptions(options).get(function(resp) {
if (build != $scope.currentBuild) { callback(false); return; } if (build != $scope.currentBuild) { callback(false); return; }
// Process the logs we've received. // Process the logs we've received.
$scope.logStartIndex = processLogs(resp['logs'], resp['start'], resp['total']); $scope.logStartIndex = processLogs(resp['logs'], resp['start'], resp['total']);
@ -1323,7 +1323,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
fetchRepository(); fetchRepository();
} }
function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerService, $routeParams, function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerService, $routeParams,
$rootScope, $location, UserService, Config, Features, ExternalNotificationData) { $rootScope, $location, UserService, Config, Features, ExternalNotificationData) {
var namespace = $routeParams.namespace; var namespace = $routeParams.namespace;
@ -1331,11 +1331,12 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi
$scope.Features = Features; $scope.Features = Features;
$scope.TriggerService = TriggerService; $scope.TriggerService = TriggerService;
$scope.KeyService = KeyService;
$scope.permissions = {'team': [], 'user': [], 'loading': 2}; $scope.permissions = {'team': [], 'user': [], 'loading': 2};
$scope.logsShown = 0; $scope.logsShown = 0;
$scope.deleting = false; $scope.deleting = false;
$scope.permissionCache = {}; $scope.permissionCache = {};
$scope.showTriggerSetupCounter = 0; $scope.showTriggerSetupCounter = 0;
@ -1436,7 +1437,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi
var permission = $scope.permissions[kind][entityName]; var permission = $scope.permissions[kind][entityName];
var currentRole = permission.role; var currentRole = permission.role;
permission.role = role; permission.role = role;
var permissionPut = Restangular.one(getRestUrl('repository', namespace, name, 'permissions', kind, entityName)); var permissionPut = Restangular.one(getRestUrl('repository', namespace, name, 'permissions', kind, entityName));
permissionPut.customPUT(permission).then(function() {}, function(resp) { permissionPut.customPUT(permission).then(function() {}, function(resp) {
$scope.permissions[kind][entityName] = {'role': currentRole}; $scope.permissions[kind][entityName] = {'role': currentRole};
@ -1534,7 +1535,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi
$scope.deleting = true; $scope.deleting = true;
ApiService.deleteRepository(null, params).then(function() { ApiService.deleteRepository(null, params).then(function() {
$scope.repo = null; $scope.repo = null;
setTimeout(function() { setTimeout(function() {
document.location = '/repository/'; document.location = '/repository/';
}, 1000); }, 1000);
@ -1545,7 +1546,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi
}; };
$scope.showNewNotificationCounter = 0; $scope.showNewNotificationCounter = 0;
$scope.showNewNotificationDialog = function() { $scope.showNewNotificationDialog = function() {
$scope.showNewNotificationCounter++; $scope.showNewNotificationCounter++;
}; };
@ -1629,7 +1630,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi
}; };
$scope.showManualBuildDialog = 0; $scope.showManualBuildDialog = 0;
$scope.startTrigger = function(trigger, opt_custom) { $scope.startTrigger = function(trigger, opt_custom) {
var parameters = TriggerService.getRunParameters(trigger.service); var parameters = TriggerService.getRunParameters(trigger.service);
if (parameters.length && !opt_custom) { if (parameters.length && !opt_custom) {
@ -1765,7 +1766,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use
$scope.logsShown = 0; $scope.logsShown = 0;
$scope.invoicesShown = 0; $scope.invoicesShown = 0;
$scope.loadAuthedApps = function() { $scope.loadAuthedApps = function() {
if ($scope.authorizedApps) { return; } if ($scope.authorizedApps) { return; }
@ -1808,7 +1809,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use
$scope.orgPlans = plans; $scope.orgPlans = plans;
}); });
} }
$scope.convertStep = 1; $scope.convertStep = 1;
}; };
@ -1883,7 +1884,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use
UserService.load(); UserService.load();
}, function(result) { }, function(result) {
$scope.updatingUser = false; $scope.updatingUser = false;
UIService.showFormError('#changePasswordForm', result); UIService.showFormError('#changePasswordForm', result);
}); });
}; };
@ -1900,7 +1901,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use
}; };
} }
function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, ImageMetadataService) { function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, ImageMetadataService) {
var namespace = $routeParams.namespace; var namespace = $routeParams.namespace;
var name = $routeParams.name; var name = $routeParams.name;
var imageid = $routeParams.image; var imageid = $routeParams.image;
@ -1924,7 +1925,7 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I
if (index < 0) { if (index < 0) {
return ''; return '';
} }
return filepath.substr(0, index).split('/'); return filepath.substr(0, index).split('/');
}; };
@ -1947,10 +1948,10 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I
$scope.search['$'] = filter; $scope.search['$'] = filter;
document.getElementById('change-filter').value = filter; document.getElementById('change-filter').value = filter;
}; };
$scope.initializeTree = function() { $scope.initializeTree = function() {
if ($scope.tree) { return; } if ($scope.tree) { return; }
$scope.tree = new ImageFileChangeTree($scope.image, $scope.combinedChanges); $scope.tree = new ImageFileChangeTree($scope.image, $scope.combinedChanges);
$timeout(function() { $timeout(function() {
$scope.tree.draw('changes-tree-container'); $scope.tree.draw('changes-tree-container');
@ -1970,7 +1971,7 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I
var fetchImage = function() { var fetchImage = function() {
var params = { var params = {
'repository': namespace + '/' + name, 'repository': namespace + '/' + name,
'image_id': imageid 'image_id': imageid
}; };
$scope.image = ApiService.getImageAsResource(params).get(function(image) { $scope.image = ApiService.getImageAsResource(params).get(function(image) {
@ -1995,14 +1996,14 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I
var fetchChanges = function() { var fetchChanges = function() {
var params = { var params = {
'repository': namespace + '/' + name, 'repository': namespace + '/' + name,
'image_id': imageid 'image_id': imageid
}; };
ApiService.getImageChanges(null, params).then(function(changes) { ApiService.getImageChanges(null, params).then(function(changes) {
var combinedChanges = []; var combinedChanges = [];
var addCombinedChanges = function(c, kind) { var addCombinedChanges = function(c, kind) {
for (var i = 0; i < c.length; ++i) { for (var i = 0; i < c.length; ++i) {
combinedChanges.push({ combinedChanges.push({
'kind': kind, 'kind': kind,
'file': c[i] 'file': c[i]
}); });
@ -2046,7 +2047,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, ApiService
$scope.$watch('repo.namespace', function(namespace) { $scope.$watch('repo.namespace', function(namespace) {
// Note: Can initially be undefined. // Note: Can initially be undefined.
if (!namespace) { return; } if (!namespace) { return; }
var isUserNamespace = (namespace == $scope.user.username); var isUserNamespace = (namespace == $scope.user.username);
$scope.planRequired = null; $scope.planRequired = null;
@ -2083,7 +2084,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, ApiService
} }
} }
}); });
return true; return true;
}; };
@ -2156,7 +2157,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, ApiService
var isUserNamespace = $scope.isUserNamespace; var isUserNamespace = $scope.isUserNamespace;
ApiService.getPrivateAllowed(isUserNamespace ? null : $scope.repo.namespace).then(function(resp) { ApiService.getPrivateAllowed(isUserNamespace ? null : $scope.repo.namespace).then(function(resp) {
$scope.checkingPlan = false; $scope.checkingPlan = false;
if (resp['privateAllowed']) { if (resp['privateAllowed']) {
$scope.planRequired = null; $scope.planRequired = null;
return; return;
@ -2198,8 +2199,8 @@ function OrgViewCtrl($rootScope, $scope, ApiService, $routeParams) {
{ 'id': 'creator', 'title': 'Creator', 'kind': 'success' }, { 'id': 'creator', 'title': 'Creator', 'kind': 'success' },
{ 'id': 'admin', 'title': 'Admin', 'kind': 'primary' } { 'id': 'admin', 'title': 'Admin', 'kind': 'primary' }
]; ];
$scope.setRole = function(role, teamname) { $scope.setRole = function(role, teamname) {
var previousRole = $scope.organization.teams[teamname].role; var previousRole = $scope.organization.teams[teamname].role;
$scope.organization.teams[teamname].role = role; $scope.organization.teams[teamname].role = role;
@ -2211,7 +2212,7 @@ function OrgViewCtrl($rootScope, $scope, ApiService, $routeParams) {
var data = $scope.organization.teams[teamname]; var data = $scope.organization.teams[teamname];
ApiService.updateOrganizationTeam(data, params).then(function(resp) { ApiService.updateOrganizationTeam(data, params).then(function(resp) {
}, function(resp) { }, function(resp) {
$scope.organization.teams[teamname].role = previousRole; $scope.organization.teams[teamname].role = previousRole;
$scope.roleError = resp.data || ''; $scope.roleError = resp.data || '';
$('#cannotChangeTeamModal').modal({}); $('#cannotChangeTeamModal').modal({});
@ -2286,7 +2287,7 @@ function OrgAdminCtrl($rootScope, $scope, $timeout, Restangular, $routeParams, U
PlanService.getPlans(function(plans) { PlanService.getPlans(function(plans) {
$scope.plans = plans; $scope.plans = plans;
$scope.plan_map = {}; $scope.plan_map = {};
for (var i = 0; i < plans.length; ++i) { for (var i = 0; i < plans.length; ++i) {
$scope.plan_map[plans[i].stripeId] = plans[i]; $scope.plan_map[plans[i].stripeId] = plans[i];
} }
@ -2301,7 +2302,7 @@ function OrgAdminCtrl($rootScope, $scope, $timeout, Restangular, $routeParams, U
$scope.invoicesShown = 0; $scope.invoicesShown = 0;
$scope.applicationsShown = 0; $scope.applicationsShown = 0;
$scope.changingOrganization = false; $scope.changingOrganization = false;
$scope.loadLogs = function() { $scope.loadLogs = function() {
$scope.logsShown++; $scope.logsShown++;
}; };
@ -2424,7 +2425,7 @@ function TeamViewCtrl($rootScope, $scope, $timeout, Features, Restangular, ApiSe
$scope.addNewMember = function(member) { $scope.addNewMember = function(member) {
if (!member || $scope.memberMap[member.name]) { return; } if (!member || $scope.memberMap[member.name]) { return; }
var params = { var params = {
'orgname': orgname, 'orgname': orgname,
'teamname': teamname, 'teamname': teamname,
@ -2519,7 +2520,7 @@ function TeamViewCtrl($rootScope, $scope, $timeout, Features, Restangular, ApiSe
$scope.membersResource = ApiService.getOrganizationTeamMembersAsResource(params).get(function(resp) { $scope.membersResource = ApiService.getOrganizationTeamMembersAsResource(params).get(function(resp) {
$scope.members = resp.members; $scope.members = resp.members;
$scope.canEditMembers = resp.can_edit; $scope.canEditMembers = resp.can_edit;
$('.info-icon').popover({ $('.info-icon').popover({
'trigger': 'hover', 'trigger': 'hover',
'html': true 'html': true
@ -2667,7 +2668,7 @@ function OrgMemberLogsCtrl($scope, $routeParams, $rootScope, $timeout, Restangul
}); });
return resp.member; return resp.member;
}); });
}; };
// Load the org info and the member info. // Load the org info and the member info.
@ -2763,7 +2764,7 @@ function ManageApplicationCtrl($scope, $routeParams, $rootScope, $location, $tim
' under organization ' + $scope.orgname; ' under organization ' + $scope.orgname;
return resp; return resp;
}); });
}; };

View file

@ -12,7 +12,7 @@
subsection="'Admin'"></span> subsection="'Admin'"></span>
</h3> </h3>
</div> </div>
<div class="row"> <div class="row">
<!-- Side tabs --> <!-- Side tabs -->
<div class="col-md-2"> <div class="col-md-2">
@ -30,8 +30,8 @@
<!-- Content --> <!-- Content -->
<div class="col-md-10"> <div class="col-md-10">
<div class="tab-content"> <div class="tab-content">
<!-- Logs tab --> <!-- Logs tab -->
<div id="logs" class="tab-pane"> <div id="logs" class="tab-pane">
<div class="logs-view" repository="repo" makevisible="logsShown"></div> <div class="logs-view" repository="repo" makevisible="logsShown"></div>
@ -48,7 +48,7 @@
Note: This repository is currently <b>private</b>. Publishing this badge will reveal the status information of your repository (and links may Note: This repository is currently <b>private</b>. Publishing this badge will reveal the status information of your repository (and links may
not work for unregistered users). not work for unregistered users).
</div> </div>
<!-- Status Image --> <!-- Status Image -->
<a ng-href="/repository/{{ repo.namespace }}/{{ repo.name }}" ng-if="repo && repo.name"> <a ng-href="/repository/{{ repo.namespace }}/{{ repo.name }}" ng-if="repo && repo.name">
<img ng-src="/repository/{{ repo.namespace }}/{{ repo.name }}/status?token={{ repo.status_token }}" data-title="Docker Repository on Quay.io"> <img ng-src="/repository/{{ repo.namespace }}/{{ repo.name }}/status?token={{ repo.status_token }}" data-title="Docker Repository on Quay.io">
@ -77,12 +77,12 @@
<td> <td>
<div class="copy-box" hovering-message="true" value="getBadgeFormat('asciidoc', repo)"></div> <div class="copy-box" hovering-message="true" value="getBadgeFormat('asciidoc', repo)"></div>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
<!-- Permissions tab --> <!-- Permissions tab -->
<div id="permissions" class="tab-pane active"> <div id="permissions" class="tab-pane active">
<!-- User Access Permissions --> <!-- User Access Permissions -->
@ -102,7 +102,7 @@
<td style="width: 95px;"></td> <td style="width: 95px;"></td>
</tr> </tr>
</thead> </thead>
<!-- Team Permissions --> <!-- Team Permissions -->
<tr ng-repeat="(name, permission) in permissions['team']"> <tr ng-repeat="(name, permission) in permissions['team']">
<td class="team entity"> <td class="team entity">
@ -117,7 +117,7 @@
<span class="delete-ui" delete-title="'Delete Permission'" perform-delete="deleteRole(name, 'team')"></span> <span class="delete-ui" delete-title="'Delete Permission'" perform-delete="deleteRole(name, 'team')"></span>
</td> </td>
</tr> </tr>
<!-- User Permissions --> <!-- User Permissions -->
<tr ng-repeat="(name, permission) in permissions['user']"> <tr ng-repeat="(name, permission) in permissions['user']">
<td class="{{ 'user entity ' + (permission.is_org_member ? '' : 'outside') }}"> <td class="{{ 'user entity ' + (permission.is_org_member ? '' : 'outside') }}">
@ -164,10 +164,10 @@
<td></td> <td></td>
</tr> </tr>
</thead> </thead>
<tr ng-repeat="(code, token) in tokens"> <tr ng-repeat="(code, token) in tokens">
<td class="user token"> <td class="user token">
<i class="fa fa-key"></i> <i class="fa fa-key"></i>
<a ng-click="showToken(token.code)">{{ token.friendlyName }}</a> <a ng-click="showToken(token.code)">{{ token.friendlyName }}</a>
</td> </td>
<td class="user-permissions"> <td class="user-permissions">
@ -245,7 +245,7 @@
<td style="width: 104px;"></td> <td style="width: 104px;"></td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="trigger in triggers"> <tr ng-repeat="trigger in triggers">
<td> <td>
@ -279,7 +279,7 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="dropdown" style="display: inline-block"> <div class="dropdown" style="display: inline-block">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-title="Trigger Settings" bs-tooltip="tooltip.title" data-container="body"> <button class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-title="Trigger Settings" bs-tooltip="tooltip.title" data-container="body">
<i class="fa fa-cog"></i> <i class="fa fa-cog"></i>
@ -296,19 +296,20 @@
</tbody> </tbody>
</table> </table>
<!-- Right controls --> <!-- Right controls -->
<div class="right-controls"> <div class="right-controls">
<span ng-show="!Features.GITHUB_BUILD" class="pull-left">No build trigger types enabled.</span> <span ng-show="!Features.GITHUB_BUILD" class="pull-left">No build trigger types enabled.</span>
<div class="dropdown"> <div class="dropdown">
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown" ng-disabled="!Features.GITHUB_BUILD"> <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown" ng-disabled="!Features.GITHUB_BUILD">
New Trigger New Trigger
<b class="caret"></b> <b class="caret"></b>
</button> </button>
<ul class="dropdown-menu dropdown-menu-right pull-right"> <ul class="dropdown-menu dropdown-menu-right pull-right">
<li> <li>
<a href="{{ TriggerService.getRedirectUrl('github', repo.namespace, repo.name) }}"> <a href="{{ TriggerService.getRedirectUrl('github', repo.namespace, repo.name) }}">
<i class="fa fa-github fa-lg"></i>GitHub - Repository Push <i class="fa fa-github fa-lg"></i>
GitHub <span ng-if="KeyService.isEnterprise('github-trigger')">Enterprise</span> - Repository Push
</a> </a>
</li> </li>
</ul> </ul>
@ -321,7 +322,7 @@
</div> </div>
<!-- Public/private tab --> <!-- Public/private tab -->
<div id="publicprivate" class="tab-pane"> <div id="publicprivate" class="tab-pane">
<!-- Public/Private --> <!-- Public/Private -->
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-body"> <div class="panel-body">