{% extends 'custom-base.html.twig' %}
{% block body %}
<!-- CONTAINER OPEN -->
<div class="col col-login mx-auto mt-7">
<div class="text-center">
<a href="{{absolute_url(path('app_home'))}}"><img src="{{absolute_url(asset('/cpe/build/images/brand/leadplanet-logo-4.png'))}}" class="header-brand-img" alt=""></a>
</div>
</div>
<div class="container-login100">
<div class="wrap-login100 p-6">
{% if error is defined and error %}
{% if error.message is same as 'Un nouveau code a été envoyé par SMS. Veuillez entrer le code pour continuer.' or error.message is same as 'Un code a été envoyé par SMS. Veuillez entrer le code pour continuer.' %}
<div class="alert alert-success">{{ error.message|raw }}</div>
{% else %}
<div class="alert alert-danger">{{ error.message|raw }}</div>
{% endif %}
{% endif %}
{% if app.user %}
<div class="mb-3">
You are logged in as {{ app.user.userIdentifier }}, <a href="{{ absolute_url(path('app_logout')) }}">Logout</a>
</div>
{% endif %}
{% if app.session.get('user_pending') %}
<form method="post">
<div class="form-group">
<label for="sms_code" class="bold">Code SMS*</label>
<input type="text" id="sms_code" name="sms_code" maxlength="6" pattern="\d{6}" required class="form-control" placeholder="123456">
</div>
<div class="flex flex-row space-between center mt-20 mb-10">
<button type="submit" class="btn-primary btn mr-15">Valider le code sms</button>
<button type="reset" class="btn btn-secondary mr-15">Annuler</button>
</div>
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
</form>
<br>
{# Lien pour renvoyer le code #}
<form method="post" action="" class="flex just-end">
<input type="hidden" name="resend_code" value="true">
<button type="submit" class="btn btn-success mr-15">Renvoyer le code SMS</button>
</form>
{% else %}
<form class="login100-form validate-form" method="post">
<span class="login100-form-title pb-5">
Connexion
</span>
{% for label, messages in app.flashes %}
<div class="mt-20 alert alert-{{ label }}">
{% for message in messages %}
<p class="m-tb-auto">{{ message|raw }}</p>
{% endfor %}
</div>
{% endfor %}
<div class="panel panel-primary">
<div class="panel-body tabs-menu-body p-0 pt-5">
<div class="tab-content">
<div class="tab-pane active" id="tab5">
<div class="wrap-input100 validate-input input-group" data-bs-validate="Valid email is required: ex@abc.xyz">
<a href="javascript:void(0)" class="input-group-text bg-white text-muted">
<i class="zmdi zmdi-email text-muted" aria-hidden="true"></i>
</a>
<input type="email" class="input100 border-start-0 form-control ms-0" id="email" name="email" value="{{ last_username }}" placeholder="Email" required autofocus>
</div>
<div class="wrap-input100 validate-input input-group" id="Password-toggle">
<a href="javascript:void(0)" class="input-group-text bg-white text-muted">
<i class="zmdi zmdi-eye text-muted" aria-hidden="true"></i>
</a>
<input type="password" id="password" name="password" placeholder="Mot de passe" class="input100 border-start-0 form-control ms-0" required>
</div>
<div class="text-end pt-4">
<p class="mb-0"><a href="{{absolute_url(path('app_forgot_password'))}}" class="text-primary ms-1">Mot de passe oublié ?</a></p>
</div>
<div class="container-login100-form-btn">
<input type="submit" class="login100-form-btn btn-primary" value="Se connecter">
</div>
<div class="text-center pt-3">
<p class="text-dark mb-0">Pas encore membre ?<a href="{{absolute_url(path('app_register'))}}" class="text-primary ms-1">S'inscrire</a></p>
</div>
<div class="text-center pt-3">
<p class="text-dark mb-0">Aucun email de vérification ?<a href="{{absolute_url(path('resend_verification_email'))}}" class="text-primary ms-1">Renvoyer l'email</a></p>
</div>
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
{#<label class="login-social-icon"><span>Login with Social</span></label>
<div class="d-flex justify-content-center">
<a href="javascript:void(0)">
<div class="social-login me-4 text-center">
<i class="fa fa-google"></i>
</div>
</a>
<a href="javascript:void(0)">
<div class="social-login me-4 text-center">
<i class="fa fa-facebook"></i>
</div>
</a>
<a href="javascript:void(0)">
<div class="social-login text-center">
<i class="fa fa-twitter"></i>
</div>
</a>
</div>#}
</div>
</div>
</div>
</div>
</form>
{% endif %}
</div>
</div>
<!-- CONTAINER CLOSED -->
{% endblock %}
{% block javascripts %}
{{parent()}}
<!-- SHOW PASSWORD JS -->
<script src="{{absolute_url(asset('/cpe/build/plugins/show-password/show-password.min.js'))}}"></script>
<!-- GENERATE OTP JS -->
{{ encore_entry_script_tags('js/generate-otp') }}
{% endblock %}