--- a/src/spel/management/commands/loadspeldata.py Fri Mar 07 17:41:35 2014 +0100
+++ b/src/spel/management/commands/loadspeldata.py Mon Mar 10 12:28:22 2014 +0100
@@ -89,7 +89,7 @@
# Save media and content
media, _ = Media.objects.get_or_create(src=f+"/original.mp4", duration=json_data["medias"][0]["meta"]["duration"])
media.is_public = True
- ctt_id = generate_uuid()
+ ctt_id = f
content = Content.objects.create(iri_id=ctt_id,
iriurl=ctt_id+u"/"+ctt_id+u".iri",
media_obj=media,
--- a/src/spel/static/spel/js/spectacle.js Fri Mar 07 17:41:35 2014 +0100
+++ b/src/spel/static/spel/js/spectacle.js Mon Mar 10 12:28:22 2014 +0100
@@ -122,6 +122,7 @@
.done(function( html ) {
$(".chapter-results").removeClass("loader");
$(".chapter-results").html(html);
+ $('.popinfo').popover({ html: true });
})
.fail(function() {
$(".chapter-results").removeClass("loader");
--- a/src/spel/templates/partial/spel_chapters.html Fri Mar 07 17:41:35 2014 +0100
+++ b/src/spel/templates/partial/spel_chapters.html Mon Mar 10 12:28:22 2014 +0100
@@ -3,8 +3,13 @@
{% load spel_tags %}
<p>{{ segments|length }} segment(s) trouvés</p>
<table class="table table-striped table-condensed">
- <tr><th>Type</th><th>Ref texte</th><th>début - fin</th></tr>
+ <tr><th>Type</th><th>Ref texte</th><th>début - fin</th><th> </th></tr>
{% for s in segments %}
- <tr><td>{{ s.cutting_id }}</td><td>{{ s.tags|get_tags:"ref_text_2" }}</td><td>{{ s.start_ts|str_duration }} - {{ s.start_ts|add:s.duration|str_duration }}</td></tr>
+ <tr><td>{{ s.cutting_id }}</td><td>{{ s.tags|get_tags:"ref_text_2" }}</td><td>{{ s.start_ts|str_duration }} - {{ s.start_ts|add:s.duration|str_duration }}</td>
+ <td>
+ <button type="button" class="popinfo btn btn-xs btn-default" data-trigger="hover" data-container="body" data-toggle="popover" data-placement="auto"
+ data-content="{{ s.tags|get_tags:'group'|safe }}"><span class="glyphicon glyphicon-plus-sign"></span></button>
+ </td>
+ </tr>
{% endfor %}
</table>
--- a/src/spel/templatetags/spel_tags.py Fri Mar 07 17:41:35 2014 +0100
+++ b/src/spel/templatetags/spel_tags.py Mon Mar 10 12:28:22 2014 +0100
@@ -27,7 +27,21 @@
val.append( ":".join(tag_split[2:]) )
else:
val.append(t[t.index(":")+2:])
-
+ elif arg=="group":
+ key_vals = {}
+ for t in a:
+ k = t[:t.index(":")]
+ v = t[t.index(":")+2:]
+ if k not in key_vals:
+ key_vals[k] = []
+ key_vals[k].append(v)
+ output = ""
+ for k,v in key_vals.items():
+ if output != "":
+ output += "<br/>"
+ output += "<b>" + k.capitalize() + "</b>" + ": " + ", ".join(v)
+ return output
+
return ", ".join(val)
get_tags.is_safe = True
--- a/src/spel/views.py Fri Mar 07 17:41:35 2014 +0100
+++ b/src/spel/views.py Mon Mar 10 12:28:22 2014 +0100
@@ -29,9 +29,6 @@
# Get start and end for date bounds (earliest is available only on django 1.6)
start_date = Content.objects.all().order_by("content_creation_date")[0].content_creation_date
end_date = Content.objects.latest("content_creation_date").content_creation_date
- logger.debug("COUCOU")
- logger.debug(start_date)
- logger.debug(end_date)
context = {"start_date":start_date, "end_date":end_date }
return self.render_to_response(context)
@@ -46,20 +43,19 @@
content_qs = Content.objects.all()
start_date_param = request.GET.get("start_date", "")
if start_date_param!="":
- #
content_qs = content_qs.filter(content_creation_date__gt=start_date_param)
end_date_param = request.GET.get("end_date", "")
if end_date_param!="":
content_qs = content_qs.filter(content_creation_date__lt=end_date_param + " 23:59:59")
iri_ids = content_qs.values_list("iri_id", flat=True)
- logger.debug("iri_ids")
- logger.debug(iri_ids)
+ #logger.debug("iri_ids")
+ #logger.debug(iri_ids)
# Filter segment if necessary
annot_types_param = request.GET.get("annotation_types", "")
seg_queryset = Segment.objects.filter(iri_id__in=iri_ids)
if annot_types_param!="":
annot_types = annot_types_param.split(",")
- seg_queryset = Segment.objects.filter(cutting_id__in=annot_types)
+ seg_queryset = seg_queryset.filter(cutting_id__in=annot_types)
# First we look at modalites_sceniques and personnages tags.
mod_scen_param = request.GET.get("modalites_sceniques", "")
@@ -77,7 +73,7 @@
# Get segments from tagged items
s = TaggedItem.objects.get_by_model(seg_queryset, tags)
- logger.debug("COUCOU")
+ #logger.debug("COUCOU")
#logger.debug(mod_scen_param)
#logger.debug(perso_param)
#logger.debug(mod_scen)