# HG changeset patch # User verrierj # Date 1326387385 -3600 # Node ID 123b89cf599e1511dff01160dd7eb309c65f378a # Parent 271e8d0e251b12313e2bfebccf1c0b66345f043a Search results are clickable diff -r 271e8d0e251b -r 123b89cf599e src/ldt/ldt/ldt_utils/projectserializer.py --- a/src/ldt/ldt/ldt_utils/projectserializer.py Thu Jan 12 16:25:13 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/projectserializer.py Thu Jan 12 17:56:25 2012 +0100 @@ -69,18 +69,17 @@ # sets cutting to display in first position for the metadataplayer if self.first_cutting: - first_cutting = "c_%s" % self.first_cutting.upper() annotation_types = new_display['annotation_types'] if len(annotation_types) > 1: index = -1 for i, s in enumerate(annotation_types): - if s == first_cutting: + if s == self.first_cutting: index = i break if index >= 0: annotation_types[0], annotation_types[index] = annotation_types[index], annotation_types[0] - + self.views_dict[display_id] = new_display @@ -165,7 +164,7 @@ element_begin = element_node.attrib[u"begin"] element_duration = element_node.attrib[u"dur"] element_media = content.iri_id - element_color = element_node.attrib[u"color"] + element_color = element_node.attrib.get(u"color", "") element_ldt_src = element_node.attrib.get(u"src", "") element_title = reduce_text_node(element_node, "title/text()") @@ -414,22 +413,9 @@ res['views'] = self.views_dict.values() if len(self.views_dict) > 0 else None res['annotation-types'] = self.annotation_types_dict.values() if len(self.annotation_types_dict) > 0 else None - res['annotations'] = self.annotations_dict.values() if len(self.annotations_dict) > 0 else None - - - if self.first_cutting: - first_cutting = "c_%s" % self.first_cutting.upper() - - index = -1 - for i, ann in enumerate(res['annotation-types']): - if ann['id'] == first_cutting: - index = i - break - - if index > 0: - res['annotation-types'][0], res['annotation-types'][1] = res['annotation-types'][1], res['annotation-types'][0] + res['annotations'] = self.annotations_dict.values() if len(self.annotations_dict) > 0 else None - return res + return res def get_annotations(self, first_cutting=True): diff -r 271e8d0e251b -r 123b89cf599e src/ldt/ldt/ldt_utils/templates/front/front_search_results.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_search_results.html Thu Jan 12 16:25:13 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_search_results.html Thu Jan 12 17:56:25 2012 +0100 @@ -21,8 +21,6 @@