v0.5.4 add play button for each chapter and annotation V00.05.04
authorcavaliet
Fri, 18 Apr 2014 12:22:22 +0200
changeset 74 ca3207a1c6e3
parent 73 4778ee1a122f
child 75 b75f68cc96ce
v0.5.4 add play button for each chapter and annotation
src/spel/__init__.py
src/spel/static/spel/css/spel.css
src/spel/static/spel/js/spectacle.js
src/spel/static/spel/metadataplayer/Polemic.js
src/spel/templates/partial/spel_annotations.html
src/spel/templates/partial/spel_chapters.html
src/spel/templates/spel_player.html
src/spel/templates/spel_theatre.html
src/spel/views.py
--- a/src/spel/__init__.py	Thu Apr 17 16:24:34 2014 +0200
+++ b/src/spel/__init__.py	Fri Apr 18 12:22:22 2014 +0200
@@ -1,4 +1,4 @@
-VERSION = (0, 5, 3, "final", 0)
+VERSION = (0, 5, 4, "final", 0)
 
 VERSION_STR = unicode(".".join(map(lambda i:"%02d" % (i,), VERSION[:2])))
 
--- a/src/spel/static/spel/css/spel.css	Thu Apr 17 16:24:34 2014 +0200
+++ b/src/spel/static/spel/css/spel.css	Fri Apr 18 12:22:22 2014 +0200
@@ -84,7 +84,7 @@
 	white-space: normal;
 }
 th.popinfo{
-	min-width: 45px;
+	min-width: 60px;
 }
 span.popinfo{
     cursor: pointer;
@@ -101,4 +101,7 @@
 #AnnotationsListContainer {
     float: left;
     margin: 10px 0;
+}
+.play-button{
+	color: #333;
 }
\ No newline at end of file
--- a/src/spel/static/spel/js/spectacle.js	Thu Apr 17 16:24:34 2014 +0200
+++ b/src/spel/static/spel/js/spectacle.js	Fri Apr 18 12:22:22 2014 +0200
@@ -438,11 +438,11 @@
 	$(".toggle-text").click(function(e){
 		if($(".theatre-text:visible").length==0){
 			$(".theatre-text").show();
-			$(".toggle-text .glyphicon-play").addClass("rotate-90");
+			$(".toggle-text .glyphicon-chevron-right").addClass("rotate-90");
 		}
 		else{
 			$(".theatre-text").hide();
-			$(".toggle-text .glyphicon-play").removeClass("rotate-90");
+			$(".toggle-text .glyphicon-chevron-right").removeClass("rotate-90");
 		}
 	});
 });
--- a/src/spel/static/spel/metadataplayer/Polemic.js	Thu Apr 17 16:24:34 2014 +0200
+++ b/src/spel/static/spel/metadataplayer/Polemic.js	Fri Apr 18 12:22:22 2014 +0200
@@ -107,7 +107,7 @@
             this.height = (2 + _max) * this.element_height;
             this.$zone.css({
                 width: this.width + "px",
-                height: this.height + "px",
+                height: (this.height+2) + "px",
                 position: "relative"
             });
             
@@ -232,7 +232,7 @@
         this.height = (2 + this.max_elements) * this.element_height;
         this.$zone.css({
             width: this.width + "px",
-            height: this.height + "px",
+            height: (this.height+2) + "px",
             position: "relative"
         });
         
--- a/src/spel/templates/partial/spel_annotations.html	Thu Apr 17 16:24:34 2014 +0200
+++ b/src/spel/templates/partial/spel_annotations.html	Fri Apr 18 12:22:22 2014 +0200
@@ -22,7 +22,9 @@
   {% for s in res.list %}
   {% with s.tags|get_tags:"type_inter" as tag_list %}
 <div class="searched-annot" data-type-inter="{{ tag_list|join:', ' }}" data-start="{{ s.start_ts }}" data-content="{{ s.iri_id }}">
-<p>{{ res.content.title }} / {{ s.start_ts|str_duration }} - {{ s.start_ts|add:s.duration|str_duration }} / {{ s.cutting_id }}</p>
+<p><a class="play-button" href="{% url 'spel_player' %}?g={{ s.iri_id }}&d=theatre&f=original_web.mp4#id={{ s.element_id }}" target="_blank"><span class="glyphicon glyphicon-play"></span></a>
+  {{ res.content.title }} / {{ s.start_ts|str_duration }} - {{ s.start_ts|add:s.duration|str_duration }} / {{ s.cutting_id }}
+</p>
 <p class="small">{{ s.tags|get_tags:"modscen_and_perso"|join:', ' }}</p>
 <hr/>
 <p>{{ s.tags|get_tags:"ref_text"|join:', ' }}</p>
--- a/src/spel/templates/partial/spel_chapters.html	Thu Apr 17 16:24:34 2014 +0200
+++ b/src/spel/templates/partial/spel_chapters.html	Fri Apr 18 12:22:22 2014 +0200
@@ -31,10 +31,13 @@
     <tbody>
   {% for s in segments %}
     <tr class="chapter-data" data-content="{{ s.iri_id }}" data-start="{{ s.start_ts }}" data-end="{{ s.start_ts|add:s.duration }}">
