{% extends 'iconolab/user_base.html' %}

{% load staticfiles %}

{% load thumbnail %}

{% load iconolab_tags %}

{% load notifications_tags %}

{% block user_content %}
  <div>
    <h4>{% if profile_user == request.user %}Mes dernières annotations{% else %}Dernières annotations de {{profile_user.username}}{% endif %}</h4>
    {% if not user_annotations %}
      <div class="alert alert-warning">Aucune annotation à afficher</div>
    {% else %}
      <ul class="list-unstyled">
        {% for activity_item in user_activity %}
          {% include "partials/user_pages/activity.html" with user=profile_user annotation=activity_item.annotation action=activity_item.action %}
        {% endfor %}
      </ul>
      <a class="btn btn-default btn-sm" href="{% url 'user_annotations' profile_user.username %}"><span class="glyphicon glyphicon-list" aria-hidden="true"></span> Voir toutes les annotations</a>
    {% endif %}
  </div>
{% endblock %}

{% block footer_js %}
  <script>
  	$(".hide-on-load").hide()
  	$(".show-all-notifications").click(function(){
  	  	$(".show-all-notifications").hide();
  	    $(".hide-on-load").slideDown();
  	})
  </script>
{% endblock %}
