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

{% block title %}Department index{% endblock %}

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

    <table class="table">
        <thead>
            <tr>
                <th>Dcode</th>
                <th>Name</th>
                <th>Alias</th>
                <th>Active</th>
                <th>MiddleName</th>
                <th>actions</th>
            </tr>
        </thead>
        <tbody>
        {% for department in departments %}
            <tr>
                <td>{{ department.did }}</td>
                <td>{{ department.name }}</td>
                <td>{{ department.alias }}</td>
                <td>{{ department.active ? 'Yes' : 'No' }}</td>
                <td>{{ department.middleName }}</td>
                <td>
                    <a href="{{ path('department_edit', {'id': department.id}) }}">edit</a>
                </td>
            </tr>
        {% else %}
            <tr>
                <td colspan="9">no records found</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% endblock %}
