1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

Add dynamic sizing for version speech bubble

This commit is contained in:
gconsidine 2017-08-07 14:13:12 -04:00
parent 085a722060
commit 17e86b4ec6
2 changed files with 32 additions and 21 deletions

View File

@ -1,18 +1,31 @@
export default export default ['$rootScope', '$scope', '$state', 'ConfigService',
['$scope', '$state', 'ConfigService', ($rootScope, $scope, $state, ConfigService) => {
function($scope, $state, ConfigService){
var init = function(){ ConfigService.getConfig()
ConfigService.getConfig() .then(function(config){
.then(function(config){ $scope.version = config.version.split('-')[0];
$scope.version = config.version.split('-')[0]; $scope.ansible_version = config.ansible_version;
$scope.ansible_version = config.ansible_version; $scope.subscription = config.license_info.subscription_name;
$scope.subscription = config.license_info.subscription_name; $scope.speechBubble = createSpeechBubble($rootScope.BRAND_NAME, config.version);
$('#about-modal').modal('show'); $('#about-modal').modal('show');
}); });
};
$('#about-modal').on('hidden.bs.modal', function () { $('#about-modal').on('hidden.bs.modal', () => $state.go('setup'));
$state.go('setup');
}); function createSpeechBubble (brand, version) {
init(); let text = `${brand} ${version}`;
} let top = '';
]; let bottom = '';
for (let i = 0; i < text.length; i++) {
top += '_';
bottom += '-';
}
top = ` __${top}__ \n`;
text = `< ${text} >\n`;
bottom = ` --${bottom}-- `;
return top + text + bottom;
}
}];

View File

@ -10,9 +10,7 @@
<div class="About-cowsayContainer"> <div class="About-cowsayContainer">
<!-- Don't indent this properly, you'll break the cow --> <!-- Don't indent this properly, you'll break the cow -->
<pre class="About-cowsayCode"> <pre class="About-cowsayCode">
_______________ {{ speechBubble }}
< {{BRAND_NAME}} {{version}} >
---------------
\ ^__^ \ ^__^
\ (oo)\_______ \ (oo)\_______
(__) A )\/\ (__) A )\/\