{% extends 'AppBundle:Admin/Consultant:layout.html.twig' %}

{% block content %}
    <div class="col-md-10 main">
        <h3>Konsultant: historia</h3>
        <div class="table-responsive">
            <table class="table table-striped">
                <colgroup>
                    <col class="col-xs-8">
                    <col class="col-xs-2">
                    <col class="col-xs-2">
                </colgroup>
                <thead>
                <tr>
                    <th{% if pagination.isSorted('ch.name') %} class="sorted"{% endif %}>
                        {{ knp_pagination_sortable(pagination, 'nazwa', 'ch.name') }}
                    </th>
                    <th{% if pagination.isSorted('ch.createdAt') %} class="sorted"{% endif %}>
                        {{ knp_pagination_sortable(pagination, 'zmodyfikowany', 'ch.createdAt') }}
                    </th>
                    <th>Użytkownik</th>
                </tr>
                </thead>
                <tbody>
                {% for consultant in pagination %}
                    <tr {{ consultant.isRemoved ? 'class="text-danger"' : '' }}>
                        <td>{{ consultant.email is defined ? consultant.email : '' }}</td>
                        <td>{{ consultant.createdAt is defined ? consultant.createdAt|date('d.m.Y H:i') : '' }}</td>
                        <td>
                            {% if consultant.user.id is defined %}
                                <a href="{{ path('app_admin.user.edit', { user: consultant.user.id }) }}">
                                    {{ consultant.user.fullName }}
                                </a>
                            {% endif %}
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>

            <div class="text-center">
                {{ knp_pagination_render(pagination, 'KnpPaginatorBundle:Pagination:twitter_bootstrap_v3_pagination.html.twig') }}
            </div>
        </div>
    </div>
{% endblock %}