# HG changeset patch # User cavaliet # Date 1349359350 -7200 # Node ID ca8127a4cdd5ff3d3d62021a59d413c04c136358 # Parent f1a218ea85c3c5b54e51193b85d1ec80cf810fa2 add iframe annotation list feature. diff -r f1a218ea85c3 -r ca8127a4cdd5 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html Thu Oct 04 12:17:41 2012 +0200 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html Thu Oct 04 16:02:30 2012 +0200 @@ -12,12 +12,14 @@ Ligne de Temps - IRI - Metadata Player - -
+
{% include "ldt/ldt_utils/partial/embed_player.html" %} -
-{% analytics %} +
+ {% if annotations_list %} +
+ {% endif %} +{% analytics %} diff -r f1a218ea85c3 -r ca8127a4cdd5 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html Thu Oct 04 12:17:41 2012 +0200 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html Thu Oct 04 16:02:30 2012 +0200 @@ -63,7 +63,7 @@ },{ type: "AnnotationsList", container: "AnnotationsList_ext", - ajax_url: "{% url segment_api_empty %}{% templatetag openvariable %}media{% templatetag closevariable %}/{% templatetag openvariable %}begin{% templatetag closevariable %}/{% templatetag openvariable %}end{% templatetag closevariable %}", + ajax_url: "{{WEB_URL}}{% url segment_api_empty %}{% templatetag openvariable %}media{% templatetag closevariable %}/{% templatetag openvariable %}begin{% templatetag closevariable %}/{% templatetag openvariable %}end{% templatetag closevariable %}", ajax_granularity : 300000, default_thumbnail : "{{WEB_URL}}{{LDT_MEDIA_PREFIX}}css/imgs/video_sequence.png", show_audio: true, @@ -83,7 +83,7 @@ hide_timeout: 5000 },{ type: "CreateAnnotation", - api_endpoint_template: "{% url annotation_api_empty %}{% templatetag openvariable %}id{% templatetag closevariable %}.json", + api_endpoint_template: "{{WEB_URL}}{% url annotation_api_empty %}{% templatetag openvariable %}id{% templatetag closevariable %}.json", api_method: "PUT", after_send_timeout: 8000, show_mic_record: {% if show_mic_record %}true{% else %}false{% endif %}, diff -r f1a218ea85c3 -r ca8127a4cdd5 src/ldt/ldt/ldt_utils/views/workspace.py --- a/src/ldt/ldt/ldt_utils/views/workspace.py Thu Oct 04 12:17:41 2012 +0200 +++ b/src/ldt/ldt/ldt_utils/views/workspace.py Thu Oct 04 16:02:30 2012 +0200 @@ -117,11 +117,14 @@ project_id = request.GET.get("project_id") if not project_id: content_id = request.GET.get("content_id") - content = Content.safe_objects.get(iri_id=content_id) + try: + content = Content.safe_objects.get(iri_id=content_id) + except: + return HttpResponseForbidden(_("The content does not exists or you are not allowed to access this content")) project = content.get_or_create_front_project() project_id = project.ldt_id if not project_id : - return HttpResponse(_("Parameters project_id or content_id must be given in the url")) + return HttpResponseForbidden(_("Parameters project_id or content_id must be given in the url")) json_url = reverse("projectjson_id", args=[project_id]) player_id = "player_project_" + project_id @@ -133,6 +136,9 @@ rend_dict["polemic"] = request.GET.get("polemic") if request.GET.has_key("show_mic_record"): rend_dict["show_mic_record"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("show_mic_record").lower()) + if request.GET.has_key("annotations_list"): + rend_dict["annotations_list"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("annotations_list").lower()) + rend_dict["player_width"] = 550 return render_to_response("ldt/ldt_utils/embed_iframe.html", rend_dict, context_instance=RequestContext(request)) @@ -167,7 +173,7 @@ annotations = ps.get_annotations(first_cutting=True) rend_dict = {'json_url':json_url, 'player_id':player_id, 'annotations':annotations, 'ldt_id': ldt_id, 'stream_mode': stream_mode, 'player_width': player_width, 'player_height': player_height, 'external_url': external_url, - 'polemic':False, 'show_mic_record':False} + 'polemic':False, 'show_mic_record':False, 'annotations_list':False} return rend_dict