[-] FO : Fix #PSCFV-4885 for DNI field, states and postcode display

This commit is contained in:
gRoussac committed 2013-01-04 16:31:05 +01:00
1 parent c339f585d0
commit 34f98b0987
5 files changed
+105 -117

No files matched your search

+4 -7
View File
@@ -86,9 +86,6 @@ $(function(){ldelim}
submitFunction(); submitFunction();
return false; return false;
}); });
$('#SubmitCreate').click(function(){
submitFunction();
});
}); });
function submitFunction() function submitFunction()
{ {
@@ -124,11 +121,12 @@ $(function(){ldelim}
$('#center_column').html('<div id="noSlide">'+$('#center_column').html()+'</div>'); $('#center_column').html('<div id="noSlide">'+$('#center_column').html()+'</div>');
$('#noSlide').fadeOut('slow', function(){ $('#noSlide').fadeOut('slow', function(){
$('#noSlide').html(jsonData.page); $('#noSlide').html(jsonData.page);
// update the state (when this file is called from AJAX you still need to update the state) // update the state (when this file is called from AJAX you still need to update the state)
bindStateInputAndUpdate(); bindStateInputAndUpdate();
$(this).fadeIn('slow', function(){
document.location = '#account-creation';
});
}); });
$('#noSlide').fadeIn('slow');
document.location = '#account-creation';
} }
}, },
error: function(XMLHttpRequest, textStatus, errorThrown) error: function(XMLHttpRequest, textStatus, errorThrown)
@@ -339,7 +337,6 @@ $(function(){ldelim}
</fieldset> </fieldset>
<fieldset class="account_creation dni"> <fieldset class="account_creation dni">
<h3>{l s='Tax identification'}</h3> <h3>{l s='Tax identification'}</h3>
<p class="required text"> <p class="required text">
<label for="dni">{l s='Identification number'}</label> <label for="dni">{l s='Identification number'}</label>
<input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{/if}" /> <input type="text" class="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{/if}" />
+80 -83
View File
@@ -1,84 +1,81 @@
/* create account ****************************************************************************** */ /* create account ****************************************************************************** */
#account-creation_form {} #account-creation_form fieldset, fieldset.account_creation {
padding:0 0 15px 0;
#account-creation_form fieldset, fieldset.account_creation { border:1px solid #ccc;
padding:0 0 15px 0; background:#f8f8f8
border:1px solid #ccc; }
background:#f8f8f8 #account-creation_form h3 {
} margin:0 0 15px 0;
#account-creation_form h3 { padding:8px;
margin:0 0 15px 0; font-size:14px;
padding:8px; color:#fff;
font-size:14px; text-transform:uppercase;
color:#fff; background:url(../img/bg_form_h3.png) repeat-x 0 0 #989898
text-transform:uppercase; }
background:url(../img/bg_form_h3.png) repeat-x 0 0 #989898 #center_column #account-creation_form p {margin:0; padding:0 0 10px 0}
} #account-creation_form p.required {color:#222}
#center_column #account-creation_form p {margin:0; padding:0 0 10px 0} #account-creation_form p.required sup {color:#990000}
#account-creation_form p.required {color:#222} #account-creation_form p.radio span,
#account-creation_form p.required sup {color:#990000} #account-creation_form p.text label,
#account-creation_form p.password label,
#account-creation_form p.radio span, #account-creation_form p.select label,
#account-creation_form p.text label, #account-creation_form p.select span,
#account-creation_form p.password label, #account-creation_form p.textarea label {
#account-creation_form p.select label, display:inline-block;
#account-creation_form p.select span, padding:6px 15px;
#account-creation_form p.textarea label { width:230px;/* 260 */
display:inline-block; font-size:14px;
padding:6px 15px; text-align:right
width:230px;/* 260 */ }
font-size:14px; #account-creation_form p.radio label {
text-align:right float:none;
} padding-right:10px;
#account-creation_form p.radio label { width:auto;
float:none; font-size:14px
padding-right:10px; }
width:auto; #account-creation_form p.checkbox label {
font-size:14px float:none;
} width:auto;
#account-creation_form p.checkbox label { font-size:12px
float:none; }
width:auto; #account-creation_form p.text input,
font-size:12px #account-creation_form p.password input,
} #account-creation_form p.select input {
#account-creation_form p.text input, padding:0 5px;
#account-creation_form p.password input, height:22px;
#account-creation_form p.select input { width:360px;/* 370 */
padding:0 5px; border:1px solid #ccc;
height:22px; font-size: 12px;
width:360px;/* 370 */ color:#666
border:1px solid #ccc; }
font-size: 12px; #account-creation_form span.inline-infos{display:inline-block;}
color:#666 #account-creation_form p.checkbox input {
} margin-left:260px;
}
#account-creation_form span.inline-infos{display:inline-block;} #account-creation_form p.select select {
#account-creation_form p.checkbox input { margin-right:10px;
margin-left:260px; border:1px solid #ccc;
} font-size: 12px;
#account-creation_form p.select select { color:#666
margin-right:10px; }
border:1px solid #ccc; #account-creation_form p.textarea textarea {
font-size: 12px; height:80px;
color:#666 width:370px;
} border:1px solid #ccc;
#account-creation_form p.textarea textarea { font-size: 12px;
height:80px; color:#666
width:370px; }
border:1px solid #ccc; #account-creation_form span.form_info {
font-size: 12px; display:block;
color:#666 margin:5px 0 0 265px;
} color:#666
}
#account-creation_form span.form_info { #account-creation_form p.inline-infos {
display:block; margin:0 0 0 100px !important;
margin:5px 0 0 265px; font-size:12px;
color:#666 color:#666;
} }
#account-creation_form p.inline-infos { #account-creation_form .id_state, #account-creation_form .dni, #account-creation_form .postcode {
margin:0 0 0 100px !important; display: none;
font-size:12px; }
color:#666; #center_column #account-creation_form p.cart_navigation {margin:20px 0}
}
#center_column #account-creation_form p.cart_navigation {margin:20px 0}
+1
View File
@@ -61,6 +61,7 @@ body.content_only {
/* positionnement ****************************************************************************** */ /* positionnement ****************************************************************************** */
.hidden {display:none} .hidden {display:none}
.f_left {float:left}
.f_right {float:right} .f_right {float:right}
p.center {text-align:center} p.center {text-align:center}
.clearBoth {clear:both} .clearBoth {clear:both}
+3 -5
View File
@@ -1,16 +1,12 @@
#orderopc #left_column {display:none} #orderopc #left_column {display:none}
#orderopc #center_column{width:757px} #orderopc #center_column{width:757px}
#orderopc #left_column h2 {margin-top:20px} #orderopc #left_column h2 {margin-top:20px}
#opc_account_choice {padding:0 15px;} #opc_account_choice {padding:0 15px;}
#opc_account_choice .opc_float { #opc_account_choice .opc_float {
float:left; float:left;
width:350px width:350px
} }
#opc_account_choice .opc_float ul {margin:0 0 20px 30px} #opc_account_choice .opc_float ul {margin:0 0 20px 30px}
form#new_account_form {}
#new_account_form fieldset { #new_account_form fieldset {
padding:0 0 15px 0; padding:0 0 15px 0;
border:1px solid #ccc; border:1px solid #ccc;
@@ -73,13 +69,15 @@ form#new_account_form {}
font-size: 12px; font-size: 12px;
color:#666 color:#666
} }
#new_account_form span.form_info, #new_account_form span.form_info,
#new_account_form span.inline-infos { #new_account_form span.inline-infos {
display:block; display:block;
margin:5px 0 0 265px; margin:5px 0 0 265px;
color:#666 color:#666
} }
#new_account_form .id_state, #new_account_form .dni, #new_account_form .postcode {
display: none;
}
#opc_account_errors { #opc_account_errors {
margin: 10px; margin: 10px;
margin-bottom: 15px; margin-bottom: 15px;
+17 -22
View File
@@ -5,30 +5,28 @@ $(document).ready(function()
function bindStateInputAndUpdate() function bindStateInputAndUpdate()
{ {
$('.id_state, .dni, .postcode').css({'display':'none'});
updateState();
updateNeedIDNumber();
updateZipCode();
$('select#id_country').change(function(){ $('select#id_country').change(function(){
updateState(); updateState();
updateNeedIDNumber(); updateNeedIDNumber();
updateZipCode(); updateZipCode();
}); });
if ($('select#id_country_invoice').length !== 0) if ($('select#id_country_invoice').length !== 0)
{ {
$('select#id_country_invoice').change(function(){ $('select#id_country_invoice').change(function(){
updateState('invoice');
updateNeedIDNumber('invoice');
updateZipCode();
});
if ($('select#id_country_invoice:visible').length !== 0)
{
updateState('invoice'); updateState('invoice');
updateNeedIDNumber('invoice'); updateNeedIDNumber('invoice');
updateZipCode('invoice'); updateZipCode('invoice');
} });
updateState('invoice');
updateNeedIDNumber('invoice');
updateZipCode('invoice');
} }
updateState();
updateNeedIDNumber();
updateZipCode();
} }
function updateState(suffix) function updateState(suffix)
@@ -40,29 +38,26 @@ function updateState(suffix)
$(states).each(function (key, item){ $(states).each(function (key, item){
$('select#id_state'+(suffix !== undefined ? '_'+suffix : '')).append('<option value="'+item.id+'"'+ (idSelectedCountry === item.id ? ' selected="selected"' : '') + '>'+item.name+'</option>'); $('select#id_state'+(suffix !== undefined ? '_'+suffix : '')).append('<option value="'+item.id+'"'+ (idSelectedCountry === item.id ? ' selected="selected"' : '') + '>'+item.name+'</option>');
}); });
$('.id_state'+(suffix !== undefined ? '_'+suffix : '')+':hidden').fadeIn('slow');;
$('p.id_state'+(suffix !== undefined ? '_'+suffix : '')+':hidden, div.id_state'+(suffix !== undefined ? '_'+suffix : '')).slideDown('slow');
} }
else else
$('p.id_state'+(suffix !== undefined ? '_'+suffix : '')+', div.id_state'+(suffix !== undefined ? '_'+suffix : '')).hide(); $('.id_state'+(suffix !== undefined ? '_'+suffix : '')).fadeOut('fast');
} }
function updateNeedIDNumber(suffix) function updateNeedIDNumber(suffix)
{ {
var idCountry = parseInt($('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val()); var idCountry = parseInt($('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val());
if ($.inArray(idCountry, countriesNeedIDNumber) >= 0) if ($.inArray(idCountry, countriesNeedIDNumber) >= 0)
$('.dni'+(suffix !== undefined ? '_'+suffix : '')).slideDown('slow'); $('.dni'+(suffix !== undefined ? '_'+suffix : '')+':hidden').fadeIn('slow');
else else
$('.dni'+(suffix !== undefined ? '_'+suffix : '')).slideUp('fast'); $('.dni'+(suffix !== undefined ? '_'+suffix : '')).fadeOut('fast');
} }
function updateZipCode(suffix) function updateZipCode(suffix)
{ {
var idCountry = parseInt($('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val()); var idCountry = parseInt($('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val());
if (countriesNeedZipCode[idCountry] !== 0) if (countriesNeedZipCode[idCountry] !== 0)
$('.postcode'+(suffix !== undefined ? '_'+suffix : '')).slideDown('slow'); $('.postcode'+(suffix !== undefined ? '_'+suffix : '')+':hidden').fadeIn('slow');
else else
$('.postcode'+(suffix !== undefined ? '_'+suffix : '')).slideUp('fast'); $('.postcode'+(suffix !== undefined ? '_'+suffix : '')).fadeOut('fast');
} }