Merge with upstream
authorhamidouk
Mon, 16 Jan 2012 16:57:49 +0100
changeset 403 f47353222ac0
parent 402 c68470699447 (current diff)
parent 400 6f507891791a (diff)
child 405 b0e13a70a57f
child 407 3c34dc834781
Merge with upstream
--- a/src/ldt/ldt/ldt_utils/templates/front/front_search_results.html	Mon Jan 16 16:57:19 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/front/front_search_results.html	Mon Jan 16 16:57:49 2012 +0100
@@ -142,10 +142,10 @@
                     <li class="li_segment" id="li_{{segment.element_id}}">
                         <div class="left_segment">
                             <div class="color_zone" style="background: #f49af5;"></div>
-                            <a href="{% url ldt.ldt_utils.views.lignesdetemps.index_segment segment.project_id segment.iri_id segment.ensemble_id segment.decoupage_id segment.element_id %}"><img src="{{LDT_MEDIA_PREFIX}}img/annot_icon_80x45.png" width="80" height="45" /></a>
+                            <a href="{% url ldt.ldt_utils.views.front.annot_content segment.iri_id segment.project_id segment.decoupage_id %}#a={{segment.element_id}}"><img src="{{LDT_MEDIA_PREFIX}}img/annot_icon_80x45.png" width="80" height="45" /></a>
                             <!--p class="duree_segment">{{ segment.duration|str_duration:"::" }}</p-->
                         </div>
-                        <h4 class="title_segment"><a class="blue under" href="{% url ldt.ldt_utils.views.front.annot_content segment.iri_id segment.decoupage_id %}">
+                        <h4 class="title_segment"><a class="blue under" href="{% url ldt.ldt_utils.views.front.annot_content segment.iri_id segment.project_id segment.decoupage_id %}#a={{segment.element_id}}">
                           {% if segment.title %}{{ segment.title }}{% else %}{% trans "No title" %}{% endif %}</a></h4>
                         <p class="text_segment">{% if segment.context %}{{ segment.context }}{% endif %}<br/>{% trans "Begin" %} : {{ segment.begin|str_duration:"::" }} - {% trans "duration" %} : {{ segment.duration|str_duration:"::" }}</h4>
                     </li>
--- a/src/ldt/ldt/ldt_utils/urls.py	Mon Jan 16 16:57:19 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/urls.py	Mon Jan 16 16:57:49 2012 +0100
@@ -43,8 +43,8 @@
     url(r'^updateGroup/(?P<group_id>.*)$', 'views.group.update_group'),
     url(r'^front/$', 'views.front.front_home'),
     url(r'^front/group/(?P<group_id>.*)$', 'views.front.group_info'),
-    url(r'^front/playerCutting/(?P<content_iri_id>.*)/(?P<cutting_id>.*)/$', 'views.front.annot_content'),
-    url(r'^front/player/(?P<content_iri_id>.*)$', 'views.front.annot_content'),
+    url(r'^front/player/(?P<content_iri_id>.*)/$', 'views.front.annot_content'),
+    url(r'^front/player/(?P<content_iri_id>.*)/(?P<project_id>.*)/(?P<cutting_id>.*)$', 'views.front.annot_content'),
     url(r'^front/search/$', 'views.front.search_index'),
     url(r'^front/searchListing', 'views.front.search_listing'),
     url(r'^front/medias', 'views.front.all_contents'),
--- a/src/ldt/ldt/ldt_utils/views/front.py	Mon Jan 16 16:57:19 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/views/front.py	Mon Jan 16 16:57:49 2012 +0100
@@ -61,19 +61,26 @@
 
 
 @login_required
-def annot_content(request, content_iri_id, cutting_id=None):
+def annot_content(request, content_iri_id, project_id=None, cutting_id=None):
     # Get the wanted content
     content = Content.objects.get(iri_id=content_iri_id)
     # Get the content src to see if it is a youtube video
     youtube_url = None
     if content.src is not None and "youtube.com" in content.src:
         youtube_url = content.src
-    # The main project for the content
-    proj = Project.objects.filter(contents__in=[content])[0]
+    # If project id is not set, we get the default project for the content
+    if project_id is None :
+        # The main project for the content
+        proj = Project.objects.filter(contents__in=[content])[0]
+    else :
+        proj = Project.objects.get(ldt_id=project_id)
     # Vars for player
     player_id = "player_project_" + proj.ldt_id
     
-    json_url = reverse("ldt.ldt_utils.views.json.project_json_cutting_id", args=[proj.ldt_id, cutting_id])
+    if cutting_id is None :
+        json_url = reverse("ldt.ldt_utils.views.json.project_json_id", args=[proj.ldt_id])
+    else :
+        json_url = reverse("ldt.ldt_utils.views.json.project_json_cutting_id", args=[proj.ldt_id, cutting_id])
     player_width = 550
     player_height = 380
     stream_mode = proj.stream_mode