{% extends 'base_client.html.twig' %}
{% block body %}
<div class="formulaire-login">
<form method="post">
<div class="div-input div-connexion">
<h1>VOXDIA</h1>
<h2>Login interface</h2>
<span class="form-error">
{% if error %}
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
</span>
<div class="input-form">
<div class="input-form-input">
<input type="email" value="{{ last_username }}" name="email" class="input-email input-style" autocomplete="email" placeholder="Email" required autofocus />
</div>
</div>
<div class="input-form">
<div class="input-form-input">
<input type="password" name="password" class="input-password input-style" autocomplete="current-password" placeholder="Password" required>
</div>
</div>
<input type="checkbox" name="_remember_me" style="display: none" checked />
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}" />
<div>
<button class="input-form-submit button-style" type="submit" style="width: 100%;">Continue</button>
</div>
<hr class="input-form-hr" />
<div>
<a href="{{ path('front_connexion_inscription') }}"><div class="input-form-registration button-style">Sign in</div></a>
</div>
<div class="input-form-forgot">
<a href="{{ path('front_connexion_reset') }}">Forgot password ?</a>
</div>
</div>
</form>
</div>
<script>
$(document).ready( function () {
/*
$('.input-form-submit').click(function () {
if ($('.input-email').val() == '') {
$('.input-email').css({'border': 'solid 1px red'});
} else {
$('.input-email').css({'border': 'solid 1px #d6d6d6'});
}
if ($('.input-password').val() == '') {
$('.input-password').css({'border': 'solid 1px red'});
} else {
$('.input-password').css({'border': 'solid 1px #d6d6d6'});
}
if ($('.input-email').val() != '' && $('.input-password').val() != '') {
$('.form-error').html('');
$.ajax({
type: "POST",
url: 'connexion.php',
data: {email: $('.input-email').val(), password: $('.input-password').val()},
dataType: 'JSON',
success: function (data) {
if (data.success == true) {
$('.div-connexion h2').css({'visibility':'hidden'});
$('.div-connexion').animate({height: "120px"});
window.location.href = 'dashboard.php';
} else {
$('.form-error').html('Wrong email / password');
}
},
error: function (error) {
alert('Erreur lors du traitement');
}
});
}
});*/
});
</script>
{% endblock %}