Fix bug in search results front page
authorverrierj
Mon, 13 Feb 2012 12:12:04 +0100
changeset 562 28988fcccad1
parent 557 23b37fcab7bc
child 563 9beab46d99d3
Fix bug in search results front page
src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html
src/ldt/ldt/static/ldt/js/Ldt_front_search_results.js
--- a/src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html	Fri Feb 10 16:52:14 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/front/front_all_contents.html	Mon Feb 13 12:12:04 2012 +0100
@@ -56,7 +56,7 @@
             </div>
         </div>
         <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>
-        <p><a href="{% url ldt.ldt_utils.views.front.annot_content content.iri_id %}"><b>{% if content.title|length > 69 %}{{content.title|slice:":69"}}...{% else %}{{content.title}}{% endif %}</b></a></p>
+        <p><a href="{% url ldt.ldt_utils.views.front.annot_content 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>
         <p>{% trans 'by' %} IRI | {{content.duration|str_duration:"h"}}</p>
     </li>
     {% endfor %}
--- a/src/ldt/ldt/static/ldt/js/Ldt_front_search_results.js	Fri Feb 10 16:52:14 2012 +0100
+++ b/src/ldt/ldt/static/ldt/js/Ldt_front_search_results.js	Mon Feb 13 12:12:04 2012 +0100
@@ -65,15 +65,18 @@
             $("#result_preview")
                 .show()
                 .html($("#li_" + _id + " div.hidden_preview").html());
-            $("#result_preview .result_taglist")
-                .html(
-                    $("#result_preview .result_taglist").html()
-                        .split(";")
-                        .map(function(t) { return t.replace(/(^[\s]+|[\s]+$)/g,"") })
-                        .filter(function(t) { return t.length; })
-                        .map(function(t) { return '<span class="pink">' + t + '</span>'; })
-                        .join(', ')
-                    )
+            
+            var tags_html = $("#result_preview .result_taglist").html();
+            if (tags_html) {
+	            $("#result_preview .result_taglist")
+	                .html(
+	                    tags_html.split(";")
+	                        .map(function(t) { return t.replace(/(^[\s]+|[\s]+$)/g,"") })
+	                        .filter(function(t) { return t.length; })
+	                        .map(function(t) { return '<span class="pink">' + t + '</span>'; })
+	                        .join(', ')
+	                    )
+            }
         }).mouseout(function() {
             var _id = this.id.substr(3);
             $("#li_" + _id + " .color_zone").css({