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

{% block content %}
    <div class="col-md-10 main">
        <h3>Opłaty dodatkowe: {{ pagination|first.setting.name|lower }}: 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('s.value') %} class="sorted"{% endif %}>
                        {{ knp_pagination_sortable(pagination, 'wartość', 'c.value') }}
                    </th>
                    <th{% if pagination.isSorted('s.createdAt') %} class="sorted"{% endif %}>
                        {{ knp_pagination_sortable(pagination, 'zmodyfikowany', 's.createdAt') }}
                    </th>
                    <th>Użytkownik</th>
                </tr>
                </thead>
                <tbody>
                {% for setting in pagination %}
                    <tr>
                        <td>{{ setting.value is defined ? setting.value : ''}}</td>
                        <td>{{ setting.createdAt is defined ? setting.createdAt|date('d.m.Y H:i') : ''}}</td>
                        <td>
                            {% if setting.user.id is defined %}
                                <a href="{{ path('app_admin.user.edit', { user: setting.user.id }) }}">
                                    {{ setting.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 %}