# HG changeset patch
# User cavaliet
# Date 1354105860 -3600
# Node ID 57a5ecd3ef5996cb7ccaba865ac2cd24c468cbb6
# Parent 38e5c73b4c845ba34870c7b65c4403478e53593d
add hashcut playing view and template.
diff -r 38e5c73b4c84 -r 57a5ecd3ef59 src/hashcut/templates/bpi_mashup_edit.html
--- a/src/hashcut/templates/bpi_mashup_edit.html Wed Nov 28 12:38:44 2012 +0100
+++ b/src/hashcut/templates/bpi_mashup_edit.html Wed Nov 28 13:31:00 2012 +0100
@@ -326,8 +326,6 @@
{% block js_import %}
{{ block.super }}
-
@@ -338,7 +336,8 @@
project: "{% url api_dispatch_list api_name='1.0' resource_name='projects' %}",
segment: "{% url api_dispatch_list api_name='1.0' resource_name='segments' %}",
ldt: "{% url projectjson_id id='' %}",
- hashcut_page: "hashcut.html?project="
+ hashcut_page: "{% url mashup_hashcut branding=branding ldt_id='' %}",
+ csrf_token: "{{csrf_token}}"
};
$(function() {
IriSP.video_url_transform = function(oldurl) {
diff -r 38e5c73b4c84 -r 57a5ecd3ef59 src/hashcut/templates/bpi_mashup_hashcut.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hashcut/templates/bpi_mashup_hashcut.html Wed Nov 28 13:31:00 2012 +0100
@@ -0,0 +1,261 @@
+{% extends "bpi_mashup_home.html" %}
+{% load static %}
+{% load i18n %}
+{% load analytics %}
+{% load thumbnail %}
+
{% block title %}Hashcut Playing - BPI{% endblock %}
+ {% block css_import %}
+ {{ block.super }}
+
+ {% endblock %}
+
+{% block wrap_header %}
+
+{% endblock %}
+
+{% block content %}
+
+
+
Lire le Hashcut
+
+
+
+
+
+
+
+
Segment sans titre
+
+
+
+ | Extrait de : |
+ ( - ) |
+
+
+ | Description : |
+ |
+
+
+ | Tags : |
+ |
+
+
+
+
+
+
+
+
+
+
Plus d’informations
+
+
+
+
+ | Titre : |
+ Titre du Hashcut |
+
+
+ | Durée : |
+ |
+
+
+ | Auteur : |
+ |
+
+
+ | Description : |
+ |
+
+
+
+
+
+
+
Médias utilisés dans le Hashcut
+
+
+
+{% endblock %}
+
+{% block js_import %}
+{{ block.super }}
+
+
+
+
+
+{% endblock %}
+
diff -r 38e5c73b4c84 -r 57a5ecd3ef59 src/hashcut/urls.py
--- a/src/hashcut/urls.py Wed Nov 28 12:38:44 2012 +0100
+++ b/src/hashcut/urls.py Wed Nov 28 13:31:00 2012 +0100
@@ -1,8 +1,9 @@
from django.conf.urls.defaults import patterns, url
-from hashcut.views import MashupHome, MashupEdit
+from hashcut.views import MashupHome, MashupEdit, MashupHashcut
urlpatterns = patterns('',
url(r'^(?P.*)/edit/$', MashupEdit.as_view(), name="mashup_edit"),
+ url(r'^(?P.*)/hashcut/(?P.*)/$', MashupHashcut.as_view(), name="mashup_hashcut"),
url(r'^(?P.*)/$', MashupHome.as_view(), name="mashup_home"),
url(r'^$', MashupHome.as_view()),
)
diff -r 38e5c73b4c84 -r 57a5ecd3ef59 src/hashcut/views.py
--- a/src/hashcut/views.py Wed Nov 28 12:38:44 2012 +0100
+++ b/src/hashcut/views.py Wed Nov 28 13:31:00 2012 +0100
@@ -72,6 +72,42 @@
context = {"branding":self.branding}
return self.render_to_response(context)
+
+
+class MashupHashcut(TemplateResponseMixin, View):
+
+ # iri = default brand name
+ branding = "iri"
+ template_suffix = "mashup_hashcut.html"
+ template_name = "iri_mashup_hashcut.html"
+
+ def get_template_names(self):
+ """
+ Return a list of template names to be used for the request. Must return
+ a list. May not be called if get_template is overridden.
+ """
+ try:
+ names = super(MashupHashcut, self).get_template_names()
+ except ImproperlyConfigured:
+ raise ImproperlyConfigured("Class MashupHashcut requires either a definition of 'template_name'")
+
+ # the branding template is supposed to override the default template. So we insert instead of append
+ if self.branding and self.branding != "":
+ #names.insert(0,"%s_%s" % (self.branding, self.template_name))
+ names.insert(0,"%s_%s" % (self.branding, self.template_suffix))
+
+ return names
+
+ def get(self, request, branding="iri", ldt_id=None, **kwargs):
+ self.branding = branding
+ if not ldt_id:
+ return HttpResponseNotFound("A project id must be given.")
+# project = Project.objects.get(ldt_id=ldt_id)
+# if not project:
+# return HttpResponseNotFound("Project not found.")
+ context = {"branding":self.branding, "ldt_id":ldt_id}
+ return self.render_to_response(context)
+