enhance iframe embed parameters.
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html Wed Oct 03 16:00:23 2012 +0200
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/embed_player.html Thu Oct 04 12:17:09 2012 +0200
@@ -49,9 +49,16 @@
},
{
type: "Polemic"
- },{
+ {% if polemic == 'all' %}
+ ,annotation_type: false
+ {% endif %}
+ },
+ {% if polemic != 'all' %}
+ {
type: "Sparkline"
- },{
+ },
+ {% endif %}
+ {
type: "Slider"
},{
type: "AnnotationsList",
@@ -79,7 +86,7 @@
api_endpoint_template: "{% url annotation_api_empty %}{% templatetag openvariable %}id{% templatetag closevariable %}.json",
api_method: "PUT",
after_send_timeout: 8000,
- show_mic_record: false,
+ show_mic_record: {% if show_mic_record %}true{% else %}false{% endif %},
close_after_send: false,
slice_annotation_type: ["chap","découpage"],
tag_titles: ["#amateur", "#digital-humanities"],
--- a/src/ldt/ldt/ldt_utils/views/workspace.py Wed Oct 03 16:00:23 2012 +0200
+++ b/src/ldt/ldt/ldt_utils/views/workspace.py Thu Oct 04 12:17:09 2012 +0200
@@ -127,6 +127,13 @@
player_id = "player_project_" + project_id
ldt_id = project_id
rend_dict = get_datas_for_embed(request, json_url, player_id, ldt_id)
+
+ # Manage iframe options
+ if request.GET.has_key("polemic"):
+ 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())
+
return render_to_response("ldt/ldt_utils/embed_iframe.html", rend_dict, context_instance=RequestContext(request))
@@ -158,7 +165,9 @@
ps = ProjectSerializer(project, from_contents=True, from_display=True)
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}
+ 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}
return rend_dict