{% extends "base.html" %}
{% block title %}Personnels ENT — GMAO{% endblock %}
{% block content %}
<div class="container-fluid">
  <div class="d-flex justify-content-between align-items-center mb-4">
    <h1><i class="bi bi-people"></i> Personnels ENT</h1>
    <a href="{{ url_for('admin.staff') }}" class="btn btn-outline-primary"><i class="bi bi-pencil"></i> Gérer le personnel</a>
  </div>
  <div class="card"><div class="table-responsive">
    <table class="table table-hover mb-0">
      <thead><tr><th>Nom</th><th>Fonction</th><th>Service</th><th>Contact</th><th>Statut</th></tr></thead>
      <tbody>
      {% for staff in staff_list %}
        <tr>
          <td>{{ staff.full_name }}</td><td>{{ staff.function or '—' }}</td><td>{{ staff.department or '—' }}</td>
          <td>{{ staff.email or staff.phone or '—' }}</td>
          <td><span class="badge bg-{{ 'success' if staff.is_active else 'secondary' }}">{{ 'Actif' if staff.is_active else 'Inactif' }}</span></td>
        </tr>
      {% else %}<tr><td colspan="5" class="text-center text-muted py-4">Aucun personnel importé.</td></tr>{% endfor %}
      </tbody>
    </table>
  </div></div>
</div>
{% endblock %}
