From e07670613ea81d1866975ddfff7e3be346a314d4 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 20 Mar 2014 12:06:29 -0400 Subject: [PATCH] Get app information dialog working --- static/directives/application-info.html | 12 ++++++++ .../application-reference-dialog.html | 15 ++++++++++ static/js/app.js | 28 +++++++++++++++++-- 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 static/directives/application-info.html create mode 100644 static/directives/application-reference-dialog.html diff --git a/static/directives/application-info.html b/static/directives/application-info.html new file mode 100644 index 000000000..32472ae74 --- /dev/null +++ b/static/directives/application-info.html @@ -0,0 +1,12 @@ +
+
+ +

{{ application.name }}

+

+ {{ application.organization.name }} +

+
+
+ {{ application.description || '(No Description)' }} +
+
diff --git a/static/directives/application-reference-dialog.html b/static/directives/application-reference-dialog.html new file mode 100644 index 000000000..364cf6113 --- /dev/null +++ b/static/directives/application-reference-dialog.html @@ -0,0 +1,15 @@ + diff --git a/static/js/app.js b/static/js/app.js index 7cd7c2f72..86f962cf3 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -1149,6 +1149,24 @@ quayApp.directive('entityReference', function () { }); +quayApp.directive('applicationInfo', function () { + var directiveDefinitionObject = { + priority: 0, + templateUrl: '/static/directives/application-info.html', + replace: false, + transclude: false, + restrict: 'C', + scope: { + 'application': '=application' + }, + controller: function($scope, $element, ApiService) { + + } + }; + return directiveDefinitionObject; +}); + + quayApp.directive('applicationReference', function () { var directiveDefinitionObject = { priority: 0, @@ -1167,7 +1185,13 @@ quayApp.directive('applicationReference', function () { }; ApiService.getApplicationInformation(null, params).then(function(resp) { - // TODO: display the application information here. + $scope.applicationInfo = resp; + $modal({ + title: 'Application Information', + scope: $scope, + template: '/static/directives/application-reference-dialog.html', + show: true + }); }, function() { bootbox.dialog({ "message": 'The application could not be found; it might have been deleted.', @@ -1388,7 +1412,7 @@ quayApp.directive('signinForm', function () { // Note: The timeout of 500ms is needed to ensure dialogs containing sign in // forms get removed before the location changes. $timeout(function() { - if (!$scope.redirectUrl || $scope.redirectUrl == $location.path()) { + if ($scope.redirectUrl == $location.path()) { return; } $location.path($scope.redirectUrl ? $scope.redirectUrl : '/');