v1.53.6 enable remove polemics in create annotation widget V01.53.06
authorcavaliet
Thu, 15 May 2014 12:23:07 +0200
changeset 1311 dd59210a449e
parent 1310 080f62544792
child 1312 e5af066c4a01
v1.53.6 enable remove polemics in create annotation widget
src/ldt/ldt/__init__.py
src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html
src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html
src/ldt/ldt/ldt_utils/views/workspace.py
src/ldt/ldt/static/ldt/js/embed_popup.js
--- a/src/ldt/ldt/__init__.py	Wed Apr 30 12:32:19 2014 +0200
+++ b/src/ldt/ldt/__init__.py	Thu May 15 12:23:07 2014 +0200
@@ -1,6 +1,6 @@
 __all__ = ["VERSION", "get_version", "__version__"]
 
-VERSION = (1, 53, 5, "final", 0)
+VERSION = (1, 53, 6, "final", 0)
 
 
 def get_version():
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html	Wed Apr 30 12:32:19 2014 +0200
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_iframe.html	Thu May 15 12:23:07 2014 +0200
@@ -163,7 +163,6 @@
 			            hide_timeout: 5000
 			        }
 			        {% endif %}
-			        
 			        {% if createannotation %},{
 			            type: "CreateAnnotation",
 			            api_endpoint_template: "{% absurl 'api_dispatch_list' resource_name='annotations' api_name='1.0' %}",
@@ -177,7 +176,8 @@
 			            close_after_send: false,
 			            slice_annotation_type: ["chap","découpage"],
 			            creator_name: '{{request.user.username}}',
-			            creator_avatar: '{% thumbnail request.user.image "48x48" format="PNG" crop="center" as im %}{{WEB_URL}}{{ im.url }}{% endthumbnail %}' || "https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png"
+			            creator_avatar: '{% thumbnail request.user.image "48x48" format="PNG" crop="center" as im %}{{WEB_URL}}{{ im.url }}{% endthumbnail %}' || "https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png",
+			            {% if not createannotation_polemics %}polemics: []{% endif %}
 			        }{% endif %}
 			        {% if slideshare %},{
 			            type: "Slideshare",
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html	Wed Apr 30 12:32:19 2014 +0200
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html	Thu May 15 12:23:07 2014 +0200
@@ -137,7 +137,10 @@
 										 <input type="radio" name="annotation_tag" id="set_tags">
 										 	<span class="infostooltip title" data-title="{%trans 'Set your own tags : ' %}" data-desc="{% trans 'Write your tags separeted by a comma' %}">{%trans 'Set your own tags : ' %}</span>
 										 	<input type="text" id="tag_list" class="tags_area" onChange="put_new_code()"></input>
-										 </input>
+										 </input><br>
+										 <input type="checkbox" id="createannotation_polemics_checkbox" value="{% trans '4 polemics buttons' %} ++/--/??/==" onClick="put_new_code()" > 
+                                            <span class="infostooltip title" data-title="{% trans '4 polemics buttons' %} ++/--/??/==" data-desc="{% trans 'Displays or removes the 4 polemics buttons' %} ++/--/??/==">{% trans '4 polemics buttons' %} ++/--/??/==</span>    
+                                         </input>
 									</div>
 								</div>
 								<input type="checkbox" id="segments_checkbox" value="segments" onClick="put_new_code()" >
--- a/src/ldt/ldt/ldt_utils/views/workspace.py	Wed Apr 30 12:32:19 2014 +0200
+++ b/src/ldt/ldt/ldt_utils/views/workspace.py	Thu May 15 12:23:07 2014 +0200
@@ -180,6 +180,9 @@
         rend_dict["show_mic_record"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("show_mic_record").lower())
         if rend_dict["show_mic_record"]:
             rend_dict["createannotation"]=True
+    rend_dict["createannotation_polemics"] = True
+    if request.GET.has_key("createannotation_polemics"):
+        rend_dict["createannotation_polemics"] = {'true': True, 'false': False, "0": False, "1": True}.get(request.GET.get("createannotation_polemics").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
--- a/src/ldt/ldt/static/ldt/js/embed_popup.js	Wed Apr 30 12:32:19 2014 +0200
+++ b/src/ldt/ldt/static/ldt/js/embed_popup.js	Thu May 15 12:23:07 2014 +0200
@@ -630,6 +630,7 @@
 	var polemic_val=document.getElementById('polemic_checkbox');
 	var sparkline_val=document.getElementById('sparkline_checkbox');
 	var tagcloud_val=document.getElementById('tagcloud_checkbox');
+    var createannotation_polemics_val=document.getElementById('createannotation_polemics_checkbox');
 	iframeUrl= iframe_url;
 	
 	if($j("#player_height").val()!=300)
@@ -647,6 +648,9 @@
 		if(set_tags_val.checked){
 			iframeUrl+="&tag_titles="+$j("#tag_list").val();
 		}
+        if(!createannotation_polemics_val.checked){
+            iframeUrl+="&createannotation_polemics=False";
+        }
 	}
 	if (polemic_val.checked){
 		tweet_type=document.getElementById("tweet_polemic");