# HG changeset patch # User cavaliet # Date 1400169350 -7200 # Node ID 1f24f33b41e100ddac781d2d3179b1658ef8b35c # Parent bc700c2cd9f30db462e8bfc000863511427219cc v0.5.11 opera requests work diff -r bc700c2cd9f3 -r 1f24f33b41e1 src/spel/__init__.py --- a/src/spel/__init__.py Thu May 15 15:29:21 2014 +0200 +++ b/src/spel/__init__.py Thu May 15 17:55:50 2014 +0200 @@ -1,4 +1,4 @@ -VERSION = (0, 5, 10, "final", 0) +VERSION = (0, 5, 11, "final", 0) VERSION_STR = unicode(".".join(map(lambda i:"%02d" % (i,), VERSION[:2]))) diff -r bc700c2cd9f3 -r 1f24f33b41e1 src/spel/static/spel/css/spel.css --- a/src/spel/static/spel/css/spel.css Thu May 15 15:29:21 2014 +0200 +++ b/src/spel/static/spel/css/spel.css Thu May 15 17:55:50 2014 +0200 @@ -19,7 +19,7 @@ .width100percent{ width: 100%; } -.spel-content > .row > .chapters > .row{ +.filter-row{ margin-bottom: 10px; } .toggle-text{ diff -r bc700c2cd9f3 -r 1f24f33b41e1 src/spel/static/spel/js/opera.js --- a/src/spel/static/spel/js/opera.js Thu May 15 15:29:21 2014 +0200 +++ b/src/spel/static/spel/js/opera.js Thu May 15 17:55:50 2014 +0200 @@ -7,7 +7,7 @@ }, onChange: function(element, checked) { var filter_enabled = false; - var chbs = $(".chapters input:checkbox"); + var chbs = $(".spel-content input:checkbox"); for (var i = chbs.length - 1; i >= 0; i--) { filter_enabled = filter_enabled || $(chbs[i]).is(":checked"); }; @@ -19,14 +19,6 @@ } } }); - // Annotations multiselect management - $('.annotations .multiselect').multiselect({ - buttonText: function(options, select) { - return $(select).attr("data-title") + ' (' + options.length + ') '; - }, - buttonContainer: '
', - buttonClass: 'btn btn-default width100percent disabled' - }); // Data 1 var data1 = [ @@ -74,7 +66,7 @@ var n = data.objects.length; var data4 = []; for(var i=0;iVous devez sélectionner au moins un filtre

"); return false; } $(".chapter-results").html("

"); $(".chapter-results").addClass("loader"); $.ajax({ - url: urlChapters, + url: urlAnnotations, data:{ start_date: $('input[name=start_date]').val(), end_date: $('input[name=end_date]').val(), annotation_types: ( ($("#mulsel1").val()==null) ? [] : $("#mulsel1").val() ).join(","), modalites_sceniques: ( ($("#mulsel2").val()==null) ? [] : $("#mulsel2").val() ).join(","), personnages: ( ($("#mulsel3").val()==null) ? [] : $("#mulsel3").val() ).join(","), + type_travail: ( ($("#mulsel4").val()==null) ? [] : $("#mulsel4").val() ).join(","), + acte: ( ($("#mulsel5").val()==null) ? [] : $("#mulsel5").val() ).join(","), + scene: ( ($("#mulsel6").val()==null) ? [] : $("#mulsel6").val() ).join(","), + mesure: ( ($("#mulsel7").val()==null) ? [] : $("#mulsel7").val() ).join(","), start_text: $("#start-text").val(), end_text: $("#end-text").val() } @@ -204,11 +200,23 @@ $("#mulsel1").multiselect('deselect', $(this).parent().text().trim()); } else if($(this).parent().hasClass("modscen")){ - $("#mulsel2").multiselect('deselect', "modalites_sceniques: " + $(this).parent().text().trim()); + $("#mulsel2").multiselect('deselect', "opera_modalites_sceniques: " + $(this).parent().text().trim()); } else if($(this).parent().hasClass("perso")){ - $("#mulsel3").multiselect('deselect', "personnages: " + $(this).parent().text().trim()); + $("#mulsel3").multiselect('deselect', "opera_personnages: " + $(this).parent().text().trim()); } + else if($(this).parent().hasClass("type-travail")){ + $("#mulsel4").multiselect('deselect', "opera_type_travail: " + $(this).parent().text().trim()); + } + else if($(this).parent().hasClass("acte")){ + $("#mulsel5").multiselect('deselect', "opera_acte: " + $(this).parent().text().split(" ")[1].trim()); + } + else if($(this).parent().hasClass("scene")){ + $("#mulsel6").multiselect('deselect', "opera_scene: " + $(this).parent().text().split(" ")[1].trim()); + } + else if($(this).parent().hasClass("mesure")){ + $("#mulsel7").multiselect('deselect', "opera_mesure: " + $(this).parent().text().split(" ")[1].trim()); + } else if($(this).parent().hasClass("date")){ $('input[name=start_date]').val(""); $('input[name=end_date]').val(""); diff -r bc700c2cd9f3 -r 1f24f33b41e1 src/spel/templates/partial/spel_opera_annotations.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/spel/templates/partial/spel_opera_annotations.html Thu May 15 17:55:50 2014 +0200 @@ -0,0 +1,46 @@ +{% load static %} +{% load front_tags %} +{% load spel_tags %} +
+
+
    + {% if start_date != "" or end_date != "" %}
  • + {% if start_date != "" %}{{ start_date }} ≤ {% endif %}date{% if end_date != "" %} ≤ {{ end_date }}{% endif %} +
  • + {% endif %} + {% for t in annot_types %}
  • {{ t|remove_tag_key }}
  • {% endfor %} + {% for t in mod_scen %}
  • {{ t|remove_tag_key }}
  • {% endfor %} + {% for t in perso %}
  • {{ t|remove_tag_key }}
  • {% endfor %} + {% for t in type_travail %}
  • {{ t|remove_tag_key }}
  • {% endfor %} + {% for t in acte %}
  • {{ t|remove_opera }}
  • {% endfor %} + {% for t in scene %}
  • {{ t|remove_opera }}
  • {% endfor %} + {% for t in mesure %}
  • {{ t|remove_opera }}
  • {% endfor %} +
