fix install with no databox & trans string

This commit is contained in:
Nicolas Le Goff
2012-01-04 16:54:23 +01:00
parent bf840a8c04
commit 06f539e7d5

View File

@@ -9,6 +9,7 @@
var $this = $(this); var $this = $(this);
var $current = $this.closest('.steps'); var $current = $this.closest('.steps');
$('.databox_creation_input', $current).attr('disabled', $this.attr('checked')); $('.databox_creation_input', $current).attr('disabled', $this.attr('checked'));
$('.db_tester', $current).attr('disabled', $this.attr('checked')).toggleClass( "ui-state-disabled", $this.attr('checked') );
}); });
$('.ab_opt_toggler').bind('click', function(){ $('.ab_opt_toggler').bind('click', function(){
$('.optional_ab_datas').fadeToggle(); $('.optional_ab_datas').fadeToggle();
@@ -126,7 +127,7 @@
{ {
test_connection_appbox(callback); test_connection_appbox(callback);
} }
else if($current.hasClass('databox_settings')) else if($current.hasClass('databox_settings') && $('.databox_create', $current).is(':not(:checked)'))
{ {
test_connection_databox(callback); test_connection_databox(callback);
} }
@@ -236,10 +237,10 @@
if(datas.connection === true && datas.database === true) if(datas.connection === true && datas.database === true)
{ {
el_status.attr('src','/skins/icons/ok.png').show(); el_status.attr('src','/skins/icons/ok.png').show();
el_message.empty().append('{% trans 'Successfull connection' %}'); el_message.empty().append("{% trans 'Successfull connection' %}");
if(!datas.is_empty) if(!datas.is_empty)
{ {
el_message.append('<br>{% trans 'Warning, this database is not empty' %}'); el_message.append("<br>{% trans 'Warning, this database is not empty' %}");
el_status.attr('src','/skins/icons/alert.png').show(); el_status.attr('src','/skins/icons/alert.png').show();
} }
if(typeof callback == 'function') if(typeof callback == 'function')
@@ -249,11 +250,11 @@
} }
if(datas.connection === true) if(datas.connection === true)
{ {
el_message.empty().append('{% trans 'Connection is OK but database does not exists or can not be accessed' %}'); el_message.empty().append("{% trans 'Connection is OK but database does not exists or can not be accessed' %}");
} }
else else
{ {
el_message.empty().append('{% trans 'Unable to connect to MySQL server' %}'); el_message.empty().append("{% trans 'Unable to connect to MySQL server' %}");
} }
el_status.attr('src', '/skins/icons/delete.png').show(); el_status.attr('src', '/skins/icons/delete.png').show();
@@ -262,12 +263,12 @@
timeout:function(){ timeout:function(){
el_loader.css('visibility', 'hidden'); el_loader.css('visibility', 'hidden');
el_status.attr('src', '/skins/icons/delete.png').show(); el_status.attr('src', '/skins/icons/delete.png').show();
el_message.empty().append('{% trans 'Unable to connect to MySQL server' %}'); el_message.empty().append("{% trans 'Unable to connect to MySQL server' %}");
}, },
error:function(datas){ error:function(datas){
el_loader.css('visibility', 'hidden'); el_loader.css('visibility', 'hidden');
el_status.attr('src', '/skins/icons/delete.png').show(); el_status.attr('src', '/skins/icons/delete.png').show();
el_message.empty().append('{% trans 'Unable to connect to MySQL server' %}'); el_message.empty().append("{% trans 'Unable to connect to MySQL server' %}");
} }
}); });
} }