From 34f98b0987b7341a06c147a2ce12c31d41a344fd Mon Sep 17 00:00:00 2001 From: gRoussac Date: Fri, 4 Jan 2013 16:31:05 +0100 Subject: [PATCH] [-] FO : Fix #PSCFV-4885 for DNI field, states and postcode display --- themes/default/authentication.tpl | 11 +- themes/default/css/authentication.css | 163 ++++++++++---------- themes/default/css/global.css | 1 + themes/default/css/order-opc.css | 8 +- themes/default/js/tools/statesManagement.js | 39 ++--- 5 files changed, 105 insertions(+), 117 deletions(-) diff --git a/themes/default/authentication.tpl b/themes/default/authentication.tpl index 5e9b8427a..260d6cf41 100644 --- a/themes/default/authentication.tpl +++ b/themes/default/authentication.tpl @@ -86,9 +86,6 @@ $(function(){ldelim} submitFunction(); return false; }); - $('#SubmitCreate').click(function(){ - submitFunction(); - }); }); function submitFunction() { @@ -124,11 +121,12 @@ $(function(){ldelim} $('#center_column').html('
'+$('#center_column').html()+'
'); $('#noSlide').fadeOut('slow', function(){ $('#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(); + $(this).fadeIn('slow', function(){ + document.location = '#account-creation'; + }); }); - $('#noSlide').fadeIn('slow'); - document.location = '#account-creation'; } }, error: function(XMLHttpRequest, textStatus, errorThrown) @@ -339,7 +337,6 @@ $(function(){ldelim}

{l s='Tax identification'}

-

