{% extends "base.html" %}
{% block title %}Types de salles — GMAO{% endblock %}

{% block content %}
<div class="container-fluid">
    <div class="row mb-4">
        <div class="col">
            <h1 class="h3"><i class="bi bi-door-closed"></i> Types de salles</h1>
        </div>
        <div class="col-auto">
            <a href="{{ url_for('admin.room_type_new') }}" class="btn btn-primary">
                <i class="bi bi-plus"></i> Nouveau
            </a>
        </div>
    </div>

    <div class="card">
        <div class="card-body">
            <table class="table table-hover">
                <thead>
                    <tr>
                        <th>Nom</th>
                        <th>Description</th>
                        <th>Couleur</th>
                        <th>Icone</th>
                    </tr>
                </thead>
                <tbody>
                    {% for rt in room_types %}
                    <tr>
                        <td>{{ rt.name }}</td>
                        <td>{{ rt.description or '—' }}</td>
                        <td><span class="badge" style="background-color: {{ rt.color or '#6c757d' }};">{{ rt.color or '—' }}</span></td>
                        <td>{{ rt.icon or '—' }}</td>
                    </tr>
                    {% else %}
                    <tr><td colspan="4" class="text-center text-muted">Aucun type de salle.</td></tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
{% endblock %}