| author | cavaliet |
| Fri, 03 Jan 2014 11:55:31 +0100 | |
| changeset 1278 | 9431920e7c98 |
| parent 1187 | 73403060f297 |
| child 1371 | 17b7a6d9959d |
| permissions | -rwxr-xr-x |
| 348 | 1 |
{% extends "front/front_base.html" %} |
2 |
{% load i18n %} |
|
3 |
{% load thumbnail %} |
|
|
1187
73403060f297
remove absstatic and goes back to static
ymh <ymh.work@gmail.com>
parents:
1021
diff
changeset
|
4 |
{% load static %} |
|
353
bf08750b894c
Update search and front search template. Add tag filter for duration presentation.
cavaliet
parents:
349
diff
changeset
|
5 |
{% load front_tags %} |
| 348 | 6 |
|
| 404 | 7 |
{% block title %}Lignes de temps : {% trans 'search' %} "{{search}}" {% endblock %} |
| 348 | 8 |
|
| 355 | 9 |
{% block js_import %} |
10 |
{{block.super}} |
|
|
1187
73403060f297
remove absstatic and goes back to static
ymh <ymh.work@gmail.com>
parents:
1021
diff
changeset
|
11 |
<script src='{% static "ldt/js/raphael.js" %}' type="text/javascript"/></script> |
| 355 | 12 |
{% endblock %} |
13 |
||
| 348 | 14 |
{% block css_import %} |
15 |
{{block.super}} |
|
|
1187
73403060f297
remove absstatic and goes back to static
ymh <ymh.work@gmail.com>
parents:
1021
diff
changeset
|
16 |
<link rel="stylesheet" href='{% static "ldt/css/front_search.css" %}' type="text/css"/> |
| 348 | 17 |
{% endblock %} |
18 |
||
| 520 | 19 |
{% block js_declaration %} |
| 348 | 20 |
{{block.super}} |
| 355 | 21 |
<script type="text/javascript"> |
| 371 | 22 |
var _medias = [ {% for res in results.object_list %} |
23 |
{ |
|
24 |
"iri_id" : '{{ res.content.iri_id }}', |
|
25 |
"duration" : {{ res.content.duration }}, |
|
26 |
"segments" : [ {% for segment in res.list %} |
|
27 |
{ |
|
28 |
"id" : '{{segment.element_id}}', |
|
|
495
1c50afe6a949
Search results with the same segment.element_id are displayed correctly
verrierj
parents:
488
diff
changeset
|
29 |
"project_id": '{{segment.project_id}}', |
|
1c50afe6a949
Search results with the same segment.element_id are displayed correctly
verrierj
parents:
488
diff
changeset
|
30 |
"ensemble_id": '{{segment.ensemble_id}}', |
|
1c50afe6a949
Search results with the same segment.element_id are displayed correctly
verrierj
parents:
488
diff
changeset
|
31 |
"cutting_id": '{{segment.cutting_id}}', |
|
1c50afe6a949
Search results with the same segment.element_id are displayed correctly
verrierj
parents:
488
diff
changeset
|
32 |
"iri_id": '{{segment.iri_id}}', |
|
452
8e9494006e7b
segment abstracts + content images can be retrieved directly from search results page
verrierj
parents:
446
diff
changeset
|
33 |
"begin" : {{segment.start_ts}}, |
| 371 | 34 |
"duration" : {{segment.duration}}, |
35 |
},{% endfor %} |
|
36 |
], |
|
| 468 | 37 |
"stats" : {{ res.content.annotation_volume }}, |
| 371 | 38 |
},{% endfor %} |
39 |
]; |
|
|
443
ef326411c1fe
Prepare url, front.py, js and template to load annotation preview.
cavaliet
parents:
440
diff
changeset
|
40 |
|
|
ef326411c1fe
Prepare url, front.py, js and template to load annotation preview.
cavaliet
parents:
440
diff
changeset
|
41 |
var global_csrf_token = "{{ csrf_token }}"; |
| 446 | 42 |
|
|
363
7872b0e9ebc9
update front search template to add annotation graph.
cavaliet
parents:
355
diff
changeset
|
43 |
</script> |
|
1187
73403060f297
remove absstatic and goes back to static
ymh <ymh.work@gmail.com>
parents:
1021
diff
changeset
|
44 |
<script src='{% static "ldt/js/Ldt_front_search_results.js" %}' type="text/javascript"></script> |
| 520 | 45 |
{% endblock %} |
46 |
||
47 |
{% block body %} |
|
48 |
{{block.super}} |
|
| 355 | 49 |
|
| 348 | 50 |
{% if msg %} |
51 |
{{ msg }} |
|
52 |
{% else %} |
|
53 |
{% ifequal nb_results 0 %} |
|
| 599 | 54 |
{% if tag_label %} |
55 |
{% blocktrans %} No results for <b>{{ search }}</b> with the medias tagged <span class="pink">{{tag_label}}</span>{% endblocktrans %} |
|
|
1187
73403060f297
remove absstatic and goes back to static
ymh <ymh.work@gmail.com>
parents:
1021
diff
changeset
|
56 |
<br/><a href="{% url 'ldt.ldt_utils.views.front.search_index' %}?search={{search}}&field={{field}}">{% trans "See for all medias" %}</a> |
| 599 | 57 |
{% else %} |
58 |
{% blocktrans %} No results for <b>{{ search }}</b>.{% endblocktrans %} |
|
59 |
{% endif %} |
|
| 348 | 60 |
{% else %} |
| 1278 | 61 |
{% if content_results %} |
62 |
<ul id="search_contents" class="floatlist full_width"> |
|
63 |
<li class="li_h2"><h2>{% trans "Results in medias for" %} <b>{{ search }}</b>{% if more_contents %} <a href="{% url 'ldt.ldt_utils.views.front.all_contents' %}?title={{ search }}" class="pink">({% trans "See all medias" %})</a>{% endif %}</h2></li> |
|
64 |
{% for content in content_results %} |
|
65 |
<li class="li_media"> |
|
66 |
<div class="img_and_overlay"> |
|
67 |
<a href="{% url 'ldt.ldt_utils.views.front.annot_content' content_iri_id=content.iri_id %}"> |
|
68 |
{% thumbnail content.image "134x75" 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> |
|
69 |
<div class="overlay"> |
|
70 |
<ul class="polemics"> |
|
71 |
<li class="pol-negative" style="width:{{content.pol_negative_rate}}%"><span>{{content.pol_negative_rate}}%</span></li> |
|
72 |
<li class="pol-positive" style="width:{{content.pol_positive_rate}}%"><span>{{content.pol_positive_rate}}%</span></li> |
|
73 |
</ul> |
|
74 |
</div> |
|
75 |
</div> |
|
76 |
<div class="bulle_annot" title="{% blocktrans count nb=content.nb_annotations %}{{nb}} annotation on this media{% plural %}{{nb}} annotations on this media{% endblocktrans %}">{{ content.nb_annotations }}</div> |
|
77 |
<p><a href="{% url 'ldt.ldt_utils.views.front.annot_content' content_iri_id=content.iri_id %}" title="{% trans 'open this media' %}"><b>{% if content.title|length > 69 %}{{content.title|slice:":69"}}...{% else %}{{content.title}}{% endif %}</b></a></p> |
|
78 |
<p class="font_11">{% trans 'by' %} IRI | {{content.duration|str_duration:"h"}}</p> |
|
79 |
</li> |
|
80 |
{% endfor %} |
|
81 |
</ul> |
|
82 |
{% endif %} |
|
| 348 | 83 |
<!-- TABLE POUR ALIGNER À LA VERTICALE --> |
84 |
<table id="tbl_rech"> |
|
85 |
<tr> |
|
86 |
<!-- LISTE DES RÉSULTATS --> |
|
87 |
<td> |
|
88 |
<ul class="floatlist" id="liste_resultats"> |
|
89 |
<!-- titre "Résultats de recherche" et options --> |
|
90 |
<li id="li_haut_resultats"> |
|
91 |
<ul class="floatlist" id="ul_haut_resultats"> |
|
92 |
<li id="title_resultats"> |
|
| 599 | 93 |
<h2> |
94 |
{% if tag_label %} |
|
| 1278 | 95 |
<a href="{% url 'ldt.ldt_utils.views.front.search_index' %}?search={{search}}&field={{field}}">{% trans "Results in annotations for" %} <b>{{ search }}</b></a><span class="pink"> > {{tag_label}}</span> |
| 599 | 96 |
{% else %} |
| 1278 | 97 |
{% trans "Results in annotations for" %} <b>{{ search }}</b> |
| 599 | 98 |
{% endif %} |
99 |
</h2> |
|
| 348 | 100 |
</li> |
| 429 | 101 |
<li id="li_nb_resultats"> |
| 348 | 102 |
<p id="p_nb_resultats">{{ nb_results }} {% trans "Result" %}{{ nb_results|pluralize }}</p> |
| 1021 | 103 |
<p id="p_nb_segments">{{ nb_segment }} {% trans "Segment" %}{{ nb_segment|pluralize }}</p> |
| 348 | 104 |
</li> |
105 |
<!--li id="resultats_options">options</li--> |
|
106 |
</ul> |
|
107 |
</li> |
|
108 |
<!-- Médias trouvés --> |
|
109 |
||
110 |
<!-- Média --> |
|
111 |
{% autoescape off %} |
|
112 |
{% for res in results.object_list %} |
|
113 |
<li class="li_result_media"> |
|
114 |
<div class="titre_result_media"> |
|
115 |
<div class="h3_result_media"> |
|
| 577 | 116 |
<h3>{{res.content.title}}</h3> |
| 348 | 117 |
</div> |
118 |
<div class="duree_result_media"> |
|
|
452
8e9494006e7b
segment abstracts + content images can be retrieved directly from search results page
verrierj
parents:
446
diff
changeset
|
119 |
<p>{{res.content.duration|str_duration:"::" }}</p> |
| 348 | 120 |
</div> |
121 |
<div class="graphe_result_media"> |
|
| 424 | 122 |
<span id="{{ res.content.iri_id }}" class="graph_annotation" title="{% trans 'annotation distribution' %}"> |
| 355 | 123 |
</span> |
| 348 | 124 |
</div> |
|
452
8e9494006e7b
segment abstracts + content images can be retrieved directly from search results page
verrierj
parents:
446
diff
changeset
|
125 |
</div> |
| 348 | 126 |
|
127 |
<!-- Segments du média --> |
|
128 |
<ul class="floatlist list_segments"> |
|
129 |
{% for segment in res.list %} |
|
|
495
1c50afe6a949
Search results with the same segment.element_id are displayed correctly
verrierj
parents:
488
diff
changeset
|
130 |
<li class="li_segment" id="li_{{segment.project_id}}_{{segment.iri_id}}_{{segment.ensemble_id}}_{{segment.cutting_id}}_{{segment.element_id}}"> |
| 348 | 131 |
<div class="left_segment"> |
| 435 | 132 |
<div class="color_zone"></div> |
|
1187
73403060f297
remove absstatic and goes back to static
ymh <ymh.work@gmail.com>
parents:
1021
diff
changeset
|
133 |
<a href="{% url 'ldt.ldt_utils.views.front.annot_content' content_iri_id=segment.iri_id project_id=segment.project_id cutting_id=segment.cutting_id %}#id={{segment.element_id}}"><img src='{% static "ldt/img/annot_icon_80x45.png" %}' width="80" height="45" alt="" /></a> |
|
353
bf08750b894c
Update search and front search template. Add tag filter for duration presentation.
cavaliet
parents:
349
diff
changeset
|
134 |
<!--p class="duree_segment">{{ segment.duration|str_duration:"::" }}</p--> |
| 348 | 135 |
</div> |
|
1187
73403060f297
remove absstatic and goes back to static
ymh <ymh.work@gmail.com>
parents:
1021
diff
changeset
|
136 |
<h4 class="title_segment"><a class="blue under" href="{% url 'ldt.ldt_utils.views.front.annot_content' content_iri_id=segment.iri_id project_id=segment.project_id cutting_id=segment.cutting_id %}#id={{segment.element_id}}" title="{% trans 'view this annotation in the player' %}"> |
| 348 | 137 |
{% if segment.title %}{{ segment.title }}{% else %}{% trans "No title" %}{% endif %}</a></h4> |
| 454 | 138 |
<p class="text_segment">{% if segment.context %}{{ segment.context }}{% endif %}<br/>{% trans "Begin" %} : {{ segment.start_ts|str_duration:"::" }} - {% trans "duration" %} : {{ segment.duration|str_duration:"::" }}</p> |
139 |
<div class="hidden_preview"> |
|
140 |
{% thumbnail res.content.image "300x200" format="PNG" crop="center" as im %}<img src="{{ im.url }}" class="img_media" width="{{ im.width }}" height="{{ im.height }}" %}">{% endthumbnail %} |
|
|
1187
73403060f297
remove absstatic and goes back to static
ymh <ymh.work@gmail.com>
parents:
1021
diff
changeset
|
141 |
<h4><a class="pink under b" href="{% url 'ldt.ldt_utils.views.front.annot_content' content_iri_id=segment.iri_id project_id=segment.project_id cutting_id=segment.cutting_id %}#id={{segment.element_id}}" title="{% trans 'view this annotation in the player' %}"> |
| 454 | 142 |
{% if segment.title %}{{ segment.title }}{% else %}{% trans "No title" %}{% endif %}</a></h4> |
| 719 | 143 |
<p class="bigmargin">{% if segment.context %}{{ segment.context }}{% else %}{{ segment.abstract }}{% endif %}</p> |
144 |
{% if segment.context_tags or segment.tags %} |
|
|
488
403f92f24144
Bugfixes in search page + update settings metadataplayer
verrierj
parents:
468
diff
changeset
|
145 |
<h5>Tags:</h5> |
| 719 | 146 |
<p class="result_taglist b fl">{% if segment.context_tags %}{{ segment.context_tags }}{% else %}{{ segment.tags }}{% endif %}</p> |
|
488
403f92f24144
Bugfixes in search page + update settings metadataplayer
verrierj
parents:
468
diff
changeset
|
147 |
{% endif %} |
| 454 | 148 |
</div> |
| 348 | 149 |
</li> |
150 |
{% endfor %} |
|
151 |
</ul> |
|
152 |
</li> |
|
153 |
{% endfor %} |
|
154 |
{% endautoescape %} |
|
155 |
<!-- Fin des médias --> |
|
156 |
<!-- Pagination --> |
|
157 |
<li id="result_pagination"> |
|
158 |
<p> |
|
159 |
{% if results.has_previous %} |
|
|
1187
73403060f297
remove absstatic and goes back to static
ymh <ymh.work@gmail.com>
parents:
1021
diff
changeset
|
160 |
<a class="blue under" href="{% url 'ldt.ldt_utils.views.front.search_index' %}?page={{ results.previous_page_number }}&search={{search}}&field={{field}}{% if tag_label %}&content_tag={{tag_label}}{% endif %}" title="{% trans 'previous' %}">{% trans "previous" %}</a> |
|
353
bf08750b894c
Update search and front search template. Add tag filter for duration presentation.
cavaliet
parents:
349
diff
changeset
|
161 |
. |
| 348 | 162 |
{% endif %} |
163 |
{% if results.paginator.num_pages > 1 %} |
|
164 |
<span class="current"> |
|
|
353
bf08750b894c
Update search and front search template. Add tag filter for duration presentation.
cavaliet
parents:
349
diff
changeset
|
165 |
{% for i in results.paginator.num_pages|get_range %} |
|
bf08750b894c
Update search and front search template. Add tag filter for duration presentation.
cavaliet
parents:
349
diff
changeset
|
166 |
<span class="current"> |
|
bf08750b894c
Update search and front search template. Add tag filter for duration presentation.
cavaliet
parents:
349
diff
changeset
|
167 |
{% if i|add:'1' == results.number %} |
|
bf08750b894c
Update search and front search template. Add tag filter for duration presentation.
cavaliet
parents:
349
diff
changeset
|
168 |
<span class="pink">{{i|add:'1'}}</span> |
|
bf08750b894c
Update search and front search template. Add tag filter for duration presentation.
cavaliet
parents:
349
diff
changeset
|
169 |
{% else %} |
|
1187
73403060f297
remove absstatic and goes back to static
ymh <ymh.work@gmail.com>
parents:
1021
diff
changeset
|
170 |
<a class="blue under" href="{% url 'ldt.ldt_utils.views.front.search_index' %}?page={{i|add:'1'}}&search={{search}}&field={{field}}{% if tag_label %}&content_tag={{tag_label}}{% endif %}">{{i|add:'1'}}</a> |
|
353
bf08750b894c
Update search and front search template. Add tag filter for duration presentation.
cavaliet
parents:
349
diff
changeset
|
171 |
{% endif %} |
|
bf08750b894c
Update search and front search template. Add tag filter for duration presentation.
cavaliet
parents:
349
diff
changeset
|
172 |
{% if i|add:'1' < results.paginator.num_pages and 1 < results.paginator.num_pages %} |
|
bf08750b894c
Update search and front search template. Add tag filter for duration presentation.
cavaliet
parents:
349
diff
changeset
|
173 |
{% endif %} |
|
bf08750b894c
Update search and front search template. Add tag filter for duration presentation.
cavaliet
parents:
349
diff
changeset
|
174 |
</span> |
|
bf08750b894c
Update search and front search template. Add tag filter for duration presentation.
cavaliet
parents:
349
diff
changeset
|
175 |
{% endfor %} |
| 348 | 176 |
</span> |
177 |
{% endif %} |
|
178 |
{% if results.has_next %} |
|
|
452
8e9494006e7b
segment abstracts + content images can be retrieved directly from search results page
verrierj
parents:
446
diff
changeset
|
179 |
|
|
1187
73403060f297
remove absstatic and goes back to static
ymh <ymh.work@gmail.com>
parents:
1021
diff
changeset
|
180 |
<a class="blue under" href="{% url 'ldt.ldt_utils.views.front.search_index' %}?page={{ results.next_page_number }}&search={{search}}&field={{field}}{% if tag_label %}&content_tag={{tag_label}}{% endif %}" title="{% trans 'next' %}">{% trans "next" %}</a> |
| 348 | 181 |
{% endif %} |
182 |
</p> |
|
183 |
</li> |
|
184 |
<!-- Fin Pagination --> |
|
185 |
</ul> |
|
186 |
||
187 |
||
188 |
<!-- Right column --> |
|
189 |
<!-- APERÇU DU RÉSULTAT --> |
|
190 |
<td id="result_preview"> |
|
| 454 | 191 |
|
| 348 | 192 |
</td> |
193 |
</tr> |
|
194 |
</table> |
|
195 |
||
196 |
{% endifequal %} |
|
197 |
{% endif %} |
|
198 |
||
199 |
{% endblock %} |
|
200 |