119 lines
4.7 KiB
Smarty
Executable File
119 lines
4.7 KiB
Smarty
Executable File
<div data-role="content" id="content">
|
|
<script type="text/javascript">
|
|
{if isset($refresh) && $back=="order"}
|
|
document.location.href="{$link->getPageLink('authentication', true, NULL)}?back=order&step=1";
|
|
{/if}
|
|
{literal}
|
|
$(document).ready(function(){
|
|
if (typeof baseUri === "undefined" && typeof baseDir !== "undefined")
|
|
baseUri = baseDir;
|
|
// $('#create-account_form').submit(function(){
|
|
// submitFunction();
|
|
// return false;
|
|
// });
|
|
});
|
|
function submitFunction()
|
|
{
|
|
$('#create_account_error').html('').hide();
|
|
//send the ajax request to the server
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: baseUri,
|
|
async: true,
|
|
cache: false,
|
|
dataType : "json",
|
|
data: {
|
|
|
|
controller: 'authentication',
|
|
SubmitCreate: 1,
|
|
ajax: true,
|
|
email_create: $('#email_create').val(),
|
|
back: $('input[name=back]').val(),
|
|
token: token
|
|
},
|
|
success: function(jsonData)
|
|
{
|
|
if (jsonData.hasError)
|
|
{
|
|
var errors = '';
|
|
for(error in jsonData.errors)
|
|
//IE6 bug fix
|
|
if(error != 'indexOf')
|
|
errors += '<li>'+jsonData.errors[error]+'</li>';
|
|
$('#create_account_error').html('<ol>'+errors+'</ol>').show();
|
|
}
|
|
else
|
|
{
|
|
// adding a div to display a transition
|
|
$('#center_column').html('<div id="noSlide">'+$('#center_column').html()+'</div>');
|
|
$('#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)
|
|
bindStateInputAndUpdate();
|
|
$(this).fadeIn('slow', function(){
|
|
document.location = '#account-creation';
|
|
});
|
|
});
|
|
}
|
|
},
|
|
error: function(XMLHttpRequest, textStatus, errorThrown)
|
|
{
|
|
alert("TECHNICAL ERROR: unable to load form.\n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus);
|
|
}
|
|
});
|
|
}
|
|
|
|
{/literal}
|
|
</script>
|
|
<!--{if isset($authentification_error)}
|
|
<div class="error">
|
|
{if {$authentification_error|@count} == 1}
|
|
<p>{l s='There\'s at least one error'} :</p>
|
|
{else}
|
|
<p>{l s='There are %s errors' sprintf=[$account_error|@count]} :</p>
|
|
{/if}
|
|
<ol>
|
|
{foreach from=$authentification_error item=v}
|
|
<li>{$v}</li>
|
|
{/foreach}
|
|
</ol>
|
|
</div>
|
|
{/if}-->
|
|
|
|
<form action="{$link->getPageLink('authentication', true)}" method="post" id="login_form" class="std cadreAccount ">
|
|
<fieldset>
|
|
<div class="form_content clearfix">
|
|
<h3>{l s='Vous avez un compte'}</h3>
|
|
<div class="text"><input type="email" placeholder="{l s='Votre E-mail'}" id="email" name="email" value="{if isset($smarty.post.email)}{$smarty.post.email|stripslashes}{/if}" class="inputText209" /></div>
|
|
<div class="text"><input placeholder="{l s='Votre mot de passe'}" type="password" id="passwd" name="passwd" value="{if isset($smarty.post.passwd)}{$smarty.post.passwd|stripslashes}{/if}" class="inputText209 right" /></div>
|
|
<p class="lost_password"><u>{l s='Mot de passe'} <a href="{$link->getPageLink('password')}" style="text-decoration:none">{l s='oublié'} ?</a></u></p>
|
|
<p class="submit">
|
|
{if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if}
|
|
<input type="submit" id="SubmitLogin" name="SubmitLogin" class="button" value="{l s='Se connecter'}" />
|
|
</p>
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
<form action="{$link->getPageLink('authentication', true)}" method="post" id="create-account_form" class="std cadreAccount right">
|
|
<fieldset>
|
|
<h3>{l s='Vous n\'avez pas encore de compte'}</h3>
|
|
<div class="form_content clearfix">
|
|
<p class="text">{l s='Créez votre compte gratuitement et accédez simplement à un ensemble de services personnalisés.'}<br/>{l s='Offres exclusives du Laboratoire Garancia :'} <span class="grey">{l s='Suivi des commandes - Modification de vos coordonnées personnelles - Mailing des dernières tendances et des offres exclusives Garancia - Rédaction d\'avis sur les produits.'}</span></p>
|
|
<p class="hidden">
|
|
<input type="email" placeholder="Email" id="email_create" name="email_create" value="new@garancia.com" class="account_input" />
|
|
</p>
|
|
<p class="submit">
|
|
{if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'htmlall':'UTF-8'}" />{/if}
|
|
<input type="submit" id="SubmitCreate" name="SubmitCreate" class="uppercase button" value="{l s='Créez votre compte'}" />
|
|
<input type="hidden" class="hidden" name="SubmitCreate" value="{l s='Create an account'}" />
|
|
</p>
|
|
<div class="error" id="create_account_error" style="display:none"></div>
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
|
|
</div><!-- /content -->
|
|
|
|
{* Missing the guest checkout behaviour *}
|
|
{* ===================================== *}
|