{% extends "mashup_home.html" %}
{% load static %}
{% load i18n %}
{% load analytics %}
{% load thumbnail %}
{% load front_tags %}
    {% block title %}{% trans 'All Hashcuts' %}{% endblock %}
    {% block css_page %}
    <link rel="stylesheet" href="{% static 'hashcut' %}/{{branding}}/css/profil.css" />
    {% endblock %}

{% block wrap_header %}
<div class="wrap-header"> 
    <div class="header">
    {% include 'partial/mashup_popin_user.html' %}
    {% include 'partial/hashcut_logo.html' %}
        <div class="title-video-wrap">
            <p class="title-video" href="#">{% trans 'All Hashcuts' %}</p>
        </div>
        <div class="profil-wrap">
            <ul>
                <li><a href="{% url 'mashup_home' branding=branding %}" class="all-hashcut">{% trans "Home" %}</a></li>
                <li><a href="{% url 'mashup_edit' branding=branding %}" class="new-hashcut">{% trans "New hashcut" %}</a></li>
                <li><a href="#user" class="my-profil open-popin">{% trans "My profile" %}</a></li>
            </ul>
        </div>
    </div><!-- header -->
</div> <!-- wrap-header -->
{% endblock %}

{% block content %}
<div class="content">
    
    <div class="pagination">
            {% if results.has_previous %}
                <a href="{% url 'mashup_all' branding=branding %}?page={{ results.previous_page_number }}" >{% trans "Previous" %}</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 }}">{% trans "Next" %}</a>
            {% endif %}
            {% if results.paginator.num_pages > 1 %}
                <a href="{% url 'mashup_all' branding=branding %}?page=x">({% trans "All" %})</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 <a class="author" href="{% url 'mashup_profile' branding=branding username=m.creator %}">{{ m.creator }}</a><!-- | <span class="duration">02:24</span> --></h3>
        </div>
        {% endfor %}
    </div>
</div><!-- content -->
{% endblock %}

