{% extends 'base.html' %}
{% load i18n %}

{% block content %}
<div class="container-fluid">
    <h1 class="h3 mb-4 text-gray-800">{% trans "Departments" %}</h1>

    <div class="card shadow mb-4">
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-bordered" width="100%" cellspacing="0">
                    <thead>
                        <tr>
                            <th>{% trans "Name (English)" %}</th>
                            <th>{% trans "Name (Arabic)" %}</th>
                            <th>{% trans "Employees" %}</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for department in departments %}
                        <tr>
                            <td>{{ department.name_en }}</td>
                            <td>{{ department.name_ar }}</td>
                            <td>{{ department.employees.count }}</td>
                        </tr>
                        {% empty %}
                        <tr>
                            <td colspan="3" class="text-center">{% trans "No departments found." %}</td>
                        </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
{% endblock %}
