--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_content.html Thu Apr 18 13:25:59 2013 +0200
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_content.html Wed Apr 24 12:22:50 2013 +0200
@@ -16,7 +16,6 @@
<script type="text/javascript" src='{% absstatic "ldt/js/projectscontents.js" %}'></script>
<script type="text/javascript" src='{% absstatic "ldt/js/jquery.textchange.min.js" %}'></script>
<script type="text/javascript" src='{% absstatic "ldt/js/jquery-ui.min.js" %}'></script>
-
{{ content_form.media.js }}
{% endblock %}
@@ -29,7 +28,15 @@
post_added_params = {"csrfmiddlewaretoken" : "{{csrf_token}}",
"{{cookie_name}}" : "{{session_key}}"};
- onCreateContentReady('{% absstatic "ldt" %}', post_added_params);
+ onCreateContentReady("{% url ldt.ldt_utils.views.content.upload %}",
+ "{% absstatic 'ldt' %}",
+ post_added_params,
+ "{% trans 'Browse' %}",
+ "{% trans 'File uploaded' %}",
+ "{% trans 'Please wait, the upload is not finished yet' %}",
+ "{% trans 'Cancel upload' %",
+ "{% url ldt.ldt_utils.views.content.remove_temp_file %}",
+ "{% url ldt.ldt_utils.views.content.get_duration %}");
});
// the function stopRKey prevents from the validation of the form if the user tape enter button while entering a field
function stopRKey(evt) {
@@ -73,25 +80,16 @@
chunked_uploads_complete = function(){
};
});
-
</script>
{% endblock %}
{% block css_import %}
+ {{ content_form.media.css }}
{{ block.super }}
- {{ content_form.media.css }}
<link rel="stylesheet" href='{% absstatic "ldt/css/ldtform.css" %}'/>
- <link rel="stylesheet" href='{% absstatic "ldt/css/style.css" %}'/>
- <link rel="stylesheet" href='{% absstatic "ldt/css/blueprint/screen.css" %}' type="text/css" media="screen, projection" />
- <link rel="stylesheet" href='{% absstatic "ldt/css/blueprint/print.css" %}' type="text/css" media="print" />
- <link rel="stylesheet" href='{% absstatic "ldt/css/workspace.css" %}'type="text/css"/>
-
-
{% endblock %}
{% block content %}
-
-
{% if media_form.errors %}
<div id="media-form-error">
<p>{% trans "The operation could not be performed because one or more error(s) occurred.<br />Please resubmit the media form after making the following changes:" %}</p>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_ldt.html Wed Apr 24 12:22:50 2013 +0200
@@ -0,0 +1,17 @@
+{% load analytics %}
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{LANGUAGE_CODE}}" lang="{{LANGUAGE_CODE}}">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
+ <meta http-equiv="Pragma" content="no-cache" />
+ <meta http-equiv="Cache" content="no store" />
+ <meta http-equiv="Expires" content="-1" />
+ <title>Lignes de Temps - IRI</title>
+ </head>
+ <body style="margin:0 0 0 0;">
+ {% include "ldt/ldt_utils/partial/ldt_div.html" %}
+ {% analytics %}
+ </body>
+</html>
+
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html Thu Apr 18 13:25:59 2013 +0200
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html Wed Apr 24 12:22:50 2013 +0200
@@ -59,12 +59,22 @@
{% block content %}
<div id='ldt_id'>
- <div id='ldt_id_title'>{% trans 'project id' %} <span id="project_id_select">({% trans 'Select' %})</span> : <input id="project_id_input" value="{{ldt_id}}"/></div>
+ <p>{% trans 'Share the project' %} : <span class="large_text">{{ project.title }}</span></p>
+ <p class="margin0">{% trans "List of the project's contents" %}:<br/>
+ <ul>
+ {% for c in contents %}
+ <li>{{ c.title }} - <span class="middle_text">{% trans 'Link to the Metadata Player' %} : <a href="{% url ldt.ldt_utils.views.front.annot_content c.iri_id ldt_id %}" target="_blank">{% trans 'See' %}</a> - </span><span class="click_to_select">{% trans 'Select' %}</span> : <input id="" class="copy_input" value="{% absurl ldt.ldt_utils.views.front.annot_content c.iri_id ldt_id %}"/></li>
+ {% endfor %}
+ </ul>
+ </p>
+ <div>{% trans 'project id' %} <span id="project_id_select" class="click_to_select">({% trans 'Select' %})</span> : <input id="project_id_input" class="copy_input" value="{{ldt_id}}"/></div>
+ <div>{% trans 'The project in Lignes de Temps' %} : <span class="middle_text"><a href="{% url index_project_full ldt_id %}" target="_blank">{% trans 'See' %}</a> - </span><span class="click_to_select">{% trans 'Select' %}</span> : <input id="" class="copy_input" value="{% absurl index_project_full ldt_id %}"/></div>
</div>
<br>
<div id="button_row">
<div id="display_select">
<input id="player_button" type="button" class="code_button" value="{% trans 'popup_player'%}"/>
+ <input id="ldt_iframe_button" type="button" class="code_button" value="{% trans 'popup_ldt_iframe' %}"/>
<input id="seo_body_button" type="button" class="code_button" value="{% trans 'popup_seo_body' %}"/>
<input id="seo_meta_button" type="button" class="code_button" value="{% trans 'popup_seo_meta' %}"/>
<input id="links_button" type="button" class="code_button" value="{% trans 'popup_links' %}"/>
@@ -74,7 +84,9 @@
<div style="float: left;">
<div id="links_code" class="ldt_player_code">{% include "ldt/ldt_utils/partial/embed_links.html" %}</div>
-
+ <div id="ldt_iframe_code">
+ <textarea id="ldt_iframe_id_code" readonly="readonly" class="ldt_player_code" >{% autoescape off %}<iframe src='{% absurl embed_ldt ldt_id %}' width='1005' height='635' seamless='seamless'></iframe>{% endautoescape %}</textarea>
+ </div>
<div id="seo_body_code">
<textarea id="seo_body_id_code" readonly="readonly" class="ldt_player_code" >{{ embed_rendered.seo_body }}</textarea>
</div>
@@ -217,9 +229,9 @@
</div>
<textarea id="player_id_code" readonly="readonly" class="ldt_player_code" onClick="select_code();"></textarea>
</div>
-
+ </div>
+ <a id="displayPlayer" href="javascript:toggle();">{% trans 'Show Player' %}</a>
</div>
- <a id="displayPlayer" href="javascript:toggle();">{% trans 'Show Player' %}</a>
<div id="player_div" style="display:none">
<button type="button" class="refresh_button" id="refresh_player_button" title="Rafraichir le player" >
<img src='{% absstatic "ldt/img/arrow_refresh.png" %}' id="refresh_player" ></img>
@@ -227,7 +239,4 @@
<div class="ldt_player" id="wrapper_{{player_id}}"></div>
</div>
{% endblock %}
-
- {% analytics %}
-
-
+ {% analytics %}
\ No newline at end of file
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/projectslist.html Thu Apr 18 13:25:59 2013 +0200
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/projectslist.html Wed Apr 24 12:22:50 2013 +0200
@@ -48,9 +48,11 @@
<td class="cellimg"><div class="cellimgdiv"><img src='{% absstatic "ldt/img/page_copy.png" %}' href="{% url ldt.ldt_utils.views.project.copy_project project.ldt_id group_id %}" class="ldt_link_copy_project" alt="{% trans 'copy project' %}" title="{% trans 'copy project' %}"/></div></td>
<td class="cellimg">
<div class="cellimgdiv">
- <a href='{% url ldt.ldt_utils.views.workspace.popup_embed %}?json_url={{WEB_URL}}{{json_url_id}}&player_id=player_project_{{project.ldt_id}}&ldt_id={{project.ldt_id}}'>
- <img src='{% absstatic "ldt/img/plugin.png" %}' id="player_project_{{project.ldt_id}}" class="ldt_link_embed" alt="{% trans 'link json by id' %}" title="{% trans 'link json by id' %}"/>
- </a>
+ {% if project.state == 2 %}
+ <a href='{% url ldt.ldt_utils.views.workspace.popup_embed %}?json_url={{WEB_URL}}{{json_url_id}}&player_id=player_project_{{project.ldt_id}}&ldt_id={{project.ldt_id}}'>
+ <img src='{% absstatic "ldt/img/plugin.png" %}' id="player_project_{{project.ldt_id}}" class="ldt_link_embed" alt="{% trans 'link json by id' %}" title="{% trans 'link json by id' %}"/>
+ </a>
+ {% endif %}
</div>
</td>
<td class="cellimg">
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/workspace_base.html Thu Apr 18 13:25:59 2013 +0200
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/workspace_base.html Wed Apr 24 12:22:50 2013 +0200
@@ -42,7 +42,7 @@
{% block css_import %}
{{block.super}}
- <link rel="stylesheet" href='{% absstatic "ldt//css/workspace.css" %}' type="text/css"/>
+ <link rel="stylesheet" href='{% absstatic "ldt/css/workspace.css" %}' type="text/css"/>
{% endblock %}
{% block content %}
--- a/src/ldt/ldt/ldt_utils/urls.py Thu Apr 18 13:25:59 2013 +0200
+++ b/src/ldt/ldt/ldt_utils/urls.py Wed Apr 24 12:22:50 2013 +0200
@@ -35,6 +35,7 @@
url(r'filtershare/_(?P<filter>[\w \%\_\-\+]*?)/(?P<use_groups>true|false)$', "views.workspace.share_filter"),
url(r'^embedpopup/?$', "views.workspace.popup_embed"),
url(r'^embediframe/?$', "views.workspace.iframe_embed", name="embediframe_page"),
+ url(r'^embedldt/(?P<id>.*)$', 'views.lignesdetemps.embed_ldt', name='embed_ldt'),
url(r'^segment/(?P<project_id>.*)/(?P<content_id>.*)/(?P<ensemble_id>.*)/(?P<cutting_id>.*)/(?P<segment_id>.*)/$', 'views.lignesdetemps.index_segment'),
url(r'^segmentInit/(?P<project_id>.*)/(?P<content_id>.*)/(?P<ensemble_id>.*)/(?P<cutting_id>.*)/(?P<segment_id>.*)/$', 'views.lignesdetemps.init_segment'),
url(r'^segmentLdt/(?P<project_id>.*)/(?P<content_id>.*)/(?P<ensemble_id>.*)/(?P<cutting_id>.*)/(?P<segment_id>.*)/$', 'views.lignesdetemps.ldt_segment'),
@@ -46,7 +47,7 @@
url(r'^front/group/(?P<group_id>.*)$', 'views.front.group_info'),
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/player/(?P<content_iri_id>.*)/(?P<project_id>.*)$', 'views.front.annot_content'),
+ url(r'^front/player/(?P<content_iri_id>.*)/(?P<project_id>.*)$', 'views.front.annot_content', name='front_player_content_project'),
url(r'^front/search/$', 'views.front.search_index'),
url(r'^front/medias', 'views.front.all_contents'),
url(r'^mashupbytag/$', 'views.json.mashup_by_tag'),
--- a/src/ldt/ldt/ldt_utils/views/lignesdetemps.py Thu Apr 18 13:25:59 2013 +0200
+++ b/src/ldt/ldt/ldt_utils/views/lignesdetemps.py Wed Apr 24 12:22:50 2013 +0200
@@ -188,9 +188,9 @@
urlStr = absurl(request, "ldt.ldt_utils.views.lignesdetemps.init", args=['ldt_project', id])
posturl = absurl(request, "ldt.ldt_utils.views.lignesdetemps.save_ldt_project")
language_code = request.LANGUAGE_CODE[:2]
- colorurl=absstatic(request, "ldt/swf/ldt/pkg/color.xml")
- i18nurl=absstatic(request, "ldt/swf/ldt/pkg/i18n")
- baseurl=absstatic(request, "ldt/swf/ldt/")
+ colorurl = absstatic(request, "ldt/swf/ldt/pkg/color.xml")
+ i18nurl = absstatic(request, "ldt/swf/ldt/pkg/i18n")
+ baseurl = absstatic(request, "ldt/swf/ldt/")
try:
ldt = Project.safe_objects.get(ldt_id=id)
except Project.DoesNotExist:
@@ -208,6 +208,26 @@
return render_to_response(template_path, {'colorurl': colorurl, 'i18nurl': i18nurl, 'language': language_code, 'baseurl': baseurl, 'url': urlStr, 'posturl': posturl, 'id': id, 'readonly': readonly}, context_instance=RequestContext(request))
+
+def embed_ldt(request, id):
+ # Almost identical to index_project but without login_required and less parameters
+ urlStr = absurl(request, "ldt.ldt_utils.views.lignesdetemps.init", args=['ldt_project', id])
+ posturl = ""
+ language_code = request.LANGUAGE_CODE[:2]
+ colorurl = absstatic(request, "ldt/swf/ldt/pkg/color.xml")
+ i18nurl = absstatic(request, "ldt/swf/ldt/pkg/i18n")
+ baseurl = absstatic(request, "ldt/swf/ldt/")
+
+ readonly = 'true'
+ template_path = 'ldt/ldt_utils/embed_ldt.html'
+
+ try:
+ ldt = Project.safe_objects.get(ldt_id=id)
+ except Project.DoesNotExist:
+ return HttpResponseRedirect(reverse("ldt.ldt_utils.views.workspace.home"))
+
+ return render_to_response(template_path, {'colorurl': colorurl, 'i18nurl': i18nurl, 'language': language_code, 'baseurl': baseurl, 'url': urlStr, 'posturl': posturl, 'id': id, 'readonly': readonly}, context_instance=RequestContext(request))
+
def init(request, method, url):
ldtgen = LdtUtils()
--- a/src/ldt/ldt/ldt_utils/views/workspace.py Thu Apr 18 13:25:59 2013 +0200
+++ b/src/ldt/ldt/ldt_utils/views/workspace.py Wed Apr 24 12:22:50 2013 +0200
@@ -227,10 +227,10 @@
def get_datas_for_embed(request, json_url, player_id, ldt_id):
- project = Project.safe_objects.get(ldt_id=ldt_id); #@UndefinedVariable
+ project = Project.safe_objects.prefetch_related("contents").get(ldt_id=ldt_id); #@UndefinedVariable
project_contents = project.contents.all()
- content=project_contents[0]
- WEB_URL=get_web_url(request)
+ content = project_contents[0]
+ WEB_URL = get_web_url(request)
iframe_url = mark_safe(WEB_URL+settings.BASE_URL+"ldtplatform/ldt/embediframe/?content_id="+content.iri_id+"&project_id="+ldt_id)
external_url = None
if content.src is not None:
@@ -245,10 +245,10 @@
if not ldt_auth.check_access(request.user, project):
return HttpResponseForbidden(_("You can not access this project"))
- LANGUAGE_CODE=settings.LANGUAGE_CODE
+ LANGUAGE_CODE = settings.LANGUAGE_CODE
ps = ProjectJsonSerializer(project, from_contents=True, from_display=True)
annotations = ps.get_annotations(first_cutting=True)
- rend_dict = {'json_url':json_url, 'player_id':player_id, 'annotations':annotations, 'ldt_id': ldt_id, 'stream_mode': stream_mode,
+ rend_dict = {'project':project, 'contents':project_contents, 'json_url':json_url, 'player_id':player_id, 'annotations':annotations, 'ldt_id': ldt_id, 'stream_mode': stream_mode,
'external_url': external_url,
'polemic':False, 'show_mic_record':False, 'annotations_list':False, 'iframe_url':iframe_url, 'WEB_URL':WEB_URL,
'LANGUAGE_CODE':LANGUAGE_CODE}
--- a/src/ldt/ldt/static/ldt/css/embed_popup.css Thu Apr 18 13:25:59 2013 +0200
+++ b/src/ldt/ldt/static/ldt/css/embed_popup.css Wed Apr 24 12:22:50 2013 +0200
@@ -111,16 +111,16 @@
margin-right: 10px;
padding: 2px;
}
-#project_id_select {
- font-size: 0.7em;
+.click_to_select {
+ font-size: 0.9em;
cursor: pointer;
}
-#project_id_select:hover {
+.click_to_select:hover {
text-decoration: underline;
}
-#project_id_input {
+.copy_input {
width: 260px;
- height: 18px;
+ height: 14px;
border: 1px solid #CCC;
padding: 4px;
margin-bottom: 5px;
--- a/src/ldt/ldt/static/ldt/js/embed_popup.js Thu Apr 18 13:25:59 2013 +0200
+++ b/src/ldt/ldt/static/ldt/js/embed_popup.js Wed Apr 24 12:22:50 2013 +0200
@@ -1,7 +1,7 @@
var display_state = "player";
function toggle_display() {
- $j.each(["player","seo_body","seo_meta","links"], function(i,display_str) {
+ $j.each(["player","ldt_iframe","seo_body","seo_meta","links"], function(i,display_str) {
var div_selector = "#"+display_str+"_code";
if(display_str === display_state) {
@@ -40,14 +40,13 @@
$j("#sparkline_fill_color").val("#aeaeb8");
var type_embed=document.getElementById("type_embed_div");
type_embed.checked=true;
- var autostart_val = document.getElementById("autostart_checkbox");
- autostart_val.checked = true;
$j("#createannotation_options").toggle(false);
mode1();
- $j("#project_id_select").click(function(){
- $j("#project_id_input").select();
- });
+ $j(".click_to_select").click(function(){
+ var i = $j(this).parent().find("input");
+ i.select();
+ });
$j('.ldt_json_link').click(function(e) {
e.preventDefault();
@@ -60,14 +59,22 @@
$j('#player_button').click(function(e) {
display_state = "player";
toggle_display();
+ $j("#player_id_code").select();
+ });
+ $j('#ldt_iframe_button').click(function(e) {
+ display_state = "ldt_iframe";
+ toggle_display();
+ $j("#ldt_iframe_id_code").select();
});
$j('#seo_body_button').click(function(e) {
display_state = "seo_body";
toggle_display();
+ $j("#seo_body_id_code").select();
});
$j('#seo_meta_button').click(function(e) {
display_state = "seo_meta";
toggle_display();
+ $j("#seo_meta_id_code").select();
});
$j('#links_button').click(function(e) {
display_state = "links";
@@ -80,26 +87,9 @@
$j("#refresh_player_button").click(function(e){
refresh_player();
- });
-
- $j("#refresh_player_button").click(function(){
- $j("#player_id_code").select();
- });
-
- $j("#player_button").click(function(){
$j("#player_id_code").select();
});
-
- $j("#seo_body_button").click(function(){
- display_state = "seo_body";
- toggle_display();
- $j("#seo_body_id_code").select();
-
- });
-
- $j("#seo_meta_button").click(function(){
- $j("#seo_meta_id_code").select();
- });
+
$j('#links_button').click(function() {
var range = document.createRange();
@@ -196,7 +186,6 @@
function generate_widget_code(){
var annotationslist_val=document.getElementById('annotations_list_checkbox');
- var autostart_val = document.getElementById('autostart_checkbox');
var slideshare_val=document.getElementById('slideshare_checkbox');
var social_val=document.getElementById('social_checkbox');
var annotation_val=document.getElementById('annotation_checkbox');
@@ -215,30 +204,11 @@
widget_code+='\
video: "'+external_url+'",\n';
}
- else{
- widget_code+='\
- streamer: function(_url) {\n\
- var _matches = _url.match(/^[^\\/]+\\/\\/[^\\/]+\\/[^\\/]+\\//);\n\
- if (_matches) {\n\
- return _matches[0];\n\
- } else {\n\
- return _url;\n\
- }\n\
- },\n';
- }
widget_code+='\
- height: '+player_height_val+',\n';
- if (autostart_val.checked){
- widget_code+='\
+ height: '+player_height_val+',\n\
autostart: true\n\
}';
- }
- else{
- widget_code+='\
- autostart: false\n\
- }';
- }
if (polemic_val.checked){
defaultcolor= $j("#polemic_default_color").val();
foundcolor=$j("#polemic_found_color").val();
@@ -299,7 +269,7 @@
if(segments_val.checked){
widget_code+=',{\n\
type: "Segments",\n\
- annotation_type: ["chap","découpage"]\n\
+ annotation_type: ["chap","découpage"]\n\
}';
}
widget_code+=',{\n\
@@ -383,7 +353,7 @@
type: "Annotation",\n\
start_minimized: true,\n\
site_name : "Lignes de Temps",\n\
- annotation_type: ["chap","découpage"]\n\
+ annotation_type: ["chap","découpage"]\n\
}';
}
if(tweet_val.checked){
@@ -651,7 +621,6 @@
function generate_iframeUrl(){
var createannotation_val=document.getElementById('createannotation_checkbox');
- var autostart_val = document.getElementById('autostart_checkbox');
var annotationslist_val=document.getElementById('annotations_list_checkbox');
var slideshare_val=document.getElementById('slideshare_checkbox');
var social_val=document.getElementById('social_checkbox');
@@ -667,9 +636,7 @@
iframeUrl+="&player_height="+$j("#player_height").val();
if ($j("#player_width").val()!=550)
iframeUrl+="&player_width="+$j("#player_width").val();
- if(!autostart_val.checked){
- iframeUrl+="&autostart=False";
- }
+
if(createannotation_val.checked){
iframeUrl+="&createannotation=True";
var show_mic_record_val = document.getElementById('show_mic_record_checkbox');
--- a/src/ldt/ldt/templates/ldt/ldt_raw_base.html Thu Apr 18 13:25:59 2013 +0200
+++ b/src/ldt/ldt/templates/ldt/ldt_raw_base.html Wed Apr 24 12:22:50 2013 +0200
@@ -11,7 +11,7 @@
{% block head %}
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<meta http-equiv="content-language" content="{{LANGUAGE_CODE}}" />
- <link rel="SHORTCUT ICON" href='{% absstatic "ldt//img/favicon.ico" %}' />
+ <link rel="SHORTCUT ICON" href='{% absstatic "ldt/img/favicon.ico" %}' />
<title>{% block title %}{% trans "page_title" %}{% endblock %}</title>
{% block js_import %}
<script type="text/javascript" src='{% absstatic "ldt/js/jquery.min.js" %}'></script>