templates/front/connexion_connexion.html.twig line 1

Open in your IDE?
  1. {% extends 'base_client.html.twig' %}
  2. {% block body %}
  3. <div class="formulaire-login">
  4.     <form method="post">
  5.         <div class="div-input div-connexion">
  6.             <h1>VOXDIA</h1>
  7.         
  8.             <h2>Login interface</h2>
  9.             <span class="form-error">
  10.                 {% if error %}
  11.                     <div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
  12.                 {% endif %}
  13.             </span>
  14.             
  15.             <div class="input-form">
  16.                 <div class="input-form-input">
  17.                     <input type="email" value="{{ last_username }}" name="email"  class="input-email input-style" autocomplete="email" placeholder="Email" required autofocus />
  18.                 </div>
  19.             </div>
  20.             
  21.             <div class="input-form">
  22.                 <div class="input-form-input">
  23.                     <input type="password" name="password" class="input-password input-style" autocomplete="current-password" placeholder="Password" required>
  24.                 </div>
  25.             </div>
  26.             <input type="checkbox" name="_remember_me" style="display: none" checked />
  27.             <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}" />
  28.             <div>
  29.                 <button class="input-form-submit button-style" type="submit" style="width: 100%;">Continue</button>
  30.             </div>
  31.             
  32.             <hr class="input-form-hr" />
  33.                     
  34.             <div>
  35.                 <a href="{{ path('front_connexion_inscription') }}"><div class="input-form-registration button-style">Sign in</div></a>
  36.             </div>
  37.     
  38.             <div class="input-form-forgot">
  39.                 <a href="{{ path('front_connexion_reset') }}">Forgot password ?</a>
  40.             </div>
  41.         </div>
  42.     </form>
  43.     
  44. </div>
  45. <script>
  46.     $(document).ready( function () {
  47.         /*
  48.         $('.input-form-submit').click(function () {
  49.             if ($('.input-email').val() == '') {
  50.                 $('.input-email').css({'border': 'solid 1px red'});
  51.             } else {
  52.                 $('.input-email').css({'border': 'solid 1px #d6d6d6'});
  53.             }
  54.             
  55.             if ($('.input-password').val() == '') {
  56.                 $('.input-password').css({'border': 'solid 1px red'});
  57.             } else {
  58.                 $('.input-password').css({'border': 'solid 1px #d6d6d6'});
  59.             }
  60.             
  61.             if ($('.input-email').val() != '' && $('.input-password').val() != '') {
  62.                 $('.form-error').html('');
  63.                 $.ajax({
  64.                     type: "POST",
  65.                     url: 'connexion.php',
  66.                     data: {email: $('.input-email').val(), password: $('.input-password').val()},
  67.                     dataType: 'JSON',
  68.                     success: function (data) {
  69.                         if (data.success == true) {
  70.                             $('.div-connexion h2').css({'visibility':'hidden'});
  71.                             $('.div-connexion').animate({height: "120px"});
  72.                             window.location.href = 'dashboard.php';
  73.                         } else {
  74.                             $('.form-error').html('Wrong email / password');
  75.                         }
  76.                     },
  77.                     error: function (error) {
  78.                         alert('Erreur lors du traitement');
  79.                     }
  80.                 });
  81.             }
  82.         });*/
  83.     });
  84. </script>
  85. {% endblock %}