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

{% block title %}User index{% endblock %}

{% block body %}
    <h1>User index</h1>

    <table class="table">
        <thead>
            <tr>
                <th>Id</th>
                <th>FirstName</th>
                <th>SurName</th>
                <th>Phone</th>
                <th>Email</th>
                <th>Username</th>
                <th>Roles</th>
                <th>Password</th>
                <th>actions</th>
            </tr>
        </thead>
        <tbody>
        {% for user in users %}
            <tr>
                <td>{{ user.id }}</td>
                <td>{{ user.firstName }}</td>
                <td>{{ user.surName }}</td>
                <td>{{ user.phone }}</td>
                <td>{{ user.email }}</td>
                <td>{{ user.username }}</td>
                <td>{{ user.roles ? user.roles|json_encode : '' }}</td>
                <td>{{ user.password }}</td>
                <td>
                    <a href="{{ path('app_user_show', {'id': user.id}) }}">show</a>
                    <a href="{{ path('app_user_edit', {'id': user.id}) }}">edit</a>
                </td>
            </tr>
        {% else %}
            <tr>
                <td colspan="9">no records found</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <a href="{{ path('app_user_new') }}">Create new</a>
{% endblock %}
