{% extends "hp/base.html" %}
{% load i18n %}
{% load thumbnail %}
{% load staticfiles %}
{% load hp_tags %}

{% block title %}
{% trans "Hyperplateau : all videos" %}
{% endblock %}

{% block css_declaration %}
{{ block.super }}
<link rel="stylesheet" href="{% static "hp/css/videos.css" %}" type="text/css"/>
{% endblock %}


{% block body %}
{{block.super}}
<!-- all videos -->

<div class="main row">
    <h2>{% trans 'All videos' %}</h2>
    <div class="row">
    {% for content in results %}
        <div class="video">
            <p>
                <a href="{% url hp.views.show_video_details content.iri_id %}">
                    {% thumbnail content.image "320x240" format="PNG" crop="center" as im %}<img src="{{ im.url }}" class="img_media" width="{{ im.width }}" height="{{ im.height }}" alt="{% trans 'open this media' %}" title="{% trans 'open this media' %}">{% endthumbnail %}
                </a>
            </p>
            <h3>
                <a href="{% url hp.views.show_video_details content.iri_id %}" title="{% trans 'open this media' %}" >{% if content.title|length > 69 %}{{content.title|slice:":69"}}...{% else %}{{content.title}}{% endif %}</a>
            </h3>
            <p>
                {% trans 'Duration:' %}
                <span class="video-duration">{{content.duration|str_duration:"h"}}</span>
            </p>
        </div>
        {% if forloop.counter|divisibleby:3 %}
    </div><div class="row">
        {% endif %}
    {% endfor %}
    </div>
    {% if results.has_other_pages %}
    <div class="pagination">
        <span class="step-links">
        {% if results.has_previous %}
            <a href="{% url hp.views.all_videos %}><<</a> <a href="{% url hp.views.all_videos %}?page={{ results.previous_page_number }}"><</a>
        {% else %}
            {{"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"|safe}}
        {% endif %}
        <span class="current">
            {{ results.number }}/{{ results.paginator.num_pages }}
        </span>
        {% if results.has_next %}
            <a href="{% url hp.views.all_videos %}?page={{ results.next_page_number }}">></a> <a href="{% url hp.views.all_videos %}?page=last">>></a>
        {% else %}
            {{"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"|safe}}
        {% endif %}
        </span>
    </div>
    {% endif %}
</div>
{% endblock %}
