{% extends 'base.html.twig' %}

{% block title %}
    Rodiče
{% endblock %}

{% block body %}

    <h2>Seznam všech rodičů</h2>

    <hr>
    {% if is_granted('ROLE_ADMIN') %}
        <a href="{{path('rodic.create')}}" class="btn btn-outline-primary float-left">Vytvořit nového rodiče</a>
        <br>
    {% endif %}
    <br>


    <div class="shadow" style="width: max-content;">
        <table id="table" data-toggle="table" data-height="500"
               class="table table-bordered table-borderless table-hover">
            <thead class="thead-light">
            <tr>
                <th data-field="ID">ID</th>
                <th data-field="Titul">Titul</th>
                <th data-field="Jmeno">Jméno</th>
                <th data-field="Prijmeni">Příjmení</th>
                <th data-field="DatNar" style="width:150px">Datum Narození</th>
                <th data-field="Stat">Stát</th>
                <th data-field="Obec">Obec</th>
                <th data-field="MCast">Městská část</th>
                <th data-field="Ulice">Ulice</th>
                <th data-field="CisPop" style="width: 125px">Číslo popisné</th>
                <th data-field="PSC">PSČ</th>
            </tr>
            </thead>
            <tbody>

            {% for rodic in rodice %}

                <tr style="transform: rotate(0);">
                    <td scope="colgroup">
                        <a href="{{ path('rodic.show', {rodic: rodic.id}) }}" class="stretched-link">{{ rodic.id }}</a>
                    </td>
                    <td>
                        {{ rodic.titul }}
                    </td>
                    <td>
                        {{ rodic.jmeno }}
                    </td>
                    <td>
                        {{ rodic.prijmeni }}
                    </td>
                    <td>
                        {{ rodic.datNar|date('d-m-Y') }}
                    </td>
                    <td>
                        {{ rodic.stat }}
                    </td>
                    <td>
                        {{ rodic.obec }}
                    </td>
                    <td>
                        {{ rodic.mCast }}
                    </td>
                    <td>
                        {{ rodic.ulice }}
                    </td>
                    <td>
                        {{ rodic.cisPop }}
                    </td>
                    <td>
                        {{ rodic.psc }}
                    </td>
                </tr>

            {% endfor %}

            </tbody>
        </table>
    </div>

{% endblock %}

