# HG changeset patch # User cavaliet # Date 1370426180 -7200 # Node ID 5dddae65a99ad34abe4360e9d9a76658d2b9cf3e # Parent 0e4fa3991906f7ab104009a3cc673fe695586ee8 iframe modal used for content preview diff -r 0e4fa3991906 -r 5dddae65a99a integration/js/common.js --- a/integration/js/common.js Tue Jun 04 17:17:17 2013 +0200 +++ b/integration/js/common.js Wed Jun 05 11:56:20 2013 +0200 @@ -12,6 +12,7 @@ modalTitleInfo = $(this).attr('data-title'), hideBibliotheque = $(this).hasAttr('data-hide-bibliotheque') ? true : false, hideAddNew = $(this).hasAttr('data-hide-add-new') ? true : false, + isIframe = $(this).hasAttr('data-iframe') ? true : false, titleFront; switch(typeMedia){ @@ -19,15 +20,25 @@ case 'image' : titleFront = ' Image - '+modalTitleInfo; break; } $('#modal-template .modal-header h3').html(titleFront); - - $("#modal-template .modal-body").load(modalRemote, function() { - $("#modal-template").modal("show"); + + if(isIframe){ if(hideBibliotheque) $("#modal-template").find(".bibliotheque-link").hide(); if(hideAddNew) $("#modal-template").find(".add-new").hide(); - }); + $("#modal-template .modal-body").html(''); + $("#modal-template").modal("show"); + } + else{ + $("#modal-template .modal-body").load(modalRemote, function() { + $("#modal-template").modal("show"); + if(hideBibliotheque) + $("#modal-template").find(".bibliotheque-link").hide(); + if(hideAddNew) + $("#modal-template").find(".add-new").hide(); + }); + } }); $('.popup').on('click', '.popup-content a', function(e){ @@ -43,6 +54,11 @@ }); +// empty modal when closed + $("#modal-template .modal-header .close").click(function(e){ + $("#modal-template .modal-body").html(''); + }); + //confirmation suppression $(document).on('click','.btn-delete', function(e){ e.preventDefault(); diff -r 0e4fa3991906 -r 5dddae65a99a src/metadatacomposer/static/metadatacomposer/js/common.js --- a/src/metadatacomposer/static/metadatacomposer/js/common.js Tue Jun 04 17:17:17 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/js/common.js Wed Jun 05 11:56:20 2013 +0200 @@ -12,6 +12,7 @@ modalTitleInfo = $(this).attr('data-title'), hideBibliotheque = $(this).hasAttr('data-hide-bibliotheque') ? true : false, hideAddNew = $(this).hasAttr('data-hide-add-new') ? true : false, + isIframe = $(this).hasAttr('data-iframe') ? true : false, titleFront; switch(typeMedia){ @@ -19,15 +20,25 @@ case 'image' : titleFront = ' Image - '+modalTitleInfo; break; } $('#modal-template .modal-header h3').html(titleFront); - - $("#modal-template .modal-body").load(modalRemote, function() { - $("#modal-template").modal("show"); + + if(isIframe){ if(hideBibliotheque) $("#modal-template").find(".bibliotheque-link").hide(); if(hideAddNew) $("#modal-template").find(".add-new").hide(); - }); + $("#modal-template .modal-body").html(''); + $("#modal-template").modal("show"); + } + else{ + $("#modal-template .modal-body").load(modalRemote, function() { + $("#modal-template").modal("show"); + if(hideBibliotheque) + $("#modal-template").find(".bibliotheque-link").hide(); + if(hideAddNew) + $("#modal-template").find(".add-new").hide(); + }); + } }); $('.popup').on('click', '.popup-content a', function(e){ @@ -43,6 +54,11 @@ }); +// empty modal when closed + $("#modal-template .modal-header .close").click(function(e){ + $("#modal-template .modal-body").html(''); + }); + //confirmation suppression $(document).on('click','.btn-delete', function(e){ e.preventDefault(); diff -r 0e4fa3991906 -r 5dddae65a99a src/metadatacomposer/templates/metadatacomposer_home.html --- a/src/metadatacomposer/templates/metadatacomposer_home.html Tue Jun 04 17:17:17 2013 +0200 +++ b/src/metadatacomposer/templates/metadatacomposer_home.html Wed Jun 05 11:56:20 2013 +0200 @@ -98,7 +98,7 @@
{% for c in contents %}
- + {% thumbnail c.image "140x140" crop="center" format="PNG" as im %}{% empty %}{% endthumbnail %}

{{ c.title }}

diff -r 0e4fa3991906 -r 5dddae65a99a src/metadatacomposer/templates/metadatacomposer_project_list.html --- a/src/metadatacomposer/templates/metadatacomposer_project_list.html Tue Jun 04 17:17:17 2013 +0200 +++ b/src/metadatacomposer/templates/metadatacomposer_project_list.html Wed Jun 05 11:56:20 2013 +0200 @@ -35,7 +35,7 @@ {% thumbnail p.image "60x60" crop="center" format="PNG" as im %}{% empty %}{% endthumbnail %} {{ p.title }} - {% with c=p.contents.all|first %}{{ c.title }}{% endwith %} + {% with c=p.contents.all|first %}{{ c.title }}{% endwith %} {{ p.modification_date|date:"Y/m/d" }}
diff -r 0e4fa3991906 -r 5dddae65a99a src/metadatacomposer/templates/metadatacomposer_resource_list.html --- a/src/metadatacomposer/templates/metadatacomposer_resource_list.html Tue Jun 04 17:17:17 2013 +0200 +++ b/src/metadatacomposer/templates/metadatacomposer_resource_list.html Wed Jun 05 11:56:20 2013 +0200 @@ -20,7 +20,7 @@

Liste des images

@@ -35,7 +35,8 @@

Liste des vidéos

diff -r 0e4fa3991906 -r 5dddae65a99a src/metadatacomposer/templates/partial/resource_content_list.html --- a/src/metadatacomposer/templates/partial/resource_content_list.html Tue Jun 04 17:17:17 2013 +0200 +++ b/src/metadatacomposer/templates/partial/resource_content_list.html Wed Jun 05 11:56:20 2013 +0200 @@ -16,7 +16,7 @@ {% for res in content_results %} - + {% thumbnail res.content.image "60x60" crop="center" format="PNG" as im %}{% empty %}{% endthumbnail %} {{ res.content.title }}