{% extends "mashup_home.html" %}
{% load static %}
{% load i18n %}
{% load analytics %}
{% load thumbnail %}
{% load front_tags %}
    {% block title %}{% trans 'All source videos' %}{% 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 source videos' %}</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_contents' 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_contents' branding=branding %}?page={{i|add:'1'}}">{{i|add:'1'}}</a>
              {% endfor %}
            {% endif %}
            {% if results.has_next %}
                <a href="{% url 'mashup_all_contents' branding=branding %}?page={{ results.next_page_number }}">{% trans "Next" %}</a>
            {% endif %}
            {% if results.paginator.num_pages > 1 %}
                <a href="{% url 'mashup_all_contents' branding=branding %}?page=x">({% trans "All" %})</a>
            {% endif %}
            </p>
    </div>
    
    <div class="hashcut-video-wrap profil">
        {% for content in results.object_list %}
        <div class="video-item">
            <a href="{% url 'mashup_content' branding=branding ctt_id=content.iri_id %}" class="screenshot">{% thumbnail content.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_content' branding=branding ctt_id=content.iri_id %}">{% if content.title|length > 30 %}{{content.title|slice:":30"}}...{% else %}{{content.title}}{% endif %}</a> | <span class="duration">{{content.duration|str_duration:"h"}}</span></h3>
        </div>
        {% endfor %}
    </div>
</div><!-- content -->
{% endblock %}

