{% extends 'base.html.twig' %}
{% block title %}Homepage{% endblock %}
{% block bodyStyle %}style="background-color: #1f1c40"{% endblock %}
{% block content %}
<section id="page-title" class="page-title-center bg_pr">
<div class="container clearfix">
<h1 class="color_w">{% block admin_title %}Accedi a TILLOMED Italia{% endblock %}</h1>
</div>
</section>
<section class="m_tb_80p">
<div class="container">
<div class="row">
<div class="col-12 col-md-8 offset-md-2 col-lg-6 offset-lg-3">
<div class="txt_a_c">
<img class="m_b_30p" width="200" src="{{ asset ('images/graphics/logo.png') }}">
</div>
<div class="tabs tabs-bb tabs-justify clearfix">
<ul class="tab-nav clearfix">
<li><a class="uppercase" href="#login">Accedi</a></li>
<li><a class="uppercase" href="#register" id="registerBtn">Registrati</a></li>
</ul>
<div class="tab-container">
<div class="tab-content clearfix" id="login">
{% if error %}
<div class="style-msg errormsg notice">
<div class="sb-msg"><i class="icon-remove"></i><strong>Attenzione!!!</strong> Username o password non corretti!</div>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</div>
{% endif %}
<form method="post">
<div class="row">
<div class="col-12 form-group m_b_20p">
<label>Email con cui sei registrato</label>
<input class="form-control" type="email" id="username" name="email" value="{{ last_username }}"/>
</div>
<div class="col-12 form-group">
<label>Password</label>
<input class="form-control" type="password" id="password" name="password" />
</div>
<div class="col-12 txt_a_c m_b_20p">
<a href="javascript:showRecovery()"><label class="font_12 color_pr"><u>Password dimenticata?</u></label></a>
</div>
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
<div class="col-12 txt_a_c">
<button type="submit" class="button button-3d button-rounded button-green">Accedi</button>
</div>
</div>
</form>
</div>
<div class="tab-content clearfix" id="register">
{{ form_start(form, {'attr': {'novalidate': 'novalidate'}}) }}
<div class="row">
<div class="col-12 col-md-6 form-group m_b_20p">
<label>Nome*</label>
<div {{ form_errors(form.name) }}>
{{ form_widget(form.name) }}
</div>
</div>
<div class="col-12 col-md-6 form-group m_b_20p">
<label>Cognome*</label>
<div {{ form_errors(form.surname) }}>
{{ form_widget(form.surname) }}
</div>
</div>
<div class="col-12 col-md-6 form-group m_b_20p">
<label>Email*</label>
<div {{ form_errors(form.email.first) }}>
{{ form_widget(form.email.first) }}
</div>
</div>
<div class="col-12 col-md-6 form-group m_b_20p">
<label>Ripeti email*</label>
<div {{ form_errors(form.email.second) }}>
{{ form_widget(form.email.second) }}
</div>
</div>
<div class="col-12 form-group">
<label class="m_b_none color_555">Inserire una password RESISTENTE <a href="javascript:divHelp('strong_password')"><img src="{{ asset ('images/graphics/info.png') }}" class="info_icon"></a></label>
</div>
<div class="col-12 col-md-6 form-group m_b_20p">
<label>Password*</label>
<div {{ form_errors(form.password.first) }}>
{{ form_widget(form.password.first) }}
</div>
</div>
<div class="col-12 col-md-6 form-group m_b_20p">
<label>Ripeti password*</label>
<div {{ form_errors(form.password.second) }}>
{{ form_widget(form.password.second) }}
</div>
</div>
<div class="col-12 form-group overflow_a m_b_20p">
<table class="m_none">
<tr>
<td class="td_w_50p">{{ form_widget(form.terms, {'attr': {'class':'switch-toggle switch-toggle-flat switch-flat-mini' }}) }}<label for="{{ form.terms.vars.id }}"></label></td>
<td><div {{ form_errors(form.terms) }}><label class="font_12 color_555">Ho letto e accetto i <a href="https://tillomed.it/documents/termini_e_condizioni.pdf" class="color_pr" target="_blank">termini e condizioni</a>*</div></td>
</tr>
<tr>
<td class="td_w_50p">{{ form_widget(form.news, {'attr': {'class':'switch-toggle switch-toggle-flat switch-flat-mini' }}) }}<label for="{{ form.news.vars.id }}"></label></td>
<td><label class="font_12 color_555">Voglio ricevere aggiornamenti e newsletter da TILLOMED Italia</label></td>
</tr>
</table>
</div>
<div class="col-12 form-group txt_a_c m_b_20p">
<div {{ form_errors(form.recaptcha) }}>
<div id="divRecaptcha" class="g-recaptcha" data-sitekey="6LfCPG4UAAAAAPgNU6PmV5VN7OjYWYzoYhJQB4wo"></div>
</div>
</div>
<div class="col-12 txt_a_c">
<p class="m_b_10p">
<i><b>I campi contrassegnati con * sono obbligatori</b></i><br>
</p>
</div>
<div class="col-12 col-md-4 offset-md-4 txt_a_c">
<button type="submit" class="button button-3d button-rounded button-green">Registrati</button>
</div>
</div>
{{ form_end(form) }}
</div>
</div>
</div>
</div>
</div>
</div>
</section>
{# Modale recupero password #}
<div id="modalRecoverPsw" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form action="{{ path('password_recovery') }}" method="post">
<div class="modal-header"><h3 class="modal-title text-uppercase txt_a_c">Recupera Password<h3></div>
<div class="modal-body">
<div class="row">
<div class="col-12 txt_a_c">
<p class="nobottommargin m_b_30p">Per recuperare la password inserisci l'email con cui sei registrato.<br>Riceverai una e-mail contenente le informazioni per l'accesso.</p>
<label class="f_left">Email con cui sei registrato</label>
<input class="form-control m_b_10p p_lr_10p" type="email" name="recovery"/>
<button for="recovery" type="submit" class="button button-3d button-rounded button-green">Recupera</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script>
{% if registerTab %}
$(document).ready( function(){
document.getElementById('registerBtn').modal('show');
});
{% endif %}
function showRecovery(){
$("#modalRecoverPsw").modal("show");
}
</script>
{% endblock %}