Added custom headers options for AnnotationsList and LatestAnnotation
authordurandn
Mon, 31 Aug 2015 12:22:14 +0200
changeset 87 4ea185b1b7ce
parent 86 a6ad1c4f7e70
child 88 a96af8e8f660
child 97 ccfe677e62a3
Added custom headers options for AnnotationsList and LatestAnnotation
server/src/remie/static/remie/metadataplayer/AnnotationsList.js
server/src/remie/static/remie/metadataplayer/LatestAnnotation.js
server/src/remie/templates/remie/iframe_segments_group.html
server/src/remie/templates/remie/iframe_segments_single.html
server/src/remie/templates/remie/iframe_teacher.html
server/src/remie/templates/remie/iframe_tester.html
--- a/server/src/remie/static/remie/metadataplayer/AnnotationsList.js	Fri Aug 28 18:08:21 2015 +0200
+++ b/server/src/remie/static/remie/metadataplayer/AnnotationsList.js	Mon Aug 31 12:22:14 2015 +0200
@@ -38,6 +38,7 @@
     show_audio : true,
     show_filters : false,
     show_header : false,
+    custom_header : false,
     show_creation_date : false,
     show_timecode : true,
     /*
@@ -74,18 +75,21 @@
         voice_annotation: "Voice Annotation",
         now_playing: "Now playing...",
         everyone: "Everyone",
-        header: "My contributions"
+        header: "Annotations for this content"
     },
     fr: {
         voice_annotation: "Annotation Vocale",
         now_playing: "Lecture en cours...",
         everyone: "Tous",
-        header: "Mes contributions"
+        header: "Annotations sur ce contenu"
     }
 };
 
 IriSP.Widgets.AnnotationsList.prototype.template =
-    "{{#show_header}}<p class='Ldt-AnnotationsList-header'>{{l10n.header}}</p>{{/show_header}}"
+    '{{#show_header}}<p class="Ldt-AnnotationsList-header">'
+    +     '{{#custom_header}}{{custom_header}}{{/custom_header}}'
+    +     '{{^custom_header}}{{l10n.header}}{{/custom_header}}'
+    + '</p>{{/show_header}}'
     + '<div class="Ldt-AnnotationsListWidget">'
     + '{{#show_filters}}'
     + '<div class="Ldt-AnnotationsList-Filters">'
--- a/server/src/remie/static/remie/metadataplayer/LatestAnnotation.js	Fri Aug 28 18:08:21 2015 +0200
+++ b/server/src/remie/static/remie/metadataplayer/LatestAnnotation.js	Mon Aug 31 12:22:14 2015 +0200
@@ -27,23 +27,29 @@
     empty_message: false,
     starts_hidden: false,
     show_header: false,
+    custom_header: false,
 };
 
 IriSP.Widgets.LatestAnnotation.prototype.messages = {
     fr : {
         copy_and_edit: "Copier et Editer",
         empty : "Aucune annotation à afficher",
-        header: "Ma dernière contribution"
+        header: "Dernière annotation"
     },
     en: {
         copy_and_edit: "Copy and Edit",
         empty: "No annotation to display",
-        header: "My last contribution"
+        header: "Last annotation"
     }
 }
 
 IriSP.Widgets.LatestAnnotation.prototype.template = 
-    "{{#show_header}}<p class='Ldt-LatestAnnotation-header'>{{l10n.header}}</p>{{/show_header}}"
+    "{{#show_header}}"
+    + "<p class='Ldt-LatestAnnotation-header'>"
+    +     "{{#custom_header}}{{custom_header}}{{/custom_header}}"
+    +     "{{^custom_header}}{{l10n.header}}{{/custom_header}}"
+    + "</p>"
+    + "{{/show_header}}"
     + "<div class='Ldt-LatestAnnotation'>"
     + "</div>";
 
--- a/server/src/remie/templates/remie/iframe_segments_group.html	Fri Aug 28 18:08:21 2015 +0200
+++ b/server/src/remie/templates/remie/iframe_segments_group.html	Mon Aug 31 12:22:14 2015 +0200
@@ -132,6 +132,7 @@
             show_timecode: false,
             show_filters: true,
             show_header: true,
+            custom_header: "Contributions",
             limit_count: false,
             start_visible: false,
             newest_first: true,
@@ -146,7 +147,8 @@
            	segments_annotation_type: "découpage",
            	selectable_annotations: true,
            	copy_and_edit_button: true,
-           	show_header: true
+           	show_header: true,
+           	custom_header: "Dernière contribution"
         },{
          	type: "CurrentSegmentInfobox",
          	annotation_type: "découpage",
--- a/server/src/remie/templates/remie/iframe_segments_single.html	Fri Aug 28 18:08:21 2015 +0200
+++ b/server/src/remie/templates/remie/iframe_segments_single.html	Mon Aug 31 12:22:14 2015 +0200
@@ -131,6 +131,7 @@
             show_timecode: false,
             show_filters: true,
             show_header: true,
+            custom_header: "Mes contributions",
             limit_count: false,
             start_visible: false,
             newest_first: true,
@@ -145,7 +146,8 @@
             segments_annotation_type: "découpage",
             selectable_annotations: true,
             copy_and_edit_button: true,
-            show_header: true
+            show_header: true,
+            custom_header: "Ma dernière contribution"
         },{
           type: "CurrentSegmentInfobox",
           annotation_type: "découpage",
--- a/server/src/remie/templates/remie/iframe_teacher.html	Fri Aug 28 18:08:21 2015 +0200
+++ b/server/src/remie/templates/remie/iframe_teacher.html	Mon Aug 31 12:22:14 2015 +0200
@@ -131,6 +131,7 @@
             show_timecode: false,
             show_filters: true,
             show_header: true,
+            custom_header: "Contribution",
             limit_count: false,
             start_visible: false,
             newest_first: true,
@@ -145,7 +146,8 @@
             segments_annotation_type: "découpage",
             selectable_annotations: true,
             copy_and_edit_button: true,
-            show_header: true
+            show_header: true,
+            custom_header: "Dernière contributions"
         },{
           type: "CurrentSegmentInfobox",
           annotation_type: "découpage",
--- a/server/src/remie/templates/remie/iframe_tester.html	Fri Aug 28 18:08:21 2015 +0200
+++ b/server/src/remie/templates/remie/iframe_tester.html	Mon Aug 31 12:22:14 2015 +0200
@@ -91,7 +91,7 @@
             + '}';
 	        $.ajax({
 	        	method: "POST",
-        	    url: '{% url "api_dispatch_list" resource_name="projects" api_name="1.0" %}?source='+_project_id,
+        	    url: '{% url "api_dispatch_list" resource_name="projects" api_name="1.0" %}?source='+_project_id+'&publish=true&username=admin&api_key=61a86341aaeabb66bbd2c424d5e2be6aa8a449d5',
                 contentType: 'application/cinelab',
         	    data: _data,
 	        	success: function(_data, _status, _request) {
@@ -118,7 +118,7 @@
   <br><input id="iframe_update_button" type="button" value="Générer"></input>
 </div>
 <div hidden="true">
-  <label>Id projet (copie via l'API): </label><input id="projecÒt_id_copy" type="text"></input>
+  <label>Id projet (copie via l'API): </label><input id="project_id_copy" type="text"></input>
   <br><label>Titre de la copie: </label><input id="title_copy" type="text"></input>
   <br><input id="copy_button" type="button" value="Copier"></input>
   <div id="success_copy"></div>