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

{% load staticfiles %}

{% load thumbnail %}

{% load iconolab_tags %}

{% load notifications_tags %}

{% block user_content %}
  <div id="user-profile-block" class="row">
    {% 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 %}
           {% include "partials/user_pages/annotations_created_panel.html" with annotation=annotation user=profile_user with_stats=True large_image=True %}
        {% endfor %}
      </ul>
      <ul class="pagination pull-right img-ann-{{image.obj.guid}}-perpage" style="margin-left: 15px;">
        <li class="active pagination-label"><a>Annotations par page : </a></li>
        <li class="{% if user_annotations.paginator.per_page == 5 %}active{% endif %}">
          <a {% if user_annotations.paginator.per_page != 5 %}href="{% url 'user_annotations' profile_user.id %}?&page=1&perpage=5"{% endif %}>5</a>
        </li>
        <li class="{% if user_annotations.paginator.per_page == 10 %}active{% endif %}">
          <a {% if user_annotations.paginator.per_page != 10 %}href="{% url 'user_annotations' profile_user.id %}?show={{image.obj.image_guid}}&page=1&perpage=10"{% endif %}>10</a>
        </li>
        <li class="{% if user_annotations.paginator.per_page == 25 %}active{% endif %}">
          <a {% if user_annotations.paginator.per_page != 25 %}href="{% url 'user_annotations' profile_user.id %}?show={{image.obj.image_guid}}&page=1&perpage=25"{% endif %}>25</a>
        </li>
        <li class="{% if user_annotations.paginator.per_page == 100 %}active{% endif %}">
          <a {% if user_annotations.paginator.per_page != 100 %}href="{% url 'user_annotations' profile_user.id %}?show={{image.obj.image_guid}}&page=1&perpage=100"{% endif %}>100</a>
        </li>
      </ul>
      {% if user_annotations.has_previous or user_annotations.has_next %}
        <ul class="pagination pull-right">
          {% if user_annotations.has_previous %}
          <li>
            <a href="{% url 'user_annotations' profile_user.id %}?page={{user_annotations.previous_page_number}}" aria-label="Précédent">
              <span aria-hidden="true">&laquo;</span>
            </a>
          </li>
          {% endif %}
          {% for page in user_annotations.paginator.page_range %}
            <li id="page-link-{{page}}" class="pagination-link {% if page == user_annotations.number %}active{% endif %}">
              <a {% if page != user_annotations.number %}href="{% url 'user_annotations' profile_user.id %}?page={{page}}&perpage={{user_annotations.paginator.per_page}}"{% endif %}>{{page}}</a>
            </li>
          {% endfor %}
          {% if user_annotations.has_next %}
          <li>
            <a href="{% url 'user_annotations' profile_user.id %}?page={{user_annotations.next_page_number}}" aria-label="Suivant">
              <span aria-hidden="true">&raquo;</span>
            </a>
          </li>
          {% endif %}
        </ul>
      {% endif %}
    {% endif %}
  </div>
{% endblock %}