+

{{ segments|length }} segment(s) trouvé(s)

+
+
+ + + + + + {% for s in segments %} + + + + + + + + + + + + {% endfor %} + +
TypeTitre de la vidéoModalités scéniquesPersonnagesTravailActeScèneMesure 
{{ s.cutting_id|slice:":1"|upper }}{% if annot_chapters %}{{ s.ct }}{% else %}{{ s.content.title }}{% endif %}{{ s.tags|get_tags:"opera_modalites_sceniques"|join:', ' }}{{ s.tags|get_tags:"opera_personnages"|join:', ' }}{{ s.tags|get_tags:"opera_type_travail"|join:', ' }}{{ s.tags|get_tags:"opera_acte"|join:', ' }}{{ s.tags|get_tags:"opera_scene"|join:', ' }}{{ s.tags|get_tags:"opera_mesure"|join:', ' }} + + + +
diff -r bc700c2cd9f3 -r 1f24f33b41e1 src/spel/templates/spel_opera.html --- a/src/spel/templates/spel_opera.html Thu May 15 15:29:21 2014 +0200 +++ b/src/spel/templates/spel_opera.html Thu May 15 17:55:50 2014 +0200 @@ -13,7 +13,7 @@ {% block spel_content %}

Page Opéra

-
+
@@ -25,7 +25,7 @@
-
+
@@ -36,7 +36,7 @@
-
+
@@ -47,9 +47,10 @@
-
-
Résultats d'annotations
+
+
+
Résultats d'annotations
{% endblock %} {% block page_js %} @@ -68,7 +69,7 @@ var urlOS = "{% url 'api_dispatch_list' resource_name='tags' api_name='1.0' %}?format=json&limit=500&name__startswith=opera_scene:&order_by=name"; var urlOM = "{% url 'api_dispatch_list' resource_name='tags' api_name='1.0' %}?format=json&limit=500&name__startswith=opera_mesure&order_by=name"; //var urlChapters = "{% url 'spel_chapters' %}"; - //var urlAnnotations = "{% url 'spel_annotations' %}"; + var urlAnnotations = "{% url 'spel_opera_annotations' %}"; var csrf_token = "{{csrf_token}}"; $('.input-daterange').datepicker({ format: "yyyy-mm-dd", diff -r bc700c2cd9f3 -r 1f24f33b41e1 src/spel/templates/spel_theatre.html --- a/src/spel/templates/spel_theatre.html Thu May 15 15:29:21 2014 +0200 +++ b/src/spel/templates/spel_theatre.html Thu May 15 17:55:50 2014 +0200 @@ -16,7 +16,7 @@

CHAPITRES

-
+
Dates de répétition :
de @@ -25,7 +25,7 @@
-
+
@@ -39,13 +39,13 @@
-
Voir les références de textes
-