{% extends "ldt/ldt_base.html" %}
{% load i18n %}

{% block js_import %}
    {{ block.super }}    
	<script type="text/javascript" src="{{LDT_MEDIA_PREFIX}}js/projectscontents.js" ></script>
{% endblock %}

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

{% block js_declaration %}
	{{ block.super }}

	<script type="text/javascript">   
	$(document).ready(function(){
		init_events_all(document, "/pf/ldtplatform/ldt/embedpopup", '', '', '', '');
	});    
    </script>
{% endblock %}


{% block content %}

<div class="span-24 last" id="allcontentsdiv">

{% if msg %}
{{ msg }}
{% else %}

	{% trans "Results for " %} <b> {{ search }}</b> :
	
	{% autoescape off %}
	<ul>
	{% for res in results.object_list %}
		<li>		
			<span title="{% trans 'open ldt' %}"><a class="ldt_link_open_ldt" href="{% url index_project res.project_id%}" >Project : {{res.project_title}} </a></span><br />
			Project description : {{ res.project_description }} <br />		
			<ul>
			{% for segment in res.list %}
				<li><span title="{% trans 'open ldt' %}"><a class="ldt_link_open_ldt" href="{% url ldt.ldt_utils.views.display_highlighted_seg segment.project_id segment.iri_id segment.ensemble_id segment.decoupage_id segment.element_id %}">{{ segment.segment_title }}</a></span><br />
				{{ segment.context }}<br />
				<br />
				</li>
			{% endfor %}
			</ul>	
		</li>
	{% endfor %}
	</ul>
	{% endautoescape %}


<div class="pagination">
    <span class="step-links">
        {% if results.has_previous %}
            <a href="{% url ldt.ldt_utils.views.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 href="{% url ldt.ldt_utils.views.search_listing %}?page={{ results.next_page_number }}">{% trans "next" %}</a>
        {% endif %}
    </span>
</div>

{% endif %}

{% endblock %}