# HG changeset patch
# User grandjoncl
# Date 1349884518 -7200
# Node ID e5b5e9d56eece63b6e22d2c77aacb2238f5fb985
# Parent 29114c745efdba9ba236d40b7d925783041292ee
Radio button to choose between div and iframe embed code.
Embed code selected by default
Iframe embed code generated in javascript in the embed_popup template
diff -r 29114c745efd -r e5b5e9d56eec src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html Wed Oct 10 16:19:10 2012 +0200
+++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/embed_popup.html Wed Oct 10 17:55:18 2012 +0200
@@ -1,4 +1,5 @@
{% load i18n %}
+{% load set_var %}
{% load analytics %}
-
-
-
+
+
-
+
-
-
+
+
{% trans 'project id' %} ({% trans 'Select' %}) :
-
+
{% trans 'Show Player' %}
{% include "ldt/ldt_utils/partial/embed_player.html" %}
@@ -85,16 +86,21 @@
-
-
-
-
-
-
-
-
-
-
{% include "ldt/ldt_utils/partial/embed_links.html" %}
+
+
+
+
+
+
+
+
{% include "ldt/ldt_utils/partial/embed_links.html" %}
+
{% trans 'clik here to see the project content' %}
diff -r 29114c745efd -r e5b5e9d56eec src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/iframe_embed_player.html
--- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/partial/iframe_embed_player.html Wed Oct 10 16:19:10 2012 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-{% spaceless %}
-{% load i18n %}
-{% load thumbnail %}
-
-
-{% endspaceless %}
\ No newline at end of file
diff -r 29114c745efd -r e5b5e9d56eec src/ldt/ldt/ldt_utils/views/workspace.py
--- a/src/ldt/ldt/ldt_utils/views/workspace.py Wed Oct 10 16:19:10 2012 +0200
+++ b/src/ldt/ldt/ldt_utils/views/workspace.py Wed Oct 10 17:55:18 2012 +0200
@@ -25,6 +25,8 @@
import ldt.auth as ldt_auth
import lxml.etree
import logging
+from django.utils.safestring import SafeUnicode, mark_safe
+
@login_required
@@ -108,9 +110,6 @@
(lambda s:escape(render_to_string("ldt/ldt_utils/partial/embed_%s.html" % (s), rend_dict, context_instance=RequestContext(request))))(typestr))
for typestr in ('player', 'seo_body', 'seo_meta', 'links'))
rend_dict['embed_rendered'] = embed_rendered
- iframe=render_to_string("ldt/ldt_utils/partial/iframe_embed_player.html", rend_dict, context_instance=RequestContext(request))
- rend_dict['iframe']=iframe
- logging.debug("louiseredhotpeppers iframe : "+str(iframe)+" bla")
return render_to_response("ldt/ldt_utils/embed_popup.html", rend_dict, context_instance=RequestContext(request))
@@ -153,7 +152,7 @@
project = Project.safe_objects.get(ldt_id=ldt_id); #@UndefinedVariable
project_contents = project.contents.all()
content=project_contents[0]
- iri_id=content.iri_id
+ iframe_url = mark_safe(settings.WEB_URL+settings.BASE_URL+"ldtplatform/ldt/embediframe/?content_id="+content.iri_id)
external_url = None
if content.src is not None:
for external_src in settings.EXTERNAL_STREAM_SRC:
@@ -178,7 +177,7 @@
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,
'player_width': player_width, 'player_height': player_height, 'external_url': external_url,
- 'polemic':False, 'show_mic_record':False, 'annotations_list':False, 'iri_id': iri_id}
+ 'polemic':False, 'show_mic_record':False, 'annotations_list':False, 'iframe_url':iframe_url}
return rend_dict
diff -r 29114c745efd -r e5b5e9d56eec src/ldt/ldt/locale/fr/LC_MESSAGES/django.mo
Binary file src/ldt/ldt/locale/fr/LC_MESSAGES/django.mo has changed
diff -r 29114c745efd -r e5b5e9d56eec src/ldt/ldt/locale/fr/LC_MESSAGES/django.po
--- a/src/ldt/ldt/locale/fr/LC_MESSAGES/django.po Wed Oct 10 16:19:10 2012 +0200
+++ b/src/ldt/ldt/locale/fr/LC_MESSAGES/django.po Wed Oct 10 17:55:18 2012 +0200
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-10-08 11:10+0200\n"
+"POT-Creation-Date: 2012-10-08 18:09+0200\n"
"PO-Revision-Date: 2010-03-09 15:52+0100\n"
"Last-Translator: Yves-Marie Haussonne \n"
"Language-Team: LANGUAGE \n"
@@ -313,7 +313,7 @@
msgstr "Lignes de temps"
#: .\ldt_utils\templates\front\front_base.html.py:59
-#: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:67
+#: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:68
msgid "My projects"
msgstr "Mes projets"
@@ -412,8 +412,8 @@
#: .\ldt_utils\templates\ldt\ldt_utils\groups.html.py:113
#: .\ldt_utils\templates\ldt\ldt_utils\ldt_list.html.py:80
#: .\ldt_utils\templates\ldt\ldt_utils\published_projects.html.py:70
-#: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:55
-#: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:70
+#: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:56
+#: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:71
#: .\ldt_utils\templates\ldt\ldt_utils\partial\permissions.html.py:129
#: .\templates\ldt\ldt_base.html.py:127
msgid "search"
@@ -504,7 +504,7 @@
msgstr "Copier votre projet"
#: .\ldt_utils\templates\ldt\ldt_utils\copy_ldt.html.py:17
-#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:88
+#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:96
msgid "Title"
msgstr "Titre"
@@ -537,7 +537,7 @@
"resoumettre le formulaire media après avoir fait les changements suivants:"
#: .\ldt_utils\templates\ldt\ldt_utils\create_content.html.py:85
-#: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:52
+#: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:53
msgid "Create content"
msgstr "Créer un contenu"
@@ -546,7 +546,7 @@
msgstr "Front project actuel"
#: .\ldt_utils\templates\ldt\ldt_utils\create_content.html.py:127
-#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:141
+#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:149
#: .\ldt_utils\templates\ldt\ldt_utils\reset_confirm.html.py:39
#: .\ldt_utils\templates\ldt\ldt_utils\reset_confirm_popup.html.py:54
msgid "reset_front_project"
@@ -558,7 +558,7 @@
#: .\ldt_utils\templates\ldt\ldt_utils\create_content.html.py:145
#: .\ldt_utils\templates\ldt\ldt_utils\create_group.html.py:101
-#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:137
+#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:145
#: .\ldt_utils\templates\ldt\ldt_utils\error_confirm.html.py:37
#: .\ldt_utils\templates\ldt\ldt_utils\error_confirm_popup.html.py:53
#: .\ldt_utils\templates\ldt\ldt_utils\reset_confirm.html.py:38
@@ -615,79 +615,87 @@
msgid "hide"
msgstr "Réduire"
-#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:82
+#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:90
msgid "Update your project"
msgstr "Mettre à jour votre projet Lignes de Temps"
-#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:82
+#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:90
msgid "Create your project"
msgstr "Créer votre projet Lignes de Temps"
-#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:93
+#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:101
msgid "Description :"
msgstr "Description :"
-#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:98
+#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:106
msgid "List of contents"
msgstr "Liste de contenus"
-#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:112
+#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:120
#: .\ldt_utils\templates\ldt\ldt_utils\partial\contentslist.html.py:21
#: .\ldt_utils\templates\ldt\ldt_utils\partial\projectslist.html.py:12
#: .\ldt_utils\templates\ldt\ldt_utils\partial\publishedprojectslist.html.py:12
msgid "name"
msgstr "Nom"
-#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:128
+#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:136
msgid "More options"
msgstr "Plus d'options"
-#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:139
+#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:147
msgid "delete_project"
msgstr "Effacer"
-#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:143
+#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:151
msgid "update_project"
msgstr "Mettre à jour"
-#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:145
+#: .\ldt_utils\templates\ldt\ldt_utils\create_ldt.html.py:153
msgid "create_project"
msgstr "Créer un nouveau projet Ligne de Temps"
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:57
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:50
msgid "Hide Player"
msgstr "Masquer le Lecteur métadata "
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:61
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:74
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:54
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:67
msgid "Show Player"
msgstr "Afficher le Lecteur métadata"
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:71
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:64
msgid "project id"
msgstr "Identifiant du projet "
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:71
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:64
msgid "Select"
msgstr "Sélectionner"
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:80
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:73
msgid "popup_player"
msgstr "Code Lecteur métadata"
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:80
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:73
msgid "popup_seo_body"
msgstr "Code SEO"
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:80
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:73
msgid "popup_seo_meta"
msgstr "Code balise meta en-tête"
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:80
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:73
msgid "popup_links"
msgstr "Liste de liens"
-#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:100
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:82
+msgid "Use the div integration mode"
+msgstr "Utiliser le mode d'integration div"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:83
+msgid "Use the iframe integration mode"
+msgstr "Utiliser le mode d'integration iframe"
+
+#: .\ldt_utils\templates\ldt\ldt_utils\embed_popup.html.py:95
msgid "clik here to see the project content"
msgstr "cliquer ici pour voir le contenu du projet"
@@ -753,7 +761,7 @@
msgstr "Projets publiés"
#: .\ldt_utils\templates\ldt\ldt_utils\published_projects.html.py:68
-#: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:68
+#: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:69
msgid "Create project"
msgstr "Créer un nouveau projet d'indexation"
@@ -788,7 +796,7 @@
msgid "Page %(number)s of %(num_pages)s"
msgstr "Page %(number)s de %(num_pages)s"
-#: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:51
+#: .\ldt_utils\templates\ldt\ldt_utils\workspace_base.html.py:52
msgid "content list"
msgstr "Liste des contenus"
@@ -986,7 +994,7 @@
"(project_titles)s'.Veuillez les effacer préalablement."
#: .\ldt_utils\views\json.py:40 .\ldt_utils\views\rdf.py:15
-#: .\ldt_utils\views\workspace.py:173
+#: .\ldt_utils\views\workspace.py:175
msgid "You can not access this project"
msgstr "vous n'avez pas l'autorisation d'accéder à ce projet"
diff -r 29114c745efd -r e5b5e9d56eec src/ldt/ldt/static/ldt/js/embed_popup.js
--- a/src/ldt/ldt/static/ldt/js/embed_popup.js Wed Oct 10 16:19:10 2012 +0200
+++ b/src/ldt/ldt/static/ldt/js/embed_popup.js Wed Oct 10 17:55:18 2012 +0200
@@ -16,6 +16,13 @@
$j(document).ready(function(){
toggle_display();
+ $j("#player_id_code").focus();
+ $j("#player_id_code").select();
+
+ $j("#project_id_select").click(function(){
+ $j("#project_id_input").focus();
+ $j("#project_id_input").select();
+ });
$j('.ldt_json_link').click(function(e) {
e.preventDefault();
@@ -44,6 +51,22 @@
$j("#copy_button").click(function(e) {
alert($j("#"+display_state+"_code").html());
- });
+ });
+
+ $j("#player_button").click(function(){
+ $j("#player_id_code").focus();
+ $j("#player_id_code").select();
+ });
+
+ $j("#seo_body_button").click(function(){
+ $j("#seo_body_id_code").focus();
+ $j("#seo_body_id_code").select();
+ });
+ $j("#seo_meta_button").click(function(){
+ $j("#seo_meta_id_code").focus();
+ $j("#seo_meta_id_code").select();
+ });
});
+
+