{% load notifications_tags %}
{% load staticfiles %}

<div class="navbar-container">
  {% if homepage %}
    <a class="homepage-logo" href="{% url 'home' %}">
      <img src="{% static 'iconolab/img/iconolab.png' %}" width="306" height="67"> 
    </a>
  {% endif %}
  <nav class="navbar navbar-default {% if homepage %}navbar-homepage{% endif %}" {% if collection %} style="margin-bottom: 5px;" {% endif %}>
    <div class="container-fluid">
      <div class="navbar-header">
          {% if not homepage %}
            <a class="navbar-brand" href="{% url 'home' %}">
              Iconolab
            </a>
          {% endif %}
      </div>
      <div id="navbar" class="navbar-collapse collapse">
        <ul class="nav navbar-nav">
          <li><a href="{% url 'iconolab_help' %}">Le projet</a></li>
          {% if collection_name %}<li><a href="{% url 'collection_home' collection_name %}">Contribuer</a></li>{% endif %}
        </ul>
        
        {% include "partials/header_search_form.html"%}
        
        <ul class="nav navbar-nav navbar-right">
          {% if request.user.is_authenticated %}
            {% notifications_unread as unread_count %}
            <li><a href="{% url 'user_home' request.user.id %}" title="{{request.user.username}}: Mon espace - {{ unread_count }} notification(s)">
              Mon espace <span class="badge {% if unread_count %}badge-warning{% endif %}">
              {{ unread_count }} <i class="fa fa-envelope-o" aria-hidden="true"></i> </span>
            </a></li>
            <li><a href="{% url 'account:logout' %}">Se déconnecter</a></li>
          {% else %}
            <li><a href="{% url 'account:register' %}">Créer un compte</a></li>
            <li><a href="{% url 'account:login' %}?next={{ request.path | urlencode }}">Se Connecter</a></li>
          {% endif %}
        </ul>
      </div><!--/.nav-collapse -->
    </div><!--/.container-fluid -->
  </nav>
</div>
{% include "partials/header_breadcrumbs.html" %}
