<div class="m-2">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
  <div class="container-fluid">
    <a class="navbar-brand" href="/">SAE BDD 2026</a>
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
    </div>

    <div class="d-flex">
            <!-- Authentication Links -->
            {% if session['role']  %}
                <span class="navbar-text">
                    Bonjour {{ session['username'] }}
                    {% if session['role']=='ROLE_admin' %} (role : Admin)
                    {% elif session['role']=='ROLE_client' %} (role : Client) {% endif %}
                    &nbsp
            </span>
               <a class="btn btn-outline-success" type="button" href="/logout"  >
                    Se déconnecter (Logout)
                </a>
            {% else %}
                <a class="btn btn-outline-success mx-1" type="button" href="/login">
                    Se connecter (Login)
                </a>
                <a class="btn btn-outline-success  mx-2" type="button" href="/signup">
                    Inscription  (Sign Up)
                </a>
                <a class="btn btn-outline-success" type="button" href="">
                    Mot de passe oublié
                </a>
            {% endif %}

    </div>
  </div>
</nav>
</div>

{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
    {% for categorie, message in messages %}
    <div role="alert" class="alert {{ categorie }}">
           Information : <strong>{{ message }}</strong>
    </div>
    {% endfor %}
{% endif %}
{% endwith %}