-        <td title="{{ s.cutting_id }}">{{ s.cutting_id|slice:":1"|upper }}</td><td>{{ s.tags|get_tags:"ref_text"|join:', ' }}</td><td>{% if annot_chapters %}{{ s.ct }}{% else %}{{ s.content.title }}{% endif %}</td>
+        <td title="{{ s.cutting_id }}">{{ s.cutting_id|slice:":1"|upper }}</td>
+        <td>{{ s.tags|get_tags:"ref_text"|join:', ' }}</td>
+        <td>{% if annot_chapters %}{{ s.ct }}{% else %}{{ s.content.title }}{% endif %}</td>
         <td>
           <span class="glyphicon glyphicon-info-sign popinfo" data-trigger="hover" data-container="body" data-toggle="popover" data-placement="auto" 
                   data-content="<strong>Timecodes:</strong> {{ s.start_ts|str_duration }} - {{ s.start_ts|add:s.duration|str_duration }}<br/>{{ s.tags|get_tags:'group'|safe }}"></span>
+          <a class="play-button" href="{% url 'spel_player' %}?g={{ s.iri_id }}&d=theatre&f=original_web.mp4#id={{ s.element_id }}" target="_blank"><span class="glyphicon glyphicon-play"></span></a>
           <input type="checkbox" class="filter-chapter-annot" />
         </td>
     </tr>
--- a/src/spel/templates/spel_player.html	Thu Apr 17 16:24:34 2014 +0200
+++ b/src/spel/templates/spel_player.html	Fri Apr 18 12:22:22 2014 +0200
@@ -44,10 +44,6 @@
                         type: "Title"
                     },
                     {
-                        type: "PlaceholderPlayer", /*ou HtmlPlayer si HTML5*/
-                        height: 40
-                    },
-                    {
                         type: "HtmlPlayer", /*ou HtmlPlayer si HTML5*/
                         video: "/data/" + d + "/" + g + "/" + f,
                         height: 320
@@ -163,6 +159,9 @@
                         height: 600,
                         width: 500,
                         src: "{% url 'spel_ctb' %}"
+                    },
+                    {
+                        type: "Mediafragment"
                     }
                 ]
             };
--- a/src/spel/templates/spel_theatre.html	Thu Apr 17 16:24:34 2014 +0200
+++ b/src/spel/templates/spel_theatre.html	Fri Apr 18 12:22:22 2014 +0200
@@ -39,7 +39,7 @@
               </select>
             </div>
           </div>
-          <div class="row toggle-text"><span class="glyphicon glyphicon-play"></span> Voir les références de textes</div>
+          <div class="row toggle-text"><span class="glyphicon glyphicon-chevron-right"></span> Voir les références de textes</div>
           <div class="row theatre-text" style="display: none;">
             <iframe src="{% url 'spel_ctb' %}" width="97%" height="150px"></iframe>
             <span>Début : </span><select id="start-text"></select>
--- a/src/spel/views.py	Thu Apr 17 16:24:34 2014 +0200
+++ b/src/spel/views.py	Fri Apr 18 12:22:22 2014 +0200
@@ -280,7 +280,7 @@
         #   )) 
         # )
         
-        raw_query = "SELECT ldt_utils_segment.id, taggit_tag.name AS tags__name, ldt_utils_segment.iri_id, ldt_utils_segment.cutting_id, ldt_utils_segment.title, ldt_utils_segment.duration, ldt_utils_segment.start_ts, ldt_utils_segment.abstract \nFROM ldt_utils_segment \nLEFT OUTER JOIN taggit_taggeditem \nON (ldt_utils_segment.id = taggit_taggeditem.object_id) \nLEFT OUTER JOIN taggit_tag \nON (taggit_taggeditem.tag_id = taggit_tag.id) \nwhere cutting_id NOT IN ('performance','discussion') \nAND ("
+        raw_query = "SELECT ldt_utils_segment.id, taggit_tag.name AS tags__name, ldt_utils_segment.iri_id, ldt_utils_segment.cutting_id, ldt_utils_segment.element_id, ldt_utils_segment.title, ldt_utils_segment.duration, ldt_utils_segment.start_ts, ldt_utils_segment.abstract \nFROM ldt_utils_segment \nLEFT OUTER JOIN taggit_taggeditem \nON (ldt_utils_segment.id = taggit_taggeditem.object_id) \nLEFT OUTER JOIN taggit_tag \nON (taggit_taggeditem.tag_id = taggit_tag.id) \nwhere cutting_id NOT IN ('performance','discussion') \nAND ("
         #raw_query = "select id, iri_id, cutting_id, start_ts, duration, title, abstract \nfrom ldt_utils_segment \nwhere cutting_id NOT IN ('performance','discussion') \nAND ("
         for i, ga in enumerate(grouped_chapters):
             if i>0: