diff --git a/static/js/pages/app-view.js b/static/js/pages/app-view.js
index 287b5dc70..e4c54a797 100644
--- a/static/js/pages/app-view.js
+++ b/static/js/pages/app-view.js
@@ -10,7 +10,7 @@
});
}]);
- function AppViewCtrl($scope, $routeParams, $location, $timeout, ApiService, UserService, AngularPollChannel, ImageLoaderService, CookieService) {
+ function AppViewCtrl($scope, $routeParams, $rootScope, ApiService, UtilService) {
$scope.namespace = $routeParams.namespace;
$scope.name = $routeParams.name;
@@ -29,8 +29,13 @@
};
$scope.repositoryResource = ApiService.getRepoAsResource(params).get(function(repo) {
- $scope.repository = repo;
- $scope.viewScope.repository = repo;
+ if (repo != undefined) {
+ $scope.repository = repo;
+ $scope.viewScope.repository = repo;
+
+ // Update the page description for SEO
+ $rootScope.description = UtilService.getFirstMarkdownLineAsString(repo.description);
+ }
});
};
diff --git a/static/js/pages/repo-view.js b/static/js/pages/repo-view.js
index e66a10248..1081cff71 100644
--- a/static/js/pages/repo-view.js
+++ b/static/js/pages/repo-view.js
@@ -10,7 +10,8 @@
});
}]);
- function RepoViewCtrl($scope, $routeParams, $location, $timeout, ApiService, UserService, AngularPollChannel, ImageLoaderService, CookieService) {
+ function RepoViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService,
+ UserService, AngularPollChannel, ImageLoaderService, UtilService) {
$scope.namespace = $routeParams.namespace;
$scope.name = $routeParams.name;
@@ -59,22 +60,22 @@
};
$scope.repositoryResource = ApiService.getRepoAsResource(params).get(function(repo) {
- $scope.repository = repo;
- $scope.viewScope.repository = repo;
- $scope.publicRepoExperiment = CookieService.get('quay.public-repo-exp') == 'true';
+ if (repo != undefined) {
+ $scope.repository = repo;
+ $scope.viewScope.repository = repo;
- // Flag for new repo page experiment
- $scope.newRepoExperiment = $scope.repository.is_public && $scope.user.username != $scope.repository.namespace && $scope.publicRepoExperiment;
+ // Update the page description for SEO
+ $rootScope.description = UtilService.getFirstMarkdownLineAsString(repo.description);
- // Load the remainder of the data async, so we don't block the initial view from
- // showing.
- $timeout(function() {
- $scope.setTags($routeParams.tag);
+ // Load the remainder of the data async, so we don't block the initial view from showing
+ $timeout(function() {
+ $scope.setTags($routeParams.tag);
- // Track builds.
- buildPollChannel = AngularPollChannel.create($scope, loadRepositoryBuilds, 30000 /* 30s */);
- buildPollChannel.start();
- }, 10);
+ // Track builds.
+ buildPollChannel = AngularPollChannel.create($scope, loadRepositoryBuilds, 30000 /* 30s */);
+ buildPollChannel.start();
+ }, 10);
+ }
});
};
diff --git a/static/js/quay-run.ts b/static/js/quay-run.ts
index 561a2cca9..3c2eb3499 100644
--- a/static/js/quay-run.ts
+++ b/static/js/quay-run.ts
@@ -16,21 +16,21 @@ provideRun.$inject = [
'MetaService',
];
export function provideRun($rootScope: QuayRunScope,
- Restangular: any,
- PlanService: any,
+ restangular: any,
+ planService: any,
$http: ng.IHttpService,
- CookieService: any,
- Features: any,
+ cookieService: any,
+ features: any,
$anchorScroll: ng.IAnchorScrollService,
- MetaService: any): void {
+ metaService: any): void {
const defaultTitle: string = INJECTED_CONFIG['REGISTRY_TITLE'] || 'Quay Container Registry';
// Handle session security.
- Restangular.setDefaultRequestParams(['post', 'put', 'remove', 'delete'],
+ restangular.setDefaultRequestParams(['post', 'put', 'remove', 'delete'],
{'_csrf_token': (
', '');
+ };
+
utilService.escapeHtmlString = function(text) {
var textStr = (text || '').toString();
var adjusted = textStr.replace(/&/g, "&")
diff --git a/templates/index.html b/templates/index.html
index fa157bd37..47708c030 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -7,7 +7,7 @@
{% block added_meta %}