{% extends "includes/nav.html"  %}
{% load combo gadjo %}

{% block menu %}
{# replace last menu item by user name #}
{% spaceless %}
<ul>
 {% for page in pages.0.get_siblings %}
   {% if page.public and not page.exclude_from_navigation %}
     <li data-menu-page-id="{{ page.id }}"
         {% if page.slug == pages.0.slug %}title="{{page.title}} - Page active"{% endif %}
         class="menu-{{ page.slug }}
         {% if page.slug == pages.0.slug %}selected{% endif %}"
       >{% if page.slug != 'mon-compte' %}<a href="{% page_absolute_url page %}"><span>{{ page.title }}</span></a>{% else %}
        {% skeleton_extra_placeholder "user-nav-link" %}{% if user.is_authenticated %}<a href="{{portal_url}}mon-compte/"><span>{{user.first_name}}</span></a>
        <ul>
                <li><a href="{{portal_url}}mon-compte/">Mon compte</a></li>
                <li><a href="{{ logout_url }}">Me déconnecter</a></li>
        </ul>
        {% else %}<a href="/login"><span>Se connecter</span></a>{% endif %}{% end_skeleton_extra_placeholder %}{% endif %}</li>
   {% endif %}
 {% endfor %}
</ul>
{% endspaceless %}
{% endblock %}
