Get app information dialog working
This commit is contained in:
parent
0992c8a47e
commit
e07670613e
3 changed files with 53 additions and 2 deletions
12
static/directives/application-info.html
Normal file
12
static/directives/application-info.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<div class="application-info-element" style="padding-bottom: 18px">
|
||||
<div class="auth-header">
|
||||
<img src="//www.gravatar.com/avatar/{{ application.organization.gravatar }}?s=48&d=identicon">
|
||||
<h2><a href="{{ application.url }}" target="_blank">{{ application.name }}</a></h2>
|
||||
<h4>
|
||||
{{ application.organization.name }}
|
||||
</h4>
|
||||
</div>
|
||||
<div style="padding-top: 10px">
|
||||
{{ application.description || '(No Description)' }}
|
||||
</div>
|
||||
</div>
|
15
static/directives/application-reference-dialog.html
Normal file
15
static/directives/application-reference-dialog.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<div class="modal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body" style="padding: 4px; padding-left: 20px;">
|
||||
<button type="button" class="close" ng-click="$hide()" style="padding: 4px;">
|
||||
×
|
||||
</button>
|
||||
<div class="application-info" application="applicationInfo"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" ng-click="$hide()">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -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 : '/');
|
||||
|
|
Reference in a new issue