Add a simplified landing page for the case where billing is disabled

This commit is contained in:
Joseph Schorr 2014-04-06 14:48:58 -04:00
parent badf002e92
commit 6e2b8d96b8
6 changed files with 271 additions and 151 deletions

View file

@ -1399,6 +1399,50 @@ quayApp.directive('quayClasses', function(Features) {
});
quayApp.directive('quayInclude', function($compile, $templateCache, $http, Features) {
return {
priority: 595,
restrict: 'A',
link: function($scope, $element, $attr, ctrl) {
var getTemplate = function(templateName) {
var templateUrl = '/static/partials/' + templateName;
return $http.get(templateUrl, {cache: $templateCache});
};
var result = $scope.$eval($attr.quayInclude);
if (!result) {
return;
}
var templatePath = null;
for (var expr in result) {
if (!result.hasOwnProperty(expr)) { continue; }
// Evaluate the expression with the entire features list added.
var value = $scope.$eval(expr, Features);
if (value) {
templatePath = result[expr];
break;
}
}
if (!templatePath) {
return;
}
var promise = getTemplate(templatePath).success(function(html) {
$element.html(html);
}).then(function (response) {
$element.replaceWith($compile($element.html())($scope));
if ($attr.onload) {
$scope.$eval($attr.onload);
}
});
}
};
});
quayApp.directive('entityReference', function () {
var directiveDefinitionObject = {
priority: 0,