<script>
$(document).ready(function(){
{% for key,widget in formFilter %}
{% if key != '_token' %}
{% if widget.vars.attr.class is defined and isSubString(widget.vars.attr.class,'spinbox-input') %}
{% set min = "" %}
{% if widget.vars.attr.min is defined %}
{% set min = "min: "~widget.vars.attr.min~", " %}
{% endif %}
{% set max = "" %}
{% if widget.vars.attr.max is defined %}
{% set max = "max: "~widget.vars.attr.max~", " %}
{% endif %}
$('#{{widget.vars.id}}').ace_spinner({ {{ min }}{{ max }} step: 1, on_sides: true, icon_up: 'fas fa-plus', icon_down: 'fas fa-minus ', btn_up_class: 'btn-grey', btn_down_class: 'btn-grey', full_width: true});
{% else %}
{% if widget.vars.attr.class is defined and isSubString(widget.vars.attr.class,'campo_fecha') %}
$('#{{widget.vars.id}}').wrap('<div class="input-group" id="campo_fecha_{{widget.vars.id}}" />');
$('#campo_fecha_{{widget.vars.id}}').append('<span class="input-group-addon"><i class="fas fa-calendar bigger-110"></i></span>');
$('#{{widget.vars.id}}').datepicker({
autoclose: true,
todayHighlight: true
})
.next().on(ace.click_event, function(){
$(this).prev().focus();
});;
//$('#{{widget.vars.id}}').wrap('<div class="input-group date" id="campo_fecha_{{widget.vars.id}}" />');
//$('#campo_fecha_{{widget.vars.id}}').append('<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>');
//$('#campo_fecha_{{widget.vars.id}}').datetimepicker({ format: 'DD/MM/YYYY H:mm' });
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
});
</script>
{% block jquery %}
{% endblock jquery %}
{% set currentRoute = app.request.attributes.get('_route') %}
{% set requestUri = app.request.baseUrl~app.request.pathInfo %}
{% if collapsed is not defined or collapsed %}
{% set collapsed = 'collapsed' %}
{% set display = 'display: none;'%}
{% set chevron = 'fa-chevron-down' %}
{% else %}
{% set collapsed = '' %}
{% set display = 'display: block;'%}
{% set chevron = 'fa-chevron-up' %}
{% endif %}
<div class="widget-box transparent {{collapsed}}">
<div class="widget-header widget-header-flat">
<h4 class="widget-title lighter">
<i class="fas fa-filter orange"></i>
{% block filter_title %}
{% set texto = routeClassName~'.plural' %}
{% trans from 'crud' %}filtro.titulo{% endtrans %} {#{ texto | trans({}, 'crud')|lower }#}
{% endblock filter_title %}
</h4>
<div class="widget-toolbar">
<a href="#" data-action="collapse">
<i class="ace-icon fas {{ chevron }}"></i>
</a>
</div>
</div>
<div class="widget-body" style="{{ display }}">
<div class="widget-main no-padding">
<div class="container-fluid">
{#% trans from 'crud' %}filtro.case{% endtrans %<br>#}<br>
{% block filter_form %}
<form id="filterform_{{ routeClassName }}" method="post" action="{{ requestUri }}" class="filterForm filterClose form">
{% endblock filter_form %}
{% block filter_controls %}
{% set rowopen=false %}
{% set maxcol=filterColumns %}
{% set col=0 %}
{% for key,widget in formFilter %}
{#% for k,el in widget.vars if k != 'is_selected'%}
{% if k=='attr' or k=='form' or k=='block_prefixes' or k=='errors' or k=='label_attr' or k=='preferred_choices' or k=='choices' or k=='value'%}
{% for k1,el1 in widget.vars.attr %}
{{ k }}=>{{ k1 }}=>{{ el1 }}<br>
{% endfor %}
{% else %}
{{ k }}=>{{ el }}<br>
{% endif %}
{% endfor %#}
{% if key != '_token' and not widget.vars.disabled %}
{% if widget.vars.attr['containerclass'] is defined %}
{% if isSubString(widget.vars.attr['containerclass'],'full-row') %}
{% if rowopen %}
</div>
<div class="row">
{% endif %}
{% set col=maxcol-1 %}
{% endif %}
{% endif %}
{% if not rowopen %}
<div class="row">
{% set rowopen=true %}
{% endif %}
<div class="col-xs-12 {% if widget.vars.attr['containerclass'] is not defined or not isSubString(widget.vars.attr['containerclass'],'full-row') %}col-sm-6 col-md-{{ 12 / maxcol }}{% endif %} {% if widget.vars.attr['containerclass'] is defined %}{{widget.vars.attr['containerclass']}}{% endif %}">
<table class="table table-striped table-bordered table-hover">
<tr>
<th style="width: {{ widthLabel }};">
{% set required = '' %}
{% if widget.vars.required %}
{% set required = 'class=required' %}
{% endif %}
<div style="height: 25px; overflow-x: hidden">
<span class="name" id="span_label_{{widget.vars.id}}">
<label id="label_{{widget.vars.id}}" {{required}}>
{{widget.vars.label}}
</label>
</span>
</div>
</th>
<td>
<span class="value" id="span_value_{{widget.vars.id}}">
{{ form_widget(widget) }}
</span>
</td>
</tr>
</table>
</div>
{% set col = col + 1 %}
{% if col == maxcol %}
</div>
{% set rowopen=false %}
{% set col=0 %}
{% endif %}
{%endif%}
{% endfor %}
{% if rowopen %}
</div>
{% endif %}
<!--table id="filter_table">
<tbody>
{% set currentCol = 0 %}
</tbody>
</table-->
{% endblock filter_controls %}
{% block filter_extra %}
{% endblock filter_extra %}
<input type="hidden" value="1" id="filter__page" name="filter[_page]">
<input type="hidden" value="id" name="filter[_sort_by]" id="filter__sort_by">
<input type="hidden" value="ASC" name="filter[_sort_order]" id="filter__sort_order">
{% block filter_acciones %}
<div class="row">
<div class="col-xs-12">
<div class="hr hr-8 hr-dotted"></div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<center>
<input class="btn btn-white btn-inverse btn-bold btn-round" type="submit" value="{% trans from 'crud' %}filtro.boton.send{% endtrans %}" name="Enviar Consulta">
</center>
</div>
<div class="col-xs-6">
<center>
<a id="cleanfiltro_{{ routeClassName }}" class="btn btn-white btn-inverse btn-bold btn-round" href="{{ path('crud_clean_filter', {'rol': rol, 'routeClassName': routeClassName}) }}">
{% trans from 'crud' %}filtro.boton.clean{% endtrans %}
</a>
</center>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="hr hr-8 hr-dotted"></div>
</div>
</div>
{% endblock filter_acciones %}
</form>
<br>
</div>
</div>
</div>
</div>