Add support for build status tags, which link to the Quay.io repo

This commit is contained in:
Joseph Schorr 2014-02-28 16:23:36 -05:00
parent 39eaca346d
commit 3f806b10c2
16 changed files with 228 additions and 34 deletions

View file

@ -1162,6 +1162,30 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, $routeParams
$scope.githubRedirectUri = KeyService.githubRedirectUri;
$scope.githubClientId = KeyService.githubClientId;
$scope.getBadgeFormat = function(format, repo) {
if (!repo) { return; }
var imageUrl = 'https://quay.io/repository/' + namespace + '/' + name + '/status';
if (!$scope.repo.is_public) {
imageUrl += '?token=' + $scope.repo.status_token;
}
var linkUrl = 'https://quay.io/repository/' + namespace + '/' + name;
switch (format) {
case 'svg':
return imageUrl;
case 'md':
return '[![Docker Repository on Quay.io](' + imageUrl + ')](' + linkUrl + ')';
case 'asciidoc':
return 'image:' + imageUrl + '["Docker Repository on Quay.io", link="' + linkUrl + '"]';
}
return '';
};
$scope.buildEntityForPermission = function(name, permission, kind) {
var key = name + ':' + kind;
if ($scope.permissionCache[key]) {