{% extends "iri_mashup_home.html" %}
{% load static %}
{% load i18n %}
{% load analytics %}
{% load thumbnail %}
{% load front_tags %}
    {% block title %}Tous les Hashcuts{% endblock %}
    {% block css_page %}
    <link rel="stylesheet" href="{% static 'hashcut/iri/css/profil.css' %}" />
    {% endblock %}

{% block wrap_header %}
<div class="wrap-header"> 
    <div class="header">
    {% include 'partial/iri_mashup_popin_user.html' %}
    {% include 'partial/iri_hashcut_logo.html' %}
        <div class="title-header"></div>
        <div class="profil-wrap">
            <ul>
                <li><a href="{% url mashup_home branding=branding %}" class="all-hashcut">Accueil</a></li>
                <li><a href="{% url mashup_edit branding=branding %}" class="new-hashcut">Créer un Hashcut</a></li>
                <li><a href="#user" class="my-profil open-popin">Mon profil</a></li>
            </ul>
        </div>
    </div><!-- header -->
</div> <!-- wrap-header -->
{% endblock %}

{% block content %}
<div class="content">
    <h2 class="title-content">Tous les Hashcuts</h2>
    
    <div class="pagination">
            {% if results.has_previous %}
                <a href="{% url mashup_all branding=branding %}?page={{ results.previous_page_number }}" >Précédent</a>
            {% endif %}
            {% if results.paginator.num_pages > 1 %}
              {% for i in results.paginator.num_pages|get_range %}
                 <a {% if i|add:'1' == results.number %} class="active"{% endif %} href="{% url mashup_all branding=branding %}?page={{i|add:'1'}}">{{i|add:'1'}}</a>
              {% endfor %}
            {% endif %}
            {% if results.has_next %}
                <a href="{% url mashup_all branding=branding %}?page={{ results.next_page_number }}">Suivant</a>
            {% endif %}
            {% if results.paginator.num_pages > 1 %}
                <a href="{% url mashup_all branding=branding %}?page=x">(Tous)</a>
            {% endif %}
            </p>
    </div>
    
    <div class="hashcut-video-wrap profil">
        {% for m in results.object_list %}
        <div class="video-item">
            <a href="{% url mashup_hashcut branding=branding ldt_id=m.project.ldt_id %}" class="screenshot">{% thumbnail m.project.image "302x202" crop="center" format="PNG" as im %}<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" alt=""/>{% empty %}&nbsp;{% endthumbnail %}</a>
            <h3><a class="title" href="{% url mashup_hashcut branding=branding ldt_id=m.project.ldt_id %}">{% if m.project.title|length > 30 %}{{m.project.title|slice:":30"}}...{% else %}{{m.project.title}}{% endif %}</a> par {{ m.creator }} | <span class="duration">02:24</span> </h3>
        </div>
        {% endfor %}
    </div>
</div><!-- content -->
{% endblock %}

