{% extends "front/front_base.html" %}
{% load i18n %}
{% load thumbnail %}
{% load str_duration %}

{% block title %}Lignes de temps : {% trans 'search' %} ""{% endblock %}

{% block css_import %}
{{block.super}}
<link rel="stylesheet" href="{{LDT_MEDIA_PREFIX}}css/front_search.css" type="text/css"/>
{% endblock %}

{% block body %}
{{block.super}}

{% if msg %}
{{ msg }}
{% else %}
  {% ifequal nb_results 0 %}
    {% blocktrans %} No results for <b>{{ search }}</b>.{% endblocktrans %}
  {% else %}
<!-- TABLE POUR ALIGNER À LA VERTICALE -->
    <table id="tbl_rech">
    <tr>
<!-- LISTE DES RÉSULTATS -->
        <td>
        <ul class="floatlist" id="liste_resultats">
    <!-- titre "Résultats de recherche" et options -->
            <li id="li_haut_resultats">
                <ul class="floatlist" id="ul_haut_resultats">
                    <li id="title_resultats">
                        <h2>{% trans "Search results for " %} <b> {{ search }}</b></h2>
                    </li>
                    <li>
                        <p id="p_nb_resultats">{{ nb_results }} {% trans "Result" %}{{ nb_results|pluralize }}</p>
                    </li>
                    <!--li id="resultats_options">options</li-->
                </ul>
            </li>
    <!-- Médias trouvés -->
    
        <!-- Média -->
        {% autoescape off %}
        {% for res in results.object_list %}
            <li class="li_result_media">
                <div class="titre_result_media">
                    <div class="h3_result_media">
                        <h3>{{res.content_title|capfirst}}</h3>
                    </div>
                    <div class="duree_result_media">
                        <p>{{res.content.duration}}</p>
                    </div>
                    <div class="graphe_result_media">
                        <img src="img/placeholder_media_graph.png" width="340" height="25" alt="graph de volume" />
                    </div>
                </div>
        
            <!-- Segments du média -->
                <ul class="floatlist list_segments">
                {% for segment in res.list %}
                    <li class="li_segment">
                        <div class="left_segment">
                            <div class="color_zone" style="background: #f49af5;"></div>
                            <a href="{% url ldt.ldt_utils.views.lignesdetemps.index_segment segment.project_id segment.iri_id segment.ensemble_id segment.decoupage_id segment.element_id %}"><img src="{{LDT_MEDIA_PREFIX}}img/annot_icon_80x45.png" width="80" height="45" /></a>
                            <p class="duree_segment">{{ segment.duration }}</p>
                        </div>
                        <h4 class="title_segment"><a class="blue under" href="{% url ldt.ldt_utils.views.lignesdetemps.index_segment segment.project_id segment.iri_id segment.ensemble_id segment.decoupage_id segment.element_id %}">
                          {% if segment.title %}{{ segment.title }}{% else %}{% trans "No title" %}{% endif %}</a></h4>
                        <p class="text_segment">{% if segment.context %}{{ segment.context }}{% endif %}<br/>begin : {{ segment.begin|str_duration:"::" }} - dur : {{ segment.duration|str_duration:"::" }}</h4>
                    </li>
	                <!--li class="segmentinfos" ><span  class="" title="{% trans 'open ldt' %}"><a class="ldt_link_open_ldt" href="{% url ldt.ldt_utils.views.lignesdetemps.index_segment segment.project_id segment.iri_id segment.ensemble_id segment.decoupage_id segment.element_id %}"-->
	                </li>
                {% endfor %}
                </ul>
            </li>
      {% endfor %}
      {% endautoescape %}
      <!-- Fin des médias -->
      <!-- Pagination -->
        <li id="result_pagination">
            <p>
            {% if results.has_previous %}
	            <a class="blue under" href="{% url ldt.ldt_utils.views.front.search_listing %}?page={{ results.previous_page_number }}">{% trans "previous" %}</a>
	        {% endif %}
	        
	        {% if results.paginator.num_pages > 1 %}
	        <span class="current">
	           {% blocktrans with number=results.number num_pages=results.paginator.num_pages%}Page {{number}} of {{num_pages}}{% endblocktrans %}
	        </span>
	        {% endif %}
	
	        {% if results.has_next %}
	            <a class="blue under" href="{% url ldt.ldt_utils.views.front.search_listing %}?page={{ results.next_page_number }}">{% trans "next" %}</a>
	        {% endif %}
            </p>
        </li>
      <!-- Fin Pagination -->
      </ul>
    

<!-- Right column -->
<!-- APERÇU DU RÉSULTAT -->
    <td id="result_preview">
        <h4>ICI PREVIEW ?</h4>
        <p class="bigmargin">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem …</p>
    </td>
  </tr>
</table>

  {% endifequal %}
{% endif %}

{% endblock %}

