templates/user/access.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block head %}
  3. {% endblock %}
  4. {% block body %}
  5.     <style>
  6.         .footer{
  7.             margin-top: 0 !important;
  8.         }
  9.         a:hover{
  10.             color: #5902EC;
  11.         }
  12.         #access-btn{
  13.             display: none !important;
  14.         }
  15.     </style>
  16.     <!-- HEADING -->
  17.     <div class="container-fluid bg-blue sctn-access">
  18.         <div class="row pt-5">
  19.             
  20.             <div class="col-12 d-flex justify-content-center">
  21.                 <div class="card-access bg-white">
  22.                     <div class="row p-4">
  23.                         <div class="col-12 d-flex justify-content-center">
  24.                             <button class="btn-md access tablink {{format is not defined or format == 1 ? 'active' : ''}}" onclick="openForm(event, 'login')">
  25.                                 Iniciar sesión
  26.                             </button>
  27.                             <button class="btn-md access tablink {{format == 2 ? 'active'}}" onclick="openForm(event, 'sign-up')">
  28.                                 Registro
  29.                             </button>
  30.                         </div>
  31.                         {% if format and format == 1 %}
  32.                             <div class="row session p-0 m-0" id="login">
  33.                         {% else %}
  34.                             <div class="row session p-0 m-0" id="login" style="display: none;">
  35.                         {% endif %}
  36.                             {% if statusLogin == 'error' %}
  37.                                 <p class="text-center mt-5">Usuario o contraseña incorrectos</p>
  38.                                 <div class="col-12 d-flex justify-content-center mt-4">
  39.                                     <a href="{{ path('access') }}">
  40.                                         <button class="btn-md blue">Volver</button>
  41.                                     </a>
  42.                                 </div>
  43.                             {% else %}
  44.                                 <form method="POST" action="{{ path('access') }}">
  45.                                     <div class="col-12 mt-4 mb-3">
  46.                                         <p class="pb-2">Email</p>
  47.                                         <input type="email" name="email-login" required>
  48.                                     </div>
  49.                                     <div class="col-12 mb-4">
  50.                                         <p class="pb-2">Password</p>
  51.                                         <input type="password" name="password" required>
  52.                                     </div>
  53.                                     <input type="hidden" name="send-form-log" value="1">
  54.                                     <div class="col-12 d-flex justify-content-center mb-4">
  55.                                         <button type="submit" class="btn-md blue">Enter</button>
  56.                                     </div>
  57.                                     <div class="col-12 d-flex justify-content-center">
  58.                                         <a href="{{ ('recover-password') }}">
  59.                                             <p class="text-muted">Forgot password?</p>
  60.                                         </a>
  61.                                     </div>
  62.                                     <input type="hidden" name="redirect" value="{{redirect}}">
  63.                                     <input type="hidden" name="format" value="1">
  64.                                 </form>
  65.                             {% endif %}
  66.                         </div>
  67.                         {% if format and format == 2 %}
  68.                             <div class="row session p-0 m-0" id="sign-up" style="display: flex;">
  69.                         {% else %}
  70.                             <div class="row session p-0 m-0" id="sign-up" style="display: none;">
  71.                         {% endif %}
  72.                             {% if statusPreregister == 'done' %}
  73.                                 <p class="text-center mt-5 mb-2">Hemos enviado un mensaje a su email</p>
  74.                                 <div class="col-12 d-flex justify-content-center mt-4">
  75.                                     <a href="{{ path('home') }}">
  76.                                         <button class="btn-md blue">Volver al inicio</button>
  77.                                     </a>
  78.                                 </div>
  79.                             {% elseif statusPreregister == 'error' %}
  80.                                 <p class="text-center mt-5">Ya existe un usuario con este correo electrónico. Pruebe a:</p>
  81.                                 
  82.                                 <div class="col-12 d-flex justify-content-center mt-4">
  83.                                     <a href="{{ path('access') }}">
  84.                                         <button class="btn-md blue">Iniciar sesión</button>
  85.                                     </a>
  86.                                 </div>
  87.                                 
  88.                                 <div class="col-12 d-flex justify-content-center mt-4">
  89.                                     <a href="{{ path('recoverPassword') }}">
  90.                                         <button class="btn-md blue">Recuperar contraseña</button>
  91.                                     </a>
  92.                                 </div>
  93.                             {% elseif statusPreregister == 'sender_error' %}
  94.                                 <p class="text-center mt-5 mb-2">No se ha podido enviar el email, vuelva a intentarlo en unos minutos</p>
  95.                                 <div class="col-12 d-flex justify-content-center mt-4">
  96.                                     <a href="{{ path('access') }}">
  97.                                         <button class="btn-md blue">Volver a intentarlo</button>
  98.                                     </a>
  99.                                 </div>
  100.                             {% else %}
  101.                                 <form method="POST" action="{{ path('access') }}" class="form">
  102.                                     <div class="col-12 my-4">
  103.                                         <p class="pb-2">Email</p>
  104.                                         <input type="email" name="email-preregister" required>
  105.                                     </div>
  106.                                     
  107.                                     <input type="hidden" name="send-form-pre" value="1">
  108.                                     <div class="col-12 d-flex justify-content-center mb-4">
  109.                                         <button type="submit" class="btn-md blue">Enter</button>
  110.                                     </div>
  111.         
  112.                                     <input type="hidden" name="format" value="2">
  113.                                 </form>
  114.                             {% endif %}
  115.                         </div>
  116.                     </div>
  117.                 </div>
  118.             </div>
  119.             
  120.         </div>
  121.     </div>
  122.     {% block javascripts %}
  123.         <script>
  124.             function openForm(evt, form) {
  125.                 var i, x, tablinks;
  126.                 var x = document.getElementsByClassName("session");
  127.                 for (i = 0; i < x.length; i++) {
  128.                     x[i].style.display = "none";  
  129.                 }
  130.                 tablinks = document.getElementsByClassName("tablink");
  131.                 for (i = 0; i < x.length; i++) {
  132.                     tablinks[i].className = tablinks[i].className.replace(" active", "");
  133.                 }
  134.                 document.getElementById(form).style.display = "flex";
  135.                 evt.currentTarget.className += " active";
  136.             }
  137.         </script>
  138.     {% endblock %}
  139. {% endblock %}