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:
parent
085a722060
commit
17e86b4ec6
@ -1,18 +1,31 @@
|
||||
export default
|
||||
['$scope', '$state', 'ConfigService',
|
||||
function($scope, $state, ConfigService){
|
||||
var init = function(){
|
||||
ConfigService.getConfig()
|
||||
.then(function(config){
|
||||
$scope.version = config.version.split('-')[0];
|
||||
$scope.ansible_version = config.ansible_version;
|
||||
$scope.subscription = config.license_info.subscription_name;
|
||||
$('#about-modal').modal('show');
|
||||
});
|
||||
};
|
||||
$('#about-modal').on('hidden.bs.modal', function () {
|
||||
$state.go('setup');
|
||||
});
|
||||
init();
|
||||
}
|
||||
];
|
||||
export default ['$rootScope', '$scope', '$state', 'ConfigService',
|
||||
($rootScope, $scope, $state, ConfigService) => {
|
||||
|
||||
ConfigService.getConfig()
|
||||
.then(function(config){
|
||||
$scope.version = config.version.split('-')[0];
|
||||
$scope.ansible_version = config.ansible_version;
|
||||
$scope.subscription = config.license_info.subscription_name;
|
||||
$scope.speechBubble = createSpeechBubble($rootScope.BRAND_NAME, config.version);
|
||||
$('#about-modal').modal('show');
|
||||
});
|
||||
|
||||
$('#about-modal').on('hidden.bs.modal', () => $state.go('setup'));
|
||||
|
||||
function createSpeechBubble (brand, version) {
|
||||
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;
|
||||
}
|
||||
}];
|
||||
|
@ -10,9 +10,7 @@
|
||||
<div class="About-cowsayContainer">
|
||||
<!-- Don't indent this properly, you'll break the cow -->
|
||||
<pre class="About-cowsayCode">
|
||||
_______________
|
||||
< {{BRAND_NAME}} {{version}} >
|
||||
---------------
|
||||
{{ speechBubble }}
|
||||
\ ^__^
|
||||
\ (oo)\_______
|
||||
(__) A )\/\
|
||||
|
Loading…
Reference in New Issue
Block a user