{% trans_default_domain 'provider' %}
{{ form_start(list_form) }}

<div class="box pad">
    <div class="box-header">
        <i class="fa fa-list-ul"></i>
        <h3 class="box-title">Provedores</h3>
        <!-- tools box -->
        &nbsp;
        <div class="btn-group">

            <button type="submit" name="delete" class="btn btn-default"
                    title="{% trans %}list.bulk_delete{% endtrans %}"
                    data-confirm="{% trans %}list.bulk_delete_confirm{% endtrans %}"><span
                        class="glyphicon glyphicon-trash"></span></button>

            {#<button type="submit" name="print" class="btn btn-default" title="{% trans %}list.bulk_print{% endtrans %}">
                <span class="glyphicon glyphicon-print"></span></button>
            <button type="submit" name="pdf" class="btn btn-default" title="{% trans %}list.bulk_pdf{% endtrans %}">
                <span class="glyphicon glyphicon-download-alt"></span></button>#}

            <a  href="{{ path('provider_upload') }}" class="btn btn-default"
                title="Cargar Proveedores"><span
                        class="glyphicon glyphicon-upload"></span></a>
            
            {#
            <a  href="{{ path('provider_download_all') }}" class="btn btn-default"
                title="Descarga Excel"><span
                        class="fa fa-file-excel-o"></span>
                        </a>
              #}          
                        
        </div>
    </div>
    <div class="box-body">
        <table class="table table-condensed table-striped align-middle" data-type="providers">
            <thead>
            <tr>
                <th class="cell-size-tiny cell-align-center">
                    <input type="checkbox" name="all"/>
                </th>
                <th class="cell-size-medium">
                    {{ knp_pagination_sortable(providers, 'list.name'|trans, 'c.name') }}
                </th>
                <th>
                    {{ knp_pagination_sortable(providers, 'list.identification'|trans, 'c.identification') }}
                </th>
            {#    <th class="cell-size-medium cell-align-right"></th>
            #}</tr>
            </thead>
            <tbody>
            {% if providers|length == 0 %}
                <tr>
                    <td colspan="6">{% trans %}list.no_results{% endtrans %}</td>
                </tr>
            {% endif %}
            {% for key, result in providers %}
                {% set entity = result %}
                <tr data-link="{{ path('provider_edit', { 'slug': entity.slug, 'id':entity.id }) }}">
                    <td class="table-action cell-align-center no-link">
                        {{ form_row(list_form.invoices[key]) }}
                    </td>
                    <td class="cell-size-medium">{{ entity.name }}</td>
                    <td>{{ entity.identification }}</td>
                    {#<td class="cell-align-right"><a
                                href="{{ path('provider_index', {'search_invoice': {'provider': entity.name}}) }}"
                                class="btn btn-info"><span
                                    class="glyphicon glyphicon-book"></span>Retenciones</a></td>#}
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    <div class="box-footer clearfix">
        <div class="navigation">
            {{ knp_pagination_render(providers) }}
        </div>
    </div>
</div>
{{ form_end(list_form) }}
