{% extends 'security/base.html.twig' %}
{% block contenido %}
<div class="caja" >
<form method="post" action="{{ url('app_login') }}">
{% if app.user %}
<div class="mb-3">
You are logged in as {{ app.user.username }}, <a href="{{ path('app_logout') }}">Logout</a>
</div>
{% endif %}
<div class="card">
<div class="card-content">
<div class="row">
<div class="input-field col s12 center">
<img src="{{ logo_web }}" alt="" width="250px">
</div>
</div>
<div class="row">
<div class="input-field col s12">
<i class="material-icons prefix color-primario">person</i>
<input type="text" value="{{ last_username }}" name="username" id="usuario_ingresar" >
<label for="usuario_ingresar" class="center-align">Usuario / DNI</label>
</div>
</div>
<div class="row ">
<div class="input-field col s12">
<i class="material-icons prefix color-primario">lock</i>
<input name="password" id="password_ingresar" type="password">
<label for="password_ingresar" class="">Contraseña</label>
</div>
</div>
{% if error %}
<!-- caja de error -->
<div class="row">
<div class="col s12">
<div class="card-panel card-error red lighten-4 red-text text-darken-2">
<p class="center-align">{{ error.messageKey|trans(error.messageData, 'security') }}</p>
<p></p>
</div>
</div>
</div>
<!-- fin caja de error -->
{% endif %}
<input type="hidden" name="_csrf_token"
value="{{ csrf_token('authenticate') }}">
<div class="row margin">
<div class="col s12">
<button type="submit" class="btn waves-effect waves-light col s12 back-primario" id="boton_ingresar">Ingresar</button>
</div>
</div>
<div class="row">
<div class="input-field col s6 m6 left-align">
<span class="margin right-align medium-small">
<a class="activator" href="#" id="2">¿Olvidó su contraseña?</a></span>
</div>
<div class="input-field col s6 m6 right-align">
</div>
</div>
</div>
</form>
<div class="card-reveal" >
{{ form_start(formForgot) }}
<div id="cambiar" >
<span class="card-title grey-text text-darken-4">SOLICITAR CONTRASEÑA <i class="material-icons right">close</i></span>
<hr>
<p>Ingrese los siguientes datos.</p>
<div class="row ">
<div class="input-field col s12">
<i class="material-icons prefix">portrait</i>
{{ form_widget(formForgot.dni) }}
{{ form_label(formForgot.dni) }}
<span class="helper-text" data-error="wrong" data-success="right">Ingrese su DNI sin puntos</span>
</div>
</div>
<div class="row">
<div class="col s12 m12 left-align">
<button type="submit" class="btn-flat waves-effect waves-light grey lighten-2 ">
ENVIAR SOLICITUD </button>
</div>
</div>
</div>
{{ form_end(formForgot) }}
</div>
</div>
{% if aspirante is defined %}
<div class="col l12 m12 s12 center">
<a class="white-text" style="padding:0.2rem;" href="{{ path('aspirante_registry') }}"><i class="material-icons">person_add</i> Quiero registrarme al PODA</a>
</div>
{% endif %}
{% endblock %}
{% block js_document_ready %}
{% if persona is defined and persona is not null %}
$('#modalForgot').modal('open');
{% endif %}
{% endblock %}
{% block dialogos_modales %}
<!-- Modal Structure -->
{% if persona is defined and persona is not null %}
<div id="modalForgot" class="modal">
<form action="{{ url('app_forgot_ini', { id: persona.id }) }}" method="post">
<div class="modal-content">
<h4>Recupero de contraseña de acceso al Portal</h4>
<p>Estimado/a {{ persona.nombres }} se le enviará un correo a
<b>{{ persona.emailPersonal |hide_email }}</b> con un enlace para iniciar el proceso
de recuperación de contraseña.</p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-close waves-effect waves-green btn-flat">Cancelar</a>
{# the argument of csrf_token() is an arbitrary string used to generate the token #}
<input type="hidden" name="ini_forgot_token" value="{{ csrf_token('iniciar-forgot') }}"/>
<button class="btn identidad-color darken-2 waves-effect waves-light">
Iniciar
<i class="material-icons right">done</i>
</button>
</div>
</form>
</div>
{% endif %}
{% endblock %}