templates/front/tunnel/step2a.html.twig line 132

Open in your IDE?
  1. {% extends 'front/tunnel/layout.html.twig' %}
  2. {% block head %}
  3.     <title>Étape 2</title>
  4. {% endblock %}
  5. {% block body %}
  6. <section class="w-full py-10 sm:py-20">
  7.     <ol class="flex flex-row w-full">
  8.         <!--first item-->
  9.         <li class="relative flex-1">
  10.             <div class="absolute top-2 left-1/2 w-full h-1.25 bg-bleuindigo"></div>
  11.             <div class="relative z-10 flex flex-col items-center">
  12.                 <div class="size-5 rounded-full bg-bleuindigo"></div>
  13.                 <p class="mt-4 text-sm font-bold text-bleuindigo text-center px-2">
  14.                     1. Je sélectionne la durée
  15.                 </p>
  16.             </div>
  17.         </li>
  18.         <!--Second item-->
  19.         <li class="relative flex-1">
  20.             <div class="absolute top-2 left-1/2 w-full h-1.25 bg-lavande"></div>
  21.             <div class="relative z-10 flex flex-col items-center">
  22.                 <div class="size-5 rounded-full bg-bleuindigo border-4 border-bleuindigo"></div>
  23.                 <p class="mt-4 sm:mt-2 text-sm sm:text-lg font-bold text-bleuindigo text-center px-2">
  24.                     2. J'accède à mon compte
  25.                 </p>
  26.             </div>
  27.         </li>
  28.         <!--Third item-->
  29.         <li class="relative flex-1">
  30.             <div class="relative z-10 flex flex-col items-center">
  31.                 <div class="size-5 rounded-full bg-lavande"></div>
  32.                 <p class="mt-4 text-sm font-bold text-lavande text-center px-2">
  33.                     3. Je procède au paiement
  34.                 </p>
  35.             </div>
  36.         </li>
  37.     </ol>
  38. </section>
  39. <section class="flex justify-center mb-8 sm:mb-16">
  40.     <div class="text-center bg-jaune text-bleuindigo font-bold py-2 px-4 rounded-full text-sm sm:text-lg">
  41.         Vous ne serez pas débité avant la fin de votre essai de 7 jours, résiliable à tout moment.
  42.     </div>
  43. </section>
  44. {% macro addChild(formChildren) %}
  45. <div class="block-form">
  46.     <div class="delete-child justify-end items-center mb-1">
  47.         <i class="fas fa-times cursor-pointer text-franboise"></i>
  48.     </div>
  49.     <div class="flex justify-between flex-wrap sm:flex-nowrap gap-10 mb-4">
  50.         <div class="flex flex-col w-full gap-3">
  51.             <label  class="font-bold">Prénom de l'enfant</label>
  52.             <input type="text" name="{{ formChildren.firstname.vars.full_name }}" value="{{ formChildren.firstname.vars.value }}" class="border-lavande border rounded-3xl py-2 px-4" placeholder="Inscrivez son prénom">
  53.             <div class="invalid-feedback">
  54.             {{ form_errors(formChildren.firstname,{'attr':{'class':'errors'}}) }}
  55.             </div>
  56.         </div>
  57.         <div class="flex flex-col w-full gap-3">
  58.             <label  class="font-bold">Sa classe</label>
  59.             <select name="{{ formChildren.course.vars.full_name }}" class="border-lavande border rounded-3xl py-2 px-4">
  60.                 <option value="" disabled selected hidden>
  61.                     Choisissez sa classe
  62.                 </option>
  63.                 {% for ch in formChildren.course.vars.choices %}
  64.                     <option value="{{ ch.value }}" {% if formChildren.course.vars.value == ch.value %} selected{% endif %}>{{ ch.label|capitalize }}</option>
  65.                 {% endfor %}
  66.             </select>
  67.             <div class="invalid-feedback">
  68.             {{ form_errors(formChildren.course,{'attr':{'class':'errors'}}) }}
  69.             </div>
  70.         </div>
  71.     </div>
  72. </div>
  73. {% endmacro %}
  74. <!--Informations-->
  75. <section class="flex justify-center">
  76.     <div class="flex flex-col lg:flex-row justify-between">
  77.         <div class="">
  78.         </div>
  79.         <div class="lg:w-6/12 xl:w-7/12">
  80.             {% if not is_granted('IS_AUTHENTICATED_FULLY') %}
  81.                 <!--Connexion-->
  82.                 <div class="flex flex-wrap sm:flex-nowrap relative items-center border-lavande border rounded-3xl gap-3 font-bold w-full sm:w-fit py-2 px-4 mt-6 sm:mt-0 mb-4">
  83.                     <div class="flex items-center gap-2 absolute sm:relative -top-8 sm:top-0 left-0">
  84.                         <img src="/static/img/tunnel/avatar.webp" alt="Se connecter" class="size-5">
  85.                         <span class="text-bleuindigo">Vous avez déjà un compte ?</span>
  86.                     </div>
  87.                     <div id="btn-form-login" class="text-franboise cursor-pointer">Connectez-vous</div>
  88.                 </div>
  89.                 <form class="form-login" method="post" style="display: none" id="form-login">
  90.                     <div class="mb-4">
  91.                         <span class="text-bleuindigo font-bold text-2xl sm:text-3xl">Se connecter</span>
  92.                     </div>
  93.                     <div class="alert alert-danger mb-4" style="max-width:450px;display: none">Mince... Ce n'est pas le bon mot de passe. Ou alors, ce n'est pas le bon email.<br/> Si besoin, vous pouvez créer un nouveau mot de passe. Avec lien vers Mot de passe oublié ?</div>
  94.                     <div class="flex justify-between mb-4">
  95.                         <label for="login">
  96.                             Email <span>*</span>
  97.                         </label>
  98.                         <input type="email" value="" class="border-lavande border rounded-3xl py-2 px-4 w-8/12" name="email" id="login" placeholder="[email protected]">
  99.                     </div>
  100.                     <div class="flex justify-between mb-4">
  101.                         <label for="password">
  102.                             Mot de passe <span>*</span>
  103.                         </label>
  104.                         <input type="password" class="border-lavande border rounded-3xl py-2 px-4 w-8/12" id="password" name="password" placeholder="">
  105.                     </div>
  106.                     <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
  107.                     <div class="flex justify-center mt-3 mb-5">
  108.                         <button type="submit" id="btn-connexion" class="w-6/12 bg-framboise hover:bg-bleuindigo hover:cursor-pointer text-white rounded-3xl font-bold py-3 mt-4">Se connecter</button>
  109.                     </div>
  110.                     <a class="text-center d-block block" href="{{ path('app_forgot_password_request') }}" title="Mot de passe oublié">
  111.                         Mot de passe oublié ?
  112.                     </a>
  113.                 </form>
  114.             {% endif %}
  115.             {{ form_start(form,{'attr':{'class': 'form-registration flex flex-col gap-5 sm:gap-10' }}) }}
  116.             <!--Informations élève-->
  117.             <div class="mb-10">
  118.                 <span class="text-bleuindigo font-bold text-2xl sm:text-3xl">Informations élève</span>
  119.             </div>
  120.             <div class="mb-4" id="list-child">
  121.                 {% for formChild in form.children.childrenForm.children %}
  122.                     {{ _self.addChild(formChild) }}
  123.                 {% endfor %}
  124.             </div>
  125.             <!--Rajout élève-->
  126.             <div class="flex flex-col gap-2 mb-10">
  127.                 <div class="flex items-center cursor-pointer" id="addChildButton">
  128.                     <img src="/static/img/tunnel/icone-plus.webp" alt="Ajouter un autre élève" class="size-5 mr-2">
  129.                     <span class="text-pervenche">Ajouter un élève</span>
  130.                 </div>
  131.                 <span class="text-lavande text-sm sm:text-base ml-6">-50% pour chaque enfant supplémentaire</span>
  132.             </div>
  133.             <!--Informations parent-->
  134.             {% if not is_granted('IS_AUTHENTICATED_FULLY') %}
  135.                 <div class="mb-10">
  136.                     <span class="text-bleuindigo font-bold text-2xl sm:text-3xl">Informations parent</span>
  137.                 </div>
  138.                 <div class="flex flex-wrap sm:flex-nowrap justify-between gap-10">
  139.                     <div class="flex flex-col w-full gap-3">
  140.                         <label for="prenom" class="font-bold">Votre prénom</label>
  141.                         <input type="text" name="{{ form.firstname.vars.full_name }}" value="{{ form.firstname.vars.value }}" id="prenom" class="border{% if form.firstname.vars.valid %}-lavande{% else%}{% endif %} border rounded-3xl py-2 px-4" placeholder="Inscrivez votre prénom">
  142.                         <div class="invalid-feedback">
  143.                             {{ form_errors(form.firstname,{'attr':{'class':'errors'}}) }}
  144.                         </div>
  145.                     </div>
  146.                     <div class="flex flex-col w-full gap-3">
  147.                         <label for="nom" class="font-bold">Votre nom</label>
  148.                         <input type="text" name="{{ form.lastname.vars.full_name }}" value="{{ form.lastname.vars.value }}" id="nom" class="border-lavande border rounded-3xl py-2 px-4" placeholder="Inscrivez votre nom">
  149.                         <div class="invalid-feedback">
  150.                             {{ form_errors(form.lastname,{'attr':{'class':'errors'}}) }}
  151.                         </div>
  152.                     </div>
  153.                 </div>
  154.                 <div class="flex flex-wrap sm:flex-nowrap justify-between gap-10">
  155.                     <div class="flex flex-col w-full gap-3">
  156.                         <label for="mail" class="font-bold">Votre email</label>
  157.                         <input type="text" name="{{ form.email.vars.full_name }}" value="{{ form.email.vars.value }}" id="mail" class="border-lavande border rounded-3xl py-2 px-4" placeholder="Inscrivez votre email">
  158.                         <div class="invalid-feedback">
  159.                             {{ form_errors(form.email,{'attr':{'class':'errors'}}) }}
  160.                         </div>
  161.                     </div>
  162.                     <div class="flex flex-col w-full gap-3">
  163.                         <label for="tel" class="font-bold">Votre numéro de téléphone</label>
  164.                         <input type="text" name="{{ form.phone.vars.full_name }}" value="{{ form.phone.vars.value }}" id="tel" class="border-lavande border rounded-3xl py-2 px-4" placeholder="Inscrivez votre numéro de téléphone">
  165.                         <div class="invalid-feedback">
  166.                             {{ form_errors(form.phone,{'attr':{'class':'errors'}}) }}
  167.                         </div>
  168.                     </div>
  169.                 </div>
  170.                 <div class="flex flex-wrap sm:flex-nowrap justify-between gap-10">
  171.                     <div class="flex flex-col w-full gap-3">
  172.                         <label for="mdp" class="font-bold">Définissez votre mot de passe</label>
  173.                         <input type="password" name="{{ form.plainPassword.children.first.vars.full_name }}" value="{{ form.plainPassword.children.first.vars.value }}"  id="mdp" class="border-lavande border rounded-3xl py-2 px-4" placeholder="Choisissez votre mot de passe">
  174.                         <div class="invalid-feedback">
  175.                             {{ form_errors(form.plainPassword.children.first,{'attr':{'class':'errors'}}) }}
  176.                         </div>
  177.                     </div>
  178.                     <div class="flex flex-col w-full gap-3">
  179.                         <label for="mdpbis" class="font-bold">Répétez votre mot de passe</label>
  180.                         <input type="password" name="{{ form.plainPassword.children.second.vars.full_name }}" value="{{ form.plainPassword.children.second.vars.value }}" id="mdpbis" class="border-lavande border rounded-3xl py-2 px-4" placeholder="Répétez votre mot de passe">
  181.                         <div class="invalid-feedback">
  182.                             {{ form_errors(form.plainPassword.children.second,{'attr':{'class':'errors'}}) }}
  183.                         </div>
  184.                     </div>
  185.                 </div>
  186.                 <div class="flex flex-wrap sm:flex-nowrap justify-between gap-10">
  187.                     <div class="flex flex-col w-full gap-3">
  188.                         <label for="cp" class="font-bold">Votre code postal</label>
  189.                         <input type="text" name="{{ form.postalCode.vars.full_name }}" value="{{ form.postalCode.vars.value }}" id="cp" class="border-lavande border rounded-3xl py-2 px-4" placeholder="Inscrivez votre code postal">
  190.                         <div class="invalid-feedback">
  191.                             {{ form_errors(form.postalCode,{'attr':{'class':'errors'}}) }}
  192.                         </div>
  193.                     </div>
  194.                     <div class="flex flex-col w-full gap-3">
  195.                         <label for="ville" class="font-bold">Votre ville</label>
  196.                         <input type="text" name="{{ form.city.vars.full_name }}" value="{{ form.city.vars.value }}" id="ville" class="border-lavande border rounded-3xl py-2 px-4" placeholder="Inscrivez votre ville">
  197.                         <div class="invalid-feedback">
  198.                             {{ form_errors(form.city,{'attr':{'class':'errors'}}) }}
  199.                         </div>
  200.                     </div>
  201.                 </div>
  202.             {% endif %}
  203.             <div class="mt-10">
  204.                 <div class="flex items-start gap-2">
  205.                     <input id="rgpd" name="{{ form.isRegisterInfos.vars.full_name }}" type="checkbox"
  206.                            class="size-5 border-lavande rounded-xl" />
  207.                     <label for="rgpd" class="text-sm sm:text-base">J’autorise Les Bons Profs à conserver mes données ci-dessus à des fins de suivi commercial. Aucune donnée ne sera transmise à un partenaire.</label>
  208.                 </div>
  209.                 <div class="invalid-feedback">
  210.                     {{ form_errors(form.isRegisterInfos,{'attr':{'class':'errors'}}) }}
  211.                 </div>
  212.             </div>
  213.             {{ form_row(form._token) }}
  214.             {{ form_end(form, {'render_rest':false }) }}
  215.         </div>
  216.         <!--Colonne gauche-->
  217.         <div class="hidden" id="template-add-child">
  218.             {{ _self.addChild(form.childrenForm.vars.prototype.children) }}
  219.         </div>
  220.         <!--Colonne droite-->
  221.         <div class="flex flex-col lg:w-5/12 xl:w-4/12 my-16 lg:mt-0">
  222.             <!--Encadré lavande-->
  223.             <div class="flex flex-col bg-lavandeclair rounded-2xl text-sm sm:text-base gap-y-2 p-5 sm:p-10">
  224.                 <div class="text-bleuindigo font-bold text-xl">
  225.                     Vous avez choisi l’offre
  226.                 </div>
  227.                 <div class="text-pervenche font-bold text-2xl sm:text-3xl">
  228.                     {{ offer.title|upper }}
  229.                 </div>
  230.                 <div class="font-bold mt-2">
  231.                     {{ offer.typeOffer.textPaid|raw }}
  232.                 </div>
  233.                 <div class="flex justify-between items-center mt-4">
  234.                     <span class="flex text-bleuindigo font-bold">
  235.                       <span class="flex items-center bg-jaune rounded-xl px-2 mr-1"><span class="text-lg -my-1 pr-1">&#9733</span> 4,6</span>+ 300 avis Trustpilot
  236.                     </span>
  237.                     <span class="text-pervenche text-xs hover:underline"><a href="https://fr.trustpilot.com/review/lesbonsprofs.com" target="_blank">Voir les avis</a></span>
  238.                 </div>
  239.                 {% if mode_free %}
  240.                     <div class="flex justify-between text-franboise font-bold mt-4">
  241.                         <span>Montant dû aujourd'hui</span>
  242.                         <span>0€</span>
  243.                     </div>
  244.                     <hr class="border-lavande border my-2" />
  245.                     <div class="flex justify-between text-bleuindigo">
  246.                         <span>Montant dû au {{ dateAchat|date_modify("+8 day")|format_datetime(locale='fr',pattern="dd MMMM YYYY") }}</span>
  247.                         <span class="font-bold" id="som-toto">{{ amount|number_format(2, ',', '.') }} €</span>
  248.                     </div>
  249.                 {% else %}
  250.                     <div class="flex justify-between text-franboise font-bold mt-4">
  251.                         <span>Montant dû aujourd'hui</span>
  252.                         <span id="som-toto">{{ amount|number_format(2, ',', '.') }} €</span>
  253.                     </div>
  254.                 {% endif %}
  255.                 {% if discount is not null %}
  256.                     <div class="text-bleuindigo mb-2"><span class="font-bold me-1">Promotion appliquée :</span> {{ discount.title }}</div>
  257.                 {% endif %}
  258.                 <button id="but-submit" type="submit" class="bg-framboise hover:bg-bleuindigo hover:cursor-pointer text-white rounded-3xl font-bold py-3 mt-4">Continuer</button>
  259.             </div>
  260.         </div>
  261.     </div>
  262. </section>
  263. {% endblock %}
  264. {% block javascripts %}
  265.     <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
  266.             integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
  267.             crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  268.     <script type="text/javascript">
  269.         function addclone(userNbr){
  270.             for(var j=0;j<userNbr;j++){
  271.                 var clone = $('#template-add-child').clone();
  272.                 var nbr = $('#list-child').find('.block-form').length;
  273.                 var cpt = nbr + 1;
  274.                 clone = clone.html().replaceAll(/__name__/g,nbr).replaceAll(/__enfantnumber__/g,cpt);
  275.                 $('#list-child').append(clone);
  276.             }
  277.         }
  278.         $(document).ready(function(){
  279.             {% if not form.vars.submitted %}
  280.             addclone({{ nbr }});
  281.             {% else %}
  282.             var nbr = $('#list-child').find('.block-form').length;
  283.             var i = 0;
  284.             $('#list-child').find('.block-form').each(function(){
  285.                 i= i + 1;
  286.                 $(this).find('.number-child').text(i);
  287.             })
  288.             {% endif %}
  289.             // Au clique du bouton Ajouter un eleve
  290.             $('#addChildButton').click(function(){
  291.                 addclone(1)
  292.             })
  293.         })
  294.         $(document).on("click",".block-form .fa-times",function(){
  295.             $(this).parents('.block-form').remove();
  296.         })
  297.         $('#but-submit').click(function(e){
  298.             e.preventDefault();
  299.             var nbr = $('#list-child').find('.block-form').length;
  300.             $('.form-registration').submit();
  301.         })
  302.         $('#btn-form-login').click(function(e){
  303.             e.preventDefault();
  304.             $('.form-login').show();
  305.             $('.form-registration').hide();
  306.         })
  307.         $('#btn-connexion').click(function(e){
  308.             e.preventDefault();
  309.             var form = $('.form-login');
  310.             var formData = new FormData(form[0]);
  311.             $('.u-spinner').addClass('open');
  312.             $.ajax({
  313.                 url: "{{ path('ajax_login') }}",
  314.                 type: 'POST',
  315.                 data: formData,
  316.                 processData: false,
  317.                 contentType: false,
  318.                 dataType: 'json',
  319.                 success: function (data) {
  320.                         window.location.reload();
  321.                 }
  322.             })
  323.         })
  324.     </script>
  325. {% endblock %}