templates/security/password/invitation.html.twig line 1

Open in your IDE?
  1. {% extends 'decoupe/decoupe.html.twig' %}
  2. {% block body_css %}bg-gradient-danger{% endblock %}
  3. {% block content_full %}
  4.     <div class="">
  5.         <div class="container">
  6.             <div class="row justify-content-center">
  7.                 <div class="col-xl-10 col-lg-12 col-md-9">
  8.                     <div class="card o-hidden border-0 shadow-lg my-5">
  9.                         <div class="card-body p-0">
  10.                             <div class="row">
  11.                                 <div class="col-lg-6 d-none d-lg-block bg-login-image"></div>
  12.                                 <div class="col-lg-6">
  13.                                     <div class="p-5">
  14.                                         <div class="text-center">
  15.                                             <h1 class="h4 mb-4 text-danger font-weight-bold">
  16.                                                 <i class="fas fa-laugh-wink"></i>
  17.                                                 Opaie V<sup>2</sup>
  18.                                             </h1>
  19.                                         </div>
  20.                                         <form action="{{ path('getInvitation') }}" id="formInvitation" method="post" class="user">
  21.                                             <div class="form-group">
  22.                                                 <input name="emailGetPassword" type="text" class="form-control form-control-user" id="emailGetPassword" aria-describedby="emailHelp" placeholder="Adresse mail" required>
  23.                                             </div>
  24.                                             <button type="submit" id="btn-get-invitation" class="btn btn-primary btn-user btn-block">
  25.                                                 <i class="fa fa-envelope"></i>
  26.                                                 Recevoir l'invitation
  27.                                             </button>
  28.                                         </form>
  29.                                         <hr>
  30.                                         <div class="text-center">
  31.                                             <a class="" href="{{ path('security_login') }}">Se connecter</a>
  32.                                         </div>
  33.                                     </div>
  34.                                 </div>
  35.                             </div>
  36.                         </div>
  37.                     </div>
  38.                 </div>
  39.             </div>
  40.         </div>
  41.     </div>
  42. {% endblock %}
  43. {% block addjs %}
  44.     <script>
  45.         $(document).ready(function(){
  46.             let pgb = $("#progressBar");
  47.             let formPassword = $("#formInvitation");
  48.             let btnGetPassword = $("#btn-get-invitation");
  49.             let email = $("#emailGetPassword");
  50.             formPassword.submit(function(){
  51.                 event.preventDefault();
  52.                 if (email.val() === null || email.val() === ''){
  53.                     email.addClass('is-invalid');
  54.                     swal({title: 'Email vide', icon: 'warning', text: 'Entrez votre adresse mail'});
  55.                 } else {
  56.                     email.removeClass('is-invalid');
  57.                     getPassword();
  58.                 }
  59.             });
  60.             btnGetPassword.submit(function(){
  61.                 event.preventDefault();
  62.                 if (email.val() === null || email.val() === ''){
  63.                     email.addClass('is-invalid');
  64.                     swal({title: 'Email vide', icon: 'warning', text: 'Entrez votre adresse mail'});
  65.                 } else {
  66.                     email.removeClass('is-invalid');
  67.                     getPassword();
  68.                 }
  69.             });
  70.             let getPassword = function () {
  71.                 pgb.removeClass('nodisplay');
  72.                 requestPost('{{ path('getInvitation') }}', JSON.stringify({ 'email': email.val() })).then((res) => {
  73.                     swal({title: 'Lien envoyé!', icon: 'success', text: 'Consultez vos mails, nous vous avons envoyé un lien. Merci.'});
  74.                 });
  75.             };
  76.         });
  77.     </script>
  78. {% endblock %}