diff --git a/themes/default/css/authentication.css b/themes/default/css/authentication.css index 46f5ceb4f..4b8f10870 100644 --- a/themes/default/css/authentication.css +++ b/themes/default/css/authentication.css @@ -1,84 +1,81 @@ /* create account ****************************************************************************** */ -#account-creation_form {} - - #account-creation_form fieldset, fieldset.account_creation { - padding:0 0 15px 0; - border:1px solid #ccc; - background:#f8f8f8 - } - #account-creation_form h3 { - margin:0 0 15px 0; - padding:8px; - font-size:14px; - color:#fff; - 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} - #account-creation_form p.required sup {color:#990000} - - #account-creation_form p.radio span, - #account-creation_form p.text label, - #account-creation_form p.password label, - #account-creation_form p.select label, - #account-creation_form p.select span, - #account-creation_form p.textarea label { - display:inline-block; - padding:6px 15px; - width:230px;/* 260 */ - font-size:14px; - text-align:right - } - #account-creation_form p.radio label { - float:none; - padding-right:10px; - width:auto; - font-size:14px - } - #account-creation_form p.checkbox label { - float:none; - width:auto; - font-size:12px - } - #account-creation_form p.text input, - #account-creation_form p.password input, - #account-creation_form p.select input { - padding:0 5px; - height:22px; - width:360px;/* 370 */ - border:1px solid #ccc; - font-size: 12px; - color:#666 - } - - #account-creation_form span.inline-infos{display:inline-block;} - #account-creation_form p.checkbox input { - margin-left:260px; - } - #account-creation_form p.select select { - margin-right:10px; - border:1px solid #ccc; - font-size: 12px; - color:#666 - } - #account-creation_form p.textarea textarea { - height:80px; - width:370px; - border:1px solid #ccc; - font-size: 12px; - color:#666 - } - - #account-creation_form span.form_info { - display:block; - margin:5px 0 0 265px; - color:#666 - } - #account-creation_form p.inline-infos { - margin:0 0 0 100px !important; - font-size:12px; - color:#666; - } - - #center_column #account-creation_form p.cart_navigation {margin:20px 0} \ No newline at end of file +#account-creation_form fieldset, fieldset.account_creation { + padding:0 0 15px 0; + border:1px solid #ccc; + background:#f8f8f8 +} +#account-creation_form h3 { + margin:0 0 15px 0; + padding:8px; + font-size:14px; + color:#fff; + 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} +#account-creation_form p.required sup {color:#990000} +#account-creation_form p.radio span, +#account-creation_form p.text label, +#account-creation_form p.password label, +#account-creation_form p.select label, +#account-creation_form p.select span, +#account-creation_form p.textarea label { + display:inline-block; + padding:6px 15px; + width:230px;/* 260 */ + font-size:14px; + text-align:right +} +#account-creation_form p.radio label { + float:none; + padding-right:10px; + width:auto; + font-size:14px +} +#account-creation_form p.checkbox label { + float:none; + width:auto; + font-size:12px +} +#account-creation_form p.text input, +#account-creation_form p.password input, +#account-creation_form p.select input { + padding:0 5px; + height:22px; + width:360px;/* 370 */ + border:1px solid #ccc; + font-size: 12px; + color:#666 +} +#account-creation_form span.inline-infos{display:inline-block;} +#account-creation_form p.checkbox input { + margin-left:260px; +} +#account-creation_form p.select select { + margin-right:10px; + border:1px solid #ccc; + font-size: 12px; + color:#666 +} +#account-creation_form p.textarea textarea { + height:80px; + width:370px; + border:1px solid #ccc; + font-size: 12px; + color:#666 +} +#account-creation_form span.form_info { + display:block; + margin:5px 0 0 265px; + color:#666 +} +#account-creation_form p.inline-infos { + margin:0 0 0 100px !important; + font-size:12px; + color:#666; +} +#account-creation_form .id_state, #account-creation_form .dni, #account-creation_form .postcode { + display: none; +} +#center_column #account-creation_form p.cart_navigation {margin:20px 0} \ No newline at end of file diff --git a/themes/default/css/global.css b/themes/default/css/global.css index c534bb0bd..517f98a81 100644 --- a/themes/default/css/global.css +++ b/themes/default/css/global.css @@ -61,6 +61,7 @@ body.content_only { /* positionnement ****************************************************************************** */ .hidden {display:none} +.f_left {float:left} .f_right {float:right} p.center {text-align:center} .clearBoth {clear:both} diff --git a/themes/default/css/order-opc.css b/themes/default/css/order-opc.css index 39fbbaaa1..b40575fd1 100644 --- a/themes/default/css/order-opc.css +++ b/themes/default/css/order-opc.css @@ -1,16 +1,12 @@ #orderopc #left_column {display:none} #orderopc #center_column{width:757px} - #orderopc #left_column h2 {margin-top:20px} - #opc_account_choice {padding:0 15px;} #opc_account_choice .opc_float { float:left; width:350px } #opc_account_choice .opc_float ul {margin:0 0 20px 30px} - -form#new_account_form {} #new_account_form fieldset { padding:0 0 15px 0; border:1px solid #ccc; @@ -73,13 +69,15 @@ form#new_account_form {} font-size: 12px; color:#666 } - #new_account_form span.form_info, #new_account_form span.inline-infos { display:block; margin:5px 0 0 265px; color:#666 } +#new_account_form .id_state, #new_account_form .dni, #new_account_form .postcode { + display: none; +} #opc_account_errors { margin: 10px; margin-bottom: 15px; diff --git a/themes/default/js/tools/statesManagement.js b/themes/default/js/tools/statesManagement.js index 57755602d..ca7e5e22b 100644 --- a/themes/default/js/tools/statesManagement.js +++ b/themes/default/js/tools/statesManagement.js @@ -5,30 +5,28 @@ $(document).ready(function() function bindStateInputAndUpdate() { + $('.id_state, .dni, .postcode').css({'display':'none'}); + updateState(); + updateNeedIDNumber(); + updateZipCode(); + $('select#id_country').change(function(){ updateState(); updateNeedIDNumber(); updateZipCode(); }); - + if ($('select#id_country_invoice').length !== 0) { - $('select#id_country_invoice').change(function(){ - updateState('invoice'); - updateNeedIDNumber('invoice'); - updateZipCode(); - }); - if ($('select#id_country_invoice:visible').length !== 0) - { + $('select#id_country_invoice').change(function(){ updateState('invoice'); updateNeedIDNumber('invoice'); updateZipCode('invoice'); - } + }); + updateState('invoice'); + updateNeedIDNumber('invoice'); + updateZipCode('invoice'); } - - updateState(); - updateNeedIDNumber(); - updateZipCode(); } function updateState(suffix) @@ -40,29 +38,26 @@ function updateState(suffix) $(states).each(function (key, item){ $('select#id_state'+(suffix !== undefined ? '_'+suffix : '')).append(''); }); - - $('p.id_state'+(suffix !== undefined ? '_'+suffix : '')+':hidden, div.id_state'+(suffix !== undefined ? '_'+suffix : '')).slideDown('slow'); + $('.id_state'+(suffix !== undefined ? '_'+suffix : '')+':hidden').fadeIn('slow');; } else - $('p.id_state'+(suffix !== undefined ? '_'+suffix : '')+', div.id_state'+(suffix !== undefined ? '_'+suffix : '')).hide(); + $('.id_state'+(suffix !== undefined ? '_'+suffix : '')).fadeOut('fast'); } function updateNeedIDNumber(suffix) { var idCountry = parseInt($('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val()); - if ($.inArray(idCountry, countriesNeedIDNumber) >= 0) - $('.dni'+(suffix !== undefined ? '_'+suffix : '')).slideDown('slow'); + $('.dni'+(suffix !== undefined ? '_'+suffix : '')+':hidden').fadeIn('slow'); else - $('.dni'+(suffix !== undefined ? '_'+suffix : '')).slideUp('fast'); + $('.dni'+(suffix !== undefined ? '_'+suffix : '')).fadeOut('fast'); } function updateZipCode(suffix) { var idCountry = parseInt($('select#id_country'+(suffix !== undefined ? '_'+suffix : '')).val()); - if (countriesNeedZipCode[idCountry] !== 0) - $('.postcode'+(suffix !== undefined ? '_'+suffix : '')).slideDown('slow'); + $('.postcode'+(suffix !== undefined ? '_'+suffix : '')+':hidden').fadeIn('slow'); else - $('.postcode'+(suffix !== undefined ? '_'+suffix : '')).slideUp('fast'); + $('.postcode'+(suffix !== undefined ? '_'+suffix : '')).fadeOut('fast'); }