Install wizard: Conditionally load EULA

Conditionally show EULA screen, only if eula.html is retrieved
successfully via AJAX call (i.e., doesn't return a 404). Otherwise,
bypass EULA and start with intro screen.
This commit is contained in:
Brian Federle 2012-02-16 15:41:44 -08:00
parent 4b2709ceff
commit ccd7d8b30a
3 changed files with 28 additions and 10 deletions

View File

@ -503,12 +503,13 @@ body.login {
-webkit-box-shadow: 0px 4px 10px #B9B9B9;
-o-box-shadow: 0px 4px 10px #B9B9B9;
box-shadow: 0px 4px 10px #B9B9B9;
padding: 0;
padding: 5px;
/*+border-radius:4px;*/
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-khtml-border-radius: 4px;
border-radius: 4px 4px 4px 4px;
overflow: auto;
}
.install-wizard .eula-copy p {

View File

@ -281,12 +281,27 @@
response: {
success: function(args) {
if (args.doInstall && cloudStack.context.users[0].role == 'admin') {
cloudStack.uiCustom.installWizard({
$container: $container,
context: context,
complete: function() {
// Show cloudStack main UI
$container.cloudStack(cloudStackArgs);
var initInstallWizard = function(eulaHTML) {
cloudStack.uiCustom.installWizard({
$container: $container,
context: context,
eula: eulaHTML,
complete: function() {
// Show cloudStack main UI
$container.cloudStack(cloudStackArgs);
}
});
};
// EULA check
$.ajax({
url: 'eula.html',
dataType: 'html',
success: function(html) {
initInstallWizard(html);
},
error: function() {
initInstallWizard(null);
}
});
} else {

View File

@ -3,8 +3,8 @@
var context = args.context;
var $installWizard = $('<div>').addClass('install-wizard');
var $container = args.$container;
var eulaHTML = args.eula;
var state = {}; // Hold wizard form state
var launchStart; // Holds last launch callback, in case of error
var $launchState;
@ -287,7 +287,7 @@
var $intro = $('<div></div>').addClass('intro eula');
var $title = $('<div></div>').addClass('title').html(_l('label.license.agreement'));
var $subtitle = $('<div></div>').addClass('subtitle').html(_l('label.license.agreement.subtitle'));
var $copy = getCopy('eula', $('<div></div>').addClass('eula-copy'));
var $copy = $('<div></div>').addClass('eula-copy').html(eulaHTML);
var $continue = elems.nextButton(_l('label.agree'));
$continue.click(function() {
@ -776,7 +776,9 @@
}
};
var initialStep = steps.eula().addClass('step');
var initialStep = eulaHTML ?
steps.eula().addClass('step') : steps.intro().addClass('step');
showDiagram('');
$('html body').addClass('install-wizard');