templates/front/connexion_reset.html.twig line 1

Open in your IDE?
  1. {% extends 'base_client.html.twig' %}
  2. {% block body %}
  3. <div class="formulaire-login">
  4.     <div class="div-input">
  5.         <h1>VOXDIA</h1>
  6.         <div class="div-reset">
  7.             <h2>Reset your password</h2>
  8.             <span class="form-error"></span>
  9.             <div class="input-form">
  10.                 <div class="input-form-input">
  11.                     <input type="email" class="input-forgot-password input-style" name="resetEmail" placeholder="Email" />
  12.                 </div>
  13.             </div>
  14.             
  15.             <div>
  16.                 <button class="input-form-forgot-submit button-style" type="submit" style="width: 100%;">Reset password</button>
  17.             </div>
  18.             
  19.             <hr class="input-form-hr" />        
  20.             <div class="input-form-connexion">
  21.                 <a href="{{ path('app_login') }}">Connexion</a>
  22.             </div>
  23.         </div>
  24.         <div class="div-reset-connexion">
  25.             <div class="form-success" style="margin-bottom: 30px;margin-top: 25px;color:#656565"></div>
  26.             <div>
  27.                 <a href="{{ path('app_login') }}"><div class="input-form-registration button-style">Connexion</div></a>
  28.             </div>
  29.         </div>
  30.     </div>
  31. </div>
  32. <script>
  33.     $(document).ready( function () {
  34.         $('.input-form-forgot-submit').click(function () {
  35.             if ($('.input-forgot-password').val() == '') {
  36.                 $('.input-forgot-password').css({'border': 'solid 1px red'});
  37.             } else {
  38.             $('.input-form-forgot-submit').attr('disabled', 'disabled').css('opacity', '0.3')
  39.                 
  40.                 $('.form-error').html('');
  41.                 $.ajax({
  42.                     type: "POST",
  43.                     url: '{{ path('front_connexion_reset') }}',
  44.                     data: {resetEmail: $('.input-forgot-password').val()},
  45.                     dataType: 'JSON',
  46.                     success: function (data) {
  47.                         if (data.success == true) {
  48.                             $('.div-reset').hide();
  49.                             $('.div-reset-connexion').show();
  50.                             $('.form-success').html(data.message);
  51.                         } else {console.log(data)
  52.                             $('.input-forgot-password').css({'border': 'solid 1px red'});
  53.                             $('.form-error').html(data.message);
  54.                             $('.input-form-forgot-submit').removeAttr('disabled').css('opacity', '1');
  55.                         }
  56.                     },
  57.                     error: function (error) {
  58.                         alert('Erreur lors du traitement');
  59.                         $('.input-form-forgot-submit').removeAttr('disabled').css('opacity', '1');
  60.                     }
  61.                 });
  62.             }
  63.         });
  64.     });
  65. </script>
  66. {% endblock %}