{% extends "@crud\\crud\\formulario_new.html.twig" %}
{% block pre_form %}
<span id="personaId" class="hide"></span>
<div id="searchDiv" class="row">
<form id="searchForm">
<div class="col-xs-12">
<p class="blue lighter">{{ 'usuario.datos.identificacionTip' | trans({}, 'crud') | upper }}</p>
</div>
<div class="col-xs-12 col-sm-5">
<table class="table table-striped table-bordered table-hover">
<tr>
<th style="width: 30%;">
<label class=" required ">
{{ 'admin.fields.username' | trans({}, 'crud') | upper }}
</label>
</th>
<td>
<input id="identificacion" type="text" maxlength="13" style="width: 100%" required="true">
</select>
</td>
</tr>
</table>
</div>
<div class="col-xs-12 col-sm-2">
<button id="searchBtn" class="btn btn-info">
<i class="fas fa-search"></i>
{{ 'botones.buscar' | trans({}, 'crud') | upper }}
</button>
</div>
</form>
</div>
<div id="nouser" class="hide">
<div class="alert alert-danger">
<strong>
<i class="fas fa-info-circle bigger-150"></i>
{{ 'usuario.error.noexist' | trans({}, 'crud') }}
</strong>
<br>
<br>
<table>
<tr>
<td> </td>
<td style="text-align: right">
<strong>{{ 'admin.fields.username' | trans({}, 'crud') }}:</strong>
</td>
<td> </td>
<td>
<span id='idData'></span>
</td>
</tr>
</table>
<br>
</div>
<div class="row">
<div class="col-xs-6" style="text-align: center">
<button id="crear" class="btn btn-success">
<i class="fas fa-plus"></i>
{{ 'botones.nuevo' | trans({}, 'crud') | upper }}
</button>
</div>
<div class="col-xs-6" style="text-align: center">
<button id="searchAgainNoUser" class="btn btn-info">
<i class="fas fa-search"></i>
{{ 'botones.rebuscar' | trans({}, 'crud') | upper }}
</button>
</div>
</div>
</div>
<div id="person" class="hide">
<input id="personBDId" type="hidden">
<div id="inhabilitado" class="row hide">
<div class="col-xs-12">
<div class="alert alert-danger">
<strong>
<i class="fas fa-info-circle bigger-150"></i>
<span id="inhabilitadoData"><span>
</strong>
</div>
<div class="hr hr-8 hr-dotted"></div>
</div>
</div>
<div class="row">
<div id="personFoto" class="col-xs-12 col-sm-6 col-md-2" style="text-align: center">
</div>
<div class="col-xs-12 col-sm-6 col-md-10">
<div class="row">
<div class="col-xs-12 col-sm-6">
<table class="table table-striped table-bordered table-hover">
<tr>
<th style="width: 30%;">
<label>
{{ 'admin.fields.username' | trans({}, 'crud') }}
</label>
</th>
<td>
<span id="personId"></span>
</td>
</tr>
</table>
</div>
<div class="col-xs-12 col-sm-6">
<table class="table table-striped table-bordered table-hover">
<tr>
<th style="width: 30%;">
<label>
{{ 'admin.fields.nombreCompleto' | trans({}, 'crud') }}
</label>
</th>
<td>
<span id="personNombre"></span>
</td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6">
<table class="table table-striped table-bordered table-hover">
<tr>
<th style="width: 30%;">
<label>
{{ 'admin.fields.telefono' | trans({}, 'crud') }}
</label>
</th>
<td>
<span id="personTelefono"></span>
</td>
</tr>
</table>
</div>
<div class="col-xs-12 col-sm-6">
<table class="table table-striped table-bordered table-hover">
<tr>
<th style="width: 30%;">
<label>
{{ 'admin.fields.movil' | trans({}, 'crud') }}
</label>
</th>
<td>
<span id="personMovil"></span>
</td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6">
<table class="table table-striped table-bordered table-hover">
<tr>
<th style="width: 30%;">
<label>
{{ 'admin.fields.email' | trans({}, 'crud') }}
</label>
</th>
<td>
<span id="personMail"></span>
</td>
</tr>
</table>
</div>
<div class="col-xs-12 col-sm-6">
<table class="table table-striped table-bordered table-hover">
<tr>
<th style="width: 30%;">
<label>
{{ 'admin.fields.direccion' | trans({}, 'crud') }}
</label>
</th>
<td>
<span id="personDireccion"></span>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="hr hr-8 hr-dotted"></div>
<div class="row">
<div class="col-xs-6" style="text-align: center">
<button id="confirmar" class="btn btn-success">
<i class="fas fa-check"></i>
{{ 'botones.confirmar' | trans({}, 'crud') | upper }}
</button>
</div>
<div class="col-xs-6" style="text-align: center">
<button id="searchAgainWrongPerson" class="btn btn-info">
<i class="fas fa-search"></i>
{{ 'botones.rebuscar' | trans({}, 'crud') | upper }}
</button>
</div>
</div>
</div>
{% endblock %}
{% block form_action %}
{{ form_start(form, {'attr': { 'class': 'hide form form_'~routeClassName, 'id': 'crud_form_'~routeClassName}, 'method': 'POST', 'action': path('crud_plain_create', {'rol': rol, 'routeClassName': routeClassName})}) }}
{% endblock %}
{% block botones_form %}
<div class="row">
<div class="col-xs-12">
<div class="hr hr-8 hr-dotted"></div>
</div>
</div>
<div class="row" id="botones_form">
<div class="col-xs-3">
<center>
<a id="searchAgainForm" class="btn btn-white btn-inverse btn-bold btn-round" href="">
{% trans from 'crud' %}usuario.botones.descartar{% endtrans %}
</a>
</center>
</div>
<div class="col-xs-3">
<center>
{% block action_retorno %}
<a id="btn_retorno" class="btn btn-white btn-inverse btn-bold btn-round" href="{{ path('crud_plain_back_to_list', {'rol': rol, 'routeClassName': routeClassName, 'from': 'new'}) }}">
{% trans from 'crud' %}botones.regresar{% endtrans %}
</a>
{% endblock %}
</center>
</div>
<div class="col-xs-3">
<center>
<input id="{{btnSave}}" class="btn btn-white btn-inverse btn-bold btn-round" type="submit" value="{% trans from 'crud' %}botones.grabar{% endtrans %}" name="{{btnSave}}">
</center>
</div>
<div class="col-xs-3">
<center>
<input id="btn_do_and_create" class="btn btn-white btn-inverse btn-bold btn-round" type="submit" value="{% trans from 'crud' %}botones.grabar_y_crear{% endtrans %}" name="btn_do_and_create">
</center>
</div>
</div>
{% endblock %}