{% 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 %}
      <h4 class="no-user-annotation"><small>Aucune annotation à afficher</small></h4>
    {% else %}
      <ul class="list-unstyled">
        {% for annotation in user_annotations.all %}
           {% include "partials/user_pages/annotations_created_panel.html" with annotation=annotation user=profile_user %}
        {% 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>
  <div>
    <h4>{% if profile_user == request.user %}Mes contributions{% else %}Contributions de {{profile_user.username}}{% endif %}</h4>
    <dl>
    <dt class="dt-annotation">
      {% if profile_user == request.user %}
        Dernières annotations sur lesquelles j'ai proposé des révisions :
      {% else %}
        Dernières annotations sur lesquelles {{profile_user.username}} a proposé des révisions :
      {% endif %}
      </dt>
      <dd>
      {% if not user_contributed_annotations %}
         <h4 class="no-user-annotation"><small>Aucune annotation à afficher</small></h4>
      {% else %}
        <ul class="list-inline">
          {% for annotation_data in user_contributed_annotations %}
             {% include "partials/user_pages/annotations_contributed_panel.html" with annotation_data=annotation_data user=profile_user %}
          {% endfor %}
          <li>
            <a class="btn btn-default btn-sm" href="{% url 'user_contributed' profile_user.username %}"><span class="glyphicon glyphicon-list" aria-hidden="true"></span> Voir toutes les contributions</a>
          </li>
        </ul>
      {% endif %}
      </dd>
      <dt class="dt-annotation">
      {% if profile_user == request.user %}
        Dernières annotation sur lesquelles j'ai commenté (sans proposer de révision) :
      {% else %}
        Dernières annotations sur lesquelles {{profile_user.username}} a commenté (sans proposer de révision) :
      {% endif %}
      </dt>
      <dd>
      {% if not user_commented_annotations %}
         <h4 class="no-user-annotation"><small>Aucune annotation à afficher</small></h4>
      {% else %}
        <ul class="list-unstyled">
          {% for annotation_data in user_commented_annotations %}
            {% include "partials/user_pages/annotations_commented_panel.html" with annotation_data=annotation_data user=profile_user %}
          {% endfor %}
          <li>
            <a class="btn btn-default btn-sm" href="{% url 'user_commented' profile_user.username %}"><span class="glyphicon glyphicon-list" aria-hidden="true"></span> Voir toutes les annotations commentées</a>
          </li>
        </ul>
      {% endif %}
      </dd>
    </dl>
  </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 %}
