{% extends "includes/nav.html"  %}

{% block menu %}
{{ block.super }}
{# replace "mon-compte" menu item by user name #}
{% skeleton_extra_placeholder "user-script-infos" %}
<script>
  var $last_menu_item = $('#nav > ul > li:last-child');
{% if user.is_authenticated %}
  $last_menu_item.find('> a span').text("{{ user.first_name|escapejs }}");
{% else %}
  $last_menu_item.find('> a').attr('href', '/login/');
  $last_menu_item.find('ul').remove();
{% endif %}
  $('#nav ul ul').parent('li').addClass('has-submenu');
</script>
{% end_skeleton_extra_placeholder %}
{% endblock %}
