<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 2024<span style="color:blue;">  Menu Client </span></a>
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
            <li class="nav-item dropdown">
                <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">Commandes</a>
                <div class="dropdown-menu" aria-labelledby="DropdownCommandes">
                    <a class="dropdown-item" href="/client/article/show">
                        Faire une commande(Produits/panier)</a>
                </div>
            </li>

            <li class="nav-item dropdown">
               <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
                    mon compte
                </a>
                <div class="dropdown-menu" aria-labelledby="DropdownComptes">
                    <a class="dropdown-item" href="/client/commande/show" >
                        mes commandes</a>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="/client/coordonnee/show">mes coordonnées</a>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="/client/envies/show">ma liste d'envies - historique</a>
                </div>
            </li>
        </ul>
    </div>

     <div class="d-flex">
            <!-- Authentication Links -->
            {% if session['role']  %}
                <span class="navbar-text">
                    Bonjour {{ session['login'] }}
                    {% if session['role']=='ROLE_admin' %} (role : PB 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 mr-1" type="button" href="/login">
                    PB espace client
                </a>
            {% endif %}

    </div>
  </div> <!--container fluid -->
</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 %}
