added an about dialog that give copyright information about Tower

This commit is contained in:
Jared Tabor
2014-08-07 13:44:56 -04:00
parent 1fa2d35977
commit 7466968941
5 changed files with 104 additions and 3 deletions

View File

@@ -113,7 +113,8 @@ angular.module('Tower', [
'SocketIO',
'lrInfiniteScroll',
'LoadConfigHelper',
'SocketHelper'
'SocketHelper',
'AboutAnsibleHelpModal'
])
.constant('AngularScheduler.partials', urlPrefix + 'lib/angular-scheduler/lib/')
@@ -421,9 +422,10 @@ angular.module('Tower', [
}])
.run(['$compile', '$cookieStore', '$rootScope', '$log', 'CheckLicense', '$location', 'Authorization', 'LoadBasePaths', 'Timer', 'ClearScope', 'HideStream', 'Socket',
'LoadConfig', 'Store', 'ShowSocketHelp', 'LicenseViewer',
'LoadConfig', 'Store', 'ShowSocketHelp', 'LicenseViewer', 'AboutAnsibleHelp',
function ($compile, $cookieStore, $rootScope, $log, CheckLicense, $location, Authorization, LoadBasePaths, Timer, ClearScope, HideStream, Socket,
LoadConfig, Store, ShowSocketHelp, LicenseViewer) {
LoadConfig, Store, ShowSocketHelp, LicenseViewer, AboutAnsibleHelp) {
var e, html, sock, checkCount = 0;
@@ -542,6 +544,10 @@ angular.module('Tower', [
activateTab();
$rootScope.viewAboutTower = function(){
AboutAnsibleHelp();
};
$rootScope.viewCurrentUser = function () {
$location.path('/users/' + $rootScope.current_user.id);
};

View File

@@ -0,0 +1,64 @@
/*********************************************
* Copyright (c) 2014 AnsibleWorks, Inc.
*
* Dashboard.js
*
* The new dashboard
*
*/
'use strict';
angular.module('AboutAnsibleHelpModal', ['RestServices', 'Utilities','ModalDialog'])
.factory('AboutAnsibleHelp', ['$rootScope', '$compile', '$location' , 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', 'CreateDialog',
function ($rootScope, $compile , $location, Rest, GetBasePath, ProcessErrors, Wait, CreateDialog) {
return function () {
var scope= $rootScope.$new(),
url;
url = GetBasePath('config');
Rest.setUrl(url);
Rest.get()
.success(function (data){
scope.$emit('BuildAboutDialog', data);
})
.error(function (data, status) {
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to get: ' + url + ' GET returned: ' + status });
});
if (scope.removeDialogReady) {
scope.removeDialogReady();
}
scope.removeDialogReady = scope.$on('DialogReady', function() {
// element = angular.element(document.getElementById('about-modal-dialog'));
// $compile(element)(scope);
$('#about-modal-dialog').dialog('open');
});
if (scope.removeBuildAboutDialog) {
scope.removeBuildAboutDialog();
}
scope.removeBuildAboutDialog = scope.$on('BuildAboutDialog', function(e, data) {
var str = data.version;
if(str.search('-')){
str = str.substr(0,str.search('-'));
}
$('#about-modal-version').html(str);
CreateDialog({
id: 'about-modal-dialog',
scope: scope,
buttons: [],
width: 600,
height: 300,
minWidth: 300,
// title: , //'<img src="static/img/tower_login_logo.png">' ,//'About Ansible',
callback: 'DialogReady'
});
});
};
}
]);

View File

@@ -128,6 +128,17 @@ a:focus {
background-color: #FFF;
}
#about-modal-logo{
width: 150px;
height: 150px;
margin-left: 10px;
margin-top: 10px;
}
#about-modal-titlelogo{
margin-bottom: 10px;
}
/* Make buttons appear to be disabled, but allow mouse events */
.btn-disabled {
opacity: 0.35;

View File

@@ -0,0 +1,14 @@
<div class="row">
<div class="left-side col-sm-4 col-xs-12">
<img id="about-modal-logo" src="static/img/tower_console_bug.png">
</div>
<div class="right-side col-sm-8 col-xs-12">
<img id="about-modal-titlelogo" src="static/img/tower_login_logo.png"><br>
<p>Tower Version <span id='about-modal-version'></span></p>
<textarea class="form-control" rows="3">Copyright 2014. All rights reserved.&#10Ansible is a registered trademark of Ansible, Inc.&#10Ansible Tower is a trademark pending registration. </textarea>
<br>
<p>Visit <a href="http://www.ansible.com" target="_blank">Ansible.com</a> for more information!</p>
</div>
</div>