# HG changeset patch # User cavaliet # Date 1326131922 -3600 # Node ID c6a6ea1ce091fe01f0c765ee8eaa6a470dbe59ff # Parent 631c0edee9ea995d0f2fa3b93742f715933c3800 First step of player page in front. Old version of metadata player integrated. diff -r 631c0edee9ea -r c6a6ea1ce091 src/ldt/ldt/ldt_utils/templates/front/front_base.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_base.html Mon Jan 09 15:12:15 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_base.html Mon Jan 09 18:58:42 2012 +0100 @@ -9,7 +9,7 @@ - {% block title %}{% trans "page_title" %}{% endblock %} + {% block title %}Lignes de temps{% endblock %} {% block js_import %}{% endblock %} {% block css_declaration %}{% endblock %} {% block css_import %} diff -r 631c0edee9ea -r c6a6ea1ce091 src/ldt/ldt/ldt_utils/templates/front/front_group.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_group.html Mon Jan 09 15:12:15 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_group.html Mon Jan 09 18:58:42 2012 +0100 @@ -2,7 +2,8 @@ {% load i18n %} {% load thumbnail %} -{% block title %}Home{% endblock %} +{% block title %}Lignes de temps : groupe "{{group.name}}"{% endblock %} + {% block css_import %} {{block.super}} @@ -17,9 +18,9 @@ {% for content in content_list %}
  • - {% thumbnail content.image "134x75" format="PNG" crop="center" as im %}{% endthumbnail %} + {% thumbnail content.image "134x75" format="PNG" crop="center" as im %}{% endthumbnail %}
    120
    -

    {% if content.title|length > 69 %}{{content.title|slice:":69"}}...{% else %}{{content.title}}{% endif %}

    +

    {% if content.title|length > 69 %}{{content.title|slice:":69"}}...{% else %}{{content.title}}{% endif %}

    {% trans 'by' %} IRI | {{content.duration_str}}

  • {% endfor %} diff -r 631c0edee9ea -r c6a6ea1ce091 src/ldt/ldt/ldt_utils/templates/front/front_home.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_home.html Mon Jan 09 15:12:15 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_home.html Mon Jan 09 18:58:42 2012 +0100 @@ -2,7 +2,8 @@ {% load i18n %} {% load thumbnail %} -{% block title %}Home{% endblock %} +{% block title %}Lignes de temps : Home{% endblock %} + {% block css_import %} {{block.super}} @@ -17,9 +18,9 @@ {% for content in last_contents %}
  • - {% thumbnail content.image "294x165" format="PNG" crop="center" as im %}{% endthumbnail %} + {% thumbnail content.image "294x165" format="PNG" crop="center" as im %}{% endthumbnail %}
    250
    -

    {{content.title}}

    +

    {{content.title}}

    {% trans 'by' %} IRI | {{content.duration_str}}

  • {% endfor %} @@ -31,9 +32,9 @@ {% for content in most_contents %}
  • - {% thumbnail content.image "134x75" format="PNG" crop="center" as im %}{% endthumbnail %} + {% thumbnail content.image "134x75" format="PNG" crop="center" as im %}{% endthumbnail %}
    120
    -

    {% if content.title|length > 69 %}{{content.title|slice:":69"}}...{% else %}{{content.title}}{% endif %}

    +

    {% if content.title|length > 69 %}{{content.title|slice:":69"}}...{% else %}{{content.title}}{% endif %}

    {% trans 'by' %} IRI | {{content.duration_str}}

  • {% endfor %} diff -r 631c0edee9ea -r c6a6ea1ce091 src/ldt/ldt/ldt_utils/templates/front/front_player.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_player.html Mon Jan 09 18:58:42 2012 +0100 @@ -0,0 +1,196 @@ +{% extends "front/front_base.html" %} +{% load i18n %} +{% load thumbnail %} + +{% block title %}Lignes de temps : {% trans 'Annotate' %} "{{content.title}}"{% endblock %} + +{% block css_import %} +{{block.super}} + + + +{% endblock %} + +{% block js_declaration %} + + + + + + + + +{% endblock %} + +{% block body %} +{{block.super}} + +
    + + +
    + {% include "ldt/ldt_utils/partial/embed_player.html" %} +
    +
    + + +
    +
    +

    {% trans 'All annotations on the media' %}

    +
    + +
    +{% endblock %} + diff -r 631c0edee9ea -r c6a6ea1ce091 src/ldt/ldt/ldt_utils/urls.py --- a/src/ldt/ldt/ldt_utils/urls.py Mon Jan 09 15:12:15 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/urls.py Mon Jan 09 18:58:42 2012 +0100 @@ -42,6 +42,7 @@ url(r'^updateGroup/(?P.*)$', 'views.group.update_group'), url(r'^front/$', 'views.front.front_home'), url(r'^front/group/(?P.*)$', 'views.front.group_info'), + url(r'^front/player/(?P.*)$', 'views.front.annot_content'), ) urlpatterns += patterns('', diff -r 631c0edee9ea -r c6a6ea1ce091 src/ldt/ldt/ldt_utils/views/front.py --- a/src/ldt/ldt/ldt_utils/views/front.py Mon Jan 09 15:12:15 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/views/front.py Mon Jan 09 18:58:42 2012 +0100 @@ -1,6 +1,7 @@ from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib.auth.models import Group, User +from django.core.urlresolvers import reverse from django.http import HttpResponseServerError from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext @@ -9,9 +10,6 @@ from ldt.security.utils import add_change_attr - - - @login_required def front_home(request): # Get the 3 last annotated contents @@ -48,4 +46,30 @@ context_instance=RequestContext(request)) +@login_required +def annot_content(request, content_iri_id): + # Get the wanted content + content = Content.objects.get(iri_id=content_iri_id) + # The main project for the content + proj = Project.objects.filter(contents__in=[content])[0] + # Vars for player + player_id = "player_project_" + proj.ldt_id + json_url = reverse("ldt.ldt_utils.views.json.project_json_id", args=[proj.ldt_id]) + player_width = 550 + player_height = 380 + stream_mode = proj.stream_mode + if stream_mode != "video": + stream_mode = 'radio' + + is_gecko = ((request.META['HTTP_USER_AGENT'].lower().find("firefox")) > -1); + + + return render_to_response("front/front_player.html", + {'content': content, 'project':proj, 'player_id': player_id, + 'json_url': json_url, 'player_width':player_width, 'player_height':player_height, 'stream_mode':stream_mode, + 'is_gecko': is_gecko}, + context_instance=RequestContext(request)) + + + diff -r 631c0edee9ea -r c6a6ea1ce091 src/ldt/ldt/static/ldt/css/front_player.css --- a/src/ldt/ldt/static/ldt/css/front_player.css Mon Jan 09 15:12:15 2012 +0100 +++ b/src/ldt/ldt/static/ldt/css/front_player.css Mon Jan 09 18:58:42 2012 +0100 @@ -1,5 +1,5 @@ #player_col_g { - float: left; width: 550px; + float: left; width: 550px; margin: 10px 0; } #top_media { @@ -41,7 +41,7 @@ /* COLONNE DE DROITE */ #player_col_d { - float: left; width: 410px; + float: left; width: 410px; margin: 9px 0; } #player_col_d .li_h2 { diff -r 631c0edee9ea -r c6a6ea1ce091 src/ldt/ldt/static/ldt/img/annot_icon_80x45.png Binary file src/ldt/ldt/static/ldt/img/annot_icon_80x45.png has changed