{% extends 'iconolab_base.html' %}

{% load notifications_tags %}

{% block content %}
  <div class="page-header">
    <h1>{% if profile_user == request.user %}Mon espace:{% else %}Profil : {% endif %} {{profile_user.username}}</h1>
  </div>
  <div class="row">
    <div class="col-md-3">
      <div class="list-group">
        <a href="{% url 'user_home' profile_user.username %}"
          class="list-group-item {% if request.resolver_match.url_name == 'user_home' %}active{% endif%}">
          Activité
        </a>
        <a href="{% url 'user_annotations' profile_user.username %}"
          class="list-group-item {% if request.resolver_match.url_name == 'user_annotations' %}active{% endif%}">
          Annotations
        </a>
        {% if profile_user == request.user %}
        <a href="{% url 'user_notifications' %}"
          class="list-group-item {% if request.resolver_match.url_name == 'user_notifications' %}active{% endif%}">
          {% notifications_unread as unread_count %}

          {% if unread_count %}
          <span class="badge badge-warning">{{ unread_count }}</span>
          {% endif %}
          Notifications
        </a>
        <a href="{% url 'user_settings' %}"
          class="list-group-item {% if request.resolver_match.url_name == 'user_settings' %}active{% endif%}">
          Paramètres
        </a>
        {% endif %}
        {% if profile_user.profile.managed_collections.exists %}
        <a href="{% url 'user_collections' %}"
          class="list-group-item {% if request.resolver_match.url_name == 'user_collections' %}active{% endif%}">
          Collections
        </a>
        {% endif %}
      </div>
    </div>
    <div class="col-md-9">{% block user_content %}{% endblock %}</div>
  </div>
{% endblock %}
