# HG changeset patch # User Anthony Ly # Date 1372414377 -7200 # Node ID af621f52de704531e3e245ac397f097422e20f2b # Parent 4b67b2e26925744fc09e6feec44e227d1e92d6a9# Parent 8eaa85e0eb1d310247f75bef719848fa0bddde61 Merge diff -r 4b67b2e26925 -r af621f52de70 .hgtags --- a/.hgtags Fri Jun 28 12:10:28 2013 +0200 +++ b/.hgtags Fri Jun 28 12:12:57 2013 +0200 @@ -18,3 +18,6 @@ 741e46d64fdc06f9cef901bbd9fd8d0e5c259d8c V00.05 8ff52b74468391ba8980049d4119a7b1892d9415 V00.06 7263f299f37f92b31229f225603f9c2537d59b4a V00.06.01 +2b5ca2fb400239ba042702a3da126b7e4538f610 V00.06.02 +2d361643660fc6d48bcbe6141c5bb113799f0403 V00.06.03 +5f04dbb9cbaaf7d4e15d2fd9d4d282b2ffdf88f8 V00.06.04 diff -r 4b67b2e26925 -r af621f52de70 integration/v2/04-slideshow.html --- a/integration/v2/04-slideshow.html Fri Jun 28 12:10:28 2013 +0200 +++ b/integration/v2/04-slideshow.html Fri Jun 28 12:12:57 2013 +0200 @@ -18,14 +18,21 @@
-

-

+
+ + + + + + + +
@@ -41,24 +48,35 @@ var imgurlbase = "http://egonomy.iri-research.org/static/media/"; var slides = [ { + "type": "fragment", + "title": "Cavalier", + "author": "Oudry Jean Baptiste (1686-1755)", + "src": "images/6/03-005639.jpg", + "path": "M0.5252 0.4293L0.6764 0.4327L0.6827 0.4137L0.7058 0.4189L0.7058 0.3844L0.7331 0.3724L0.7857 0.3948L0.7773 0.4120L0.7647 0.4327L0.7857 0.45L0.7899 0.4775L0.7983 0.5189L0.7794 0.5431L0.7226 0.6034L0.7037 0.6051L0.6533 0.7137L0.6302 0.6965L0.6470 0.6068L0.6365 0.5431L0.6470 0.5086L0.6680 0.4655L0.6323 0.4741L0.5777 0.4758L0.5357 0.4517L0.5273 0.4413Z", + "description": "Extrait de Cerf aux abois dans les rochers de Franchard, forêt de Fontainebleau.\nLorem ipsum dolor" + }, { + "type": "image", "title": "Chicago, Art Institute de la série : Vitraux", "author": "Chagall Marc (1887-1985)", - "url": "images/36/00-015454.jpg", + "src": "images/36/00-015454.jpg", "description": "En 1930, le marchand d'art et ami de Chagall, Ambroise Vollard, lui commande une série d'illustrations sur la Bible. Celui qui décrit le texte sacré comme « la plus grande source de poésie de tous les temps », exécute alors une quarantaine de gouaches, avant d'entamer une série d'eaux-fortes qui sont insérées au sein de la Bible de Genève : 105 gravures figurent diverses scènes-clés de l'Ancien Testament. À la main, Chagall les rehausse toutes d'un peu de gouache. Ses sujets de prédilection sont les prophètes, les patriarches, les guerriers et les rois. Surtout, il fait des liens entre le passé et le présent, entre la persécution de Jésus et celle que les Juifs subissent en Europe dans les années 1940." }, { + "type": "image", "title": "La Création du monde, le septième jour", "author": "Chagall Marc (1887-1985)", - "url": "images/3/08-523123.jpg", - "description": "En 1930, le marchand d'art et ami de Chagall, Ambroise Vollard, lui commande une série d'illustrations sur la Bible. Celui qui décrit le texte sacré comme « la plus grande source de poésie de tous les temps », exécute alors une quarantaine de gouaches, avant d'entamer une série d'eaux-fortes qui sont insérées au sein de la Bible de Genève : 105 gravures figurent diverses scènes-clés de l'Ancien Testament. À la main, Chagall les rehausse toutes d'un peu de gouache. Ses sujets de prédilection sont les prophètes, les patriarches, les guerriers et les rois. Surtout, il fait des liens entre le passé et le présent, entre la persécution de Jésus et celle que les Juifs subissent en Europe dans les années 1940." + "src": "images/3/08-523123.jpg", + "description": "En 1930, le marchand d'art et ami de Chagall, Ambroise Vollard, lui commande une série d'illustrations sur la Bible." }, { + "type": "image", "title": "La création de l'homme", "author": "Chagall Marc (1887-1985)", - "url": "images/3/09-584017.jpg", + "src": "images/3/09-584017.jpg", "description": "En 1930, le marchand d'art et ami de Chagall, Ambroise Vollard, lui commande une série d'illustrations sur la Bible. Celui qui décrit le texte sacré comme « la plus grande source de poésie de tous les temps », exécute alors une quarantaine de gouaches, avant d'entamer une série d'eaux-fortes qui sont insérées au sein de la Bible de Genève : 105 gravures figurent diverses scènes-clés de l'Ancien Testament. À la main, Chagall les rehausse toutes d'un peu de gouache. Ses sujets de prédilection sont les prophètes, les patriarches, les guerriers et les rois. Surtout, il fait des liens entre le passé et le présent, entre la persécution de Jésus et celle que les Juifs subissent en Europe dans les années 1940." }, { + "type": "image", "title": "Le Cantique des Cantiques II", "author": "Chagall Marc (1887-1985)", - "url": "images/57/10-500374.jpg", + "src": "images/57/10-500374.jpg", "description": "En 1930, le marchand d'art et ami de Chagall, Ambroise Vollard, lui commande une série d'illustrations sur la Bible. Celui qui décrit le texte sacré comme « la plus grande source de poésie de tous les temps », exécute alors une quarantaine de gouaches, avant d'entamer une série d'eaux-fortes qui sont insérées au sein de la Bible de Genève : 105 gravures figurent diverses scènes-clés de l'Ancien Testament. À la main, Chagall les rehausse toutes d'un peu de gouache. Ses sujets de prédilection sont les prophètes, les patriarches, les guerriers et les rois. Surtout, il fait des liens entre le passé et le présent, entre la persécution de Jésus et celle que les Juifs subissent en Europe dans les années 1940." } ]; diff -r 4b67b2e26925 -r af621f52de70 integration/v2/css/slideshow.css --- a/integration/v2/css/slideshow.css Fri Jun 28 12:10:28 2013 +0200 +++ b/integration/v2/css/slideshow.css Fri Jun 28 12:12:57 2013 +0200 @@ -10,7 +10,7 @@ position: absolute; opacity: .3; -webkit-filter: blur(5px); filter: blur(5px); } -.main-image { +.image-container { position: absolute; top: 50px; right: 50px; } @@ -24,7 +24,7 @@ padding: 16px 0; margin: 0; } -.main-image, .caption { +.caption { box-shadow: 4px 4px 2px rgba(0,0,0,.5); } diff -r 4b67b2e26925 -r af621f52de70 integration/v2/css/style.css --- a/integration/v2/css/style.css Fri Jun 28 12:10:28 2013 +0200 +++ b/integration/v2/css/style.css Fri Jun 28 12:12:57 2013 +0200 @@ -209,11 +209,11 @@ .list-keywords a{color: #7F7F7F; font-family: 'Lato'; font-size: 12px; display: inline-block; height: 28px; line-height: 28px; padding: 0 30px 0 6px;background-position: right 4px center; background-repeat: no-repeat; background-color: #fff;} .list-keywords a:hover{-webkit-box-shadow: none;-moz-box-shadow: none;box-shadow: none;} .filters{padding: 10px 0; text-align: center;} -.filters li{ margin-bottom: 10px; position: relative; text-align: left; font-size: 12px; font-family: 'Lato'; display:inline-block; width: 200px; height: 28px; line-height: 28px; background-color: #fff;} +.filters li{background-color: #FFFFFF;display: inline-block;font-family: 'Lato';font-size: 12px;height: 20px;line-height: 20px;margin-bottom: 2px;position: relative;text-align: left;width: 200px;} .filters a.display-keyword:first-child{ overflow: hidden; color: #7F7F7F; padding-left: 6px; display: block; } .filters a.display-keyword{padding-left: 6px;} .filters li:hover{-webkit-box-shadow : none; -moz-box-shadow : none; box-shadow : none;} -.filters .icon-action{position: absolute; top: 10px; right: 6px;width: 10px; height: 10px; display: inline-block;} +.filters .icon-action{position: absolute; top: 5px; right: 6px;width: 10px; height: 10px; display: inline-block;} .filters li.disabled .icon-action{width: 10px; height: 10px; -webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; background-color: #7F7F7F;} .filters li.disabled a{opacity: 0.5;} .filters li .icon-action{background: url(../img/icon-cross-10.png) 0 0 no-repeat;} diff -r 4b67b2e26925 -r af621f52de70 integration/v2/js/slideshow.js --- a/integration/v2/js/slideshow.js Fri Jun 28 12:10:28 2013 +0200 +++ b/integration/v2/js/slideshow.js Fri Jun 28 12:12:57 2013 +0200 @@ -1,7 +1,11 @@ $(function() { var currentSlide = 0, jqwin = $(window), jqcaption = $(".caption"), - margin = 50, jqmainimg = $(".main-image"), jqbackdrop = $(".backdrop"), + margin = 50, + jqimgcontainer = $(".image-container"), + jqmainimg = $(".main-image"), + jqbackdrop = $(".backdrop"), + jqpath = $(".clip-path"), lastSlide = null; function showSlide() { @@ -10,34 +14,53 @@ if (slide !== lastSlide) { jqcaption.find("h2").text(slide.title); jqcaption.find("h3").text(slide.author); - jqcaption.find("p").text(slide.description); - jqmainimg.attr("src", slide.image.src); + var captiondiv = jqcaption.find(".caption-description"); + captiondiv.empty(); + slide.description.split(/\s*[\r\n]\s*/gm).forEach(function(p) { + captiondiv.append($("

").text(p)); + }); + jqmainimg.attr("xlink:href", slide.image.src); jqbackdrop.attr("src", slide.image.src); + jqpath.attr("d", slide.path); } lastSlide = slide; if (slide.image && slide.image.width) { - var ww = jqwin.width(), + var pathcoords = slide.path.match(/[\d\.]+/g), + pathx = pathcoords.filter(function(p,i) { + return !(i%2); + }), + pathy = pathcoords.filter(function(p,i) { + return (i%2); + }), + minpx = Math.min.apply(Math,pathx), + maxpx = Math.max.apply(Math,pathx), + minpy = Math.min.apply(Math,pathy), + maxpy = Math.max.apply(Math,pathy), + ww = jqwin.width(), wh = jqwin.height(), cw = jqcaption.outerWidth(), ch = jqcaption.outerHeight(), wi = slide.image.width, - hi = slide.image.height, + hi = slide.image.height, + wp = wi * (maxpx - minpx), + hp = hi * (maxpy - minpy), w1 = ww - 2 * margin, w2 = w1 - cw h1 = wh - 2 * margin, h2 = h1 - ch, ra = Math.max( - Math.min((h1 / hi), (w2 / wi)), - Math.min((h2 / hi), (w1 / wi)) + Math.min((h1 / hp), (w2 / wp)), + Math.min((h2 / hp), (w1 / wp)) ), - wa = wi * ra, ha = hi * ra, + wa = wp * ra, ha = hp * ra, rb = Math.max(ww / wi, wh / hi), wb = wi * rb, hb = hi * rb, xb = (ww - wb) / 2, yb = (wh - hb) / 2; - jqmainimg.css({ + jqimgcontainer.css({ width: wa, height: ha }); + jqimgcontainer[0].setAttribute("viewBox", [minpx,minpy,(maxpx-minpx),(maxpy-minpy)].join(" ")); jqbackdrop.css({ width: wb, height: hb, @@ -86,13 +109,16 @@ $(".right-arrow").click(nextSlide); slides.forEach(function(slide, k) { + if (!slide.path) { + slide.path = "M0 0L1 0L1 1L0 1Z" + } slide.image = new Image(); slide.image.onload = function() { if (k === currentSlide) { showSlide(); } }; - slide.image.src = imgurlbase + slide.url; + slide.image.src = imgurlbase + slide.src; }); showSlide(); diff -r 4b67b2e26925 -r af621f52de70 src/egonomy/__init__.py --- a/src/egonomy/__init__.py Fri Jun 28 12:10:28 2013 +0200 +++ b/src/egonomy/__init__.py Fri Jun 28 12:12:57 2013 +0200 @@ -1,4 +1,4 @@ -VERSION = (0, 6, 1, "final", 1) +VERSION = (0, 6, 4, "final", 1) VERSION_STR = unicode(".".join(map(lambda i:"%02d" % (i,), VERSION[:2]))) diff -r 4b67b2e26925 -r af621f52de70 src/egonomy/models.py --- a/src/egonomy/models.py Fri Jun 28 12:10:28 2013 +0200 +++ b/src/egonomy/models.py Fri Jun 28 12:12:57 2013 +0200 @@ -176,13 +176,15 @@ class Collection(models.Model): - SLIDESHOW = 1 + LIST = 1 MOSAIC = 2 - GEOGRAPHICAL = 3 + SLIDESHOW = 3 + GEOGRAPHICAL = 4 PUBLICATION_CHOICES = ( + (LIST, 'list'), + (MOSAIC, 'mosaic'), (SLIDESHOW, 'slideshow'), - (MOSAIC, 'mosaic'), (GEOGRAPHICAL, 'geographical') ) @@ -193,7 +195,7 @@ creation = models.DateTimeField(auto_now_add=True) modification = models.DateTimeField(auto_now=True) public = models.BooleanField(null=False, default=True) # Collection is published or not, always published by default - publication_type = models.IntegerField(choices=PUBLICATION_CHOICES, default=1) # slideshow, mosaic ou geographical + publication_type = models.IntegerField(choices=PUBLICATION_CHOICES, default=1) # list, mosaic, slideshow or geographical diff -r 4b67b2e26925 -r af621f52de70 src/egonomy/static/egonomy/css/slideshow.css --- a/src/egonomy/static/egonomy/css/slideshow.css Fri Jun 28 12:10:28 2013 +0200 +++ b/src/egonomy/static/egonomy/css/slideshow.css Fri Jun 28 12:12:57 2013 +0200 @@ -10,7 +10,7 @@ position: absolute; opacity: .3; -webkit-filter: blur(5px); filter: blur(5px); } -.main-image { +.image-container { position: absolute; top: 50px; right: 50px; } @@ -24,7 +24,7 @@ padding: 16px 0; margin: 0; } -.main-image, .caption { +.caption { box-shadow: 4px 4px 2px rgba(0,0,0,.5); } diff -r 4b67b2e26925 -r af621f52de70 src/egonomy/static/egonomy/css/style.css --- a/src/egonomy/static/egonomy/css/style.css Fri Jun 28 12:10:28 2013 +0200 +++ b/src/egonomy/static/egonomy/css/style.css Fri Jun 28 12:12:57 2013 +0200 @@ -233,12 +233,19 @@ .item-masonry{margin-bottom: 20px;} .filters{padding: 10px 0; text-align: center;} -.filters li{ margin-bottom: 10px; position: relative; text-align: left; font-size: 12px; font-family: 'Lato'; display:inline-block; width: 200px; height: 28px; line-height: 28px; background-color: #fff;} -.filters a.display-keyword{ overflow: hidden; color: #7F7F7F; display: block; height: 28px; overflow: hidden; margin: 0 16px 0 6px; } +.filters li{background-color: #FFFFFF;display: inline-block;font-family: 'Lato';font-size: 12px;height: 20px;line-height: 20px;margin-bottom: 2px;position: relative;text-align: left;width: 200px;} + +.filters a.display-keyword:first-child{ overflow: hidden; color: #7F7F7F; padding-left: 6px; display: block; } +.filters a.display-keyword{padding-left: 6px;} .filters li:hover{-webkit-box-shadow : none; -moz-box-shadow : none; box-shadow : none;} -.filters a.icon-action{float: right; margin: 10px 6px 0 0;width: 10px; height: 10px; display: inline-block; background: url(../img/icon-cross-10.png) 0 0 no-repeat; } -.filters .disabled .icon-action{width: 10px; height: 10px; -webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; background: #7F7F7F;} -.filters .disabled a.display-keyword{opacity: 0.5;} + +.filters .icon-action{position: absolute; top: 5px; right: 6px;width: 10px; height: 10px; display: inline-block;} + +.filters li.disabled .icon-action{width: 10px; height: 10px; -webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; background-color: #7F7F7F;} +.filters li.disabled a{opacity: 0.5;} + + +.filters li .icon-action{background: url(../img/icon-cross-10.png) 0 0 no-repeat;} .float-left{float: left;} .filters-wrap{width: 225px; background-color: #EEE; margin-right: 17px;} diff -r 4b67b2e26925 -r af621f52de70 src/egonomy/static/egonomy/js/keyword-mosaic.js --- a/src/egonomy/static/egonomy/js/keyword-mosaic.js Fri Jun 28 12:10:28 2013 +0200 +++ b/src/egonomy/static/egonomy/js/keyword-mosaic.js Fri Jun 28 12:12:57 2013 +0200 @@ -106,5 +106,12 @@ } updateMasonry(); }); - + + //filters + $('.filters a').each(function(){ + var text = $.trim($(this).text()); + if(text.length > 26){ + $(this).text(text.substr(0, 26) + '...') + } + }); }); diff -r 4b67b2e26925 -r af621f52de70 src/egonomy/static/egonomy/js/main.js --- a/src/egonomy/static/egonomy/js/main.js Fri Jun 28 12:10:28 2013 +0200 +++ b/src/egonomy/static/egonomy/js/main.js Fri Jun 28 12:12:57 2013 +0200 @@ -1,11 +1,5 @@ $(function(){ -//filters - $('.filters a').each(function(){ - var text = $.trim($(this).text()); - if(text.length > 30){ - $(this).text(text.substr(0, 30) + '...') - } - }); + //masonry var masonry465 = $('.masonry-465'); masonry465.masonry({ @@ -53,6 +47,7 @@ }); } + // add item to collection behaviour $('.additemtocollection').bind('click', function(e){ @@ -64,27 +59,27 @@ }); - //map + if($('#map').length){ initmap() } -function initmap() { - // set up the map - map = new L.Map('map'); + function initmap() { + // set up the map + map = new L.Map('map'); - // create the tile layer with correct attribution - var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; - var osm = new L.TileLayer(osmUrl, {minZoom: 3, maxZoom: 20}); + // create the tile layer with correct attribution + var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; + var osm = new L.TileLayer(osmUrl, {minZoom: 3, maxZoom: 20}); - // start the map in South-East England - map.setView(new L.LatLng(48.833, 2.333),4); - map.addLayer(osm); + // start the map in South-East England + map.setView(new L.LatLng(48.833, 2.333),4); + map.addLayer(osm); - // markers - var marker1 = L.marker([48.833, 2.333]).addTo(map); - marker1.bindPopup("Beaux-Arts de Paris"); - var marker2 = L.marker([47.233,-1.583]).addTo(map); - marker2.bindPopup("Beaux-Arts de Nantes"); -} + // markers + var marker1 = L.marker([48.833, 2.333]).addTo(map); + marker1.bindPopup("Beaux-Arts de Paris"); + var marker2 = L.marker([47.233,-1.583]).addTo(map); + marker2.bindPopup("Beaux-Arts de Nantes"); + } });//ready \ No newline at end of file diff -r 4b67b2e26925 -r af621f52de70 src/egonomy/static/egonomy/js/slideshow.js --- a/src/egonomy/static/egonomy/js/slideshow.js Fri Jun 28 12:10:28 2013 +0200 +++ b/src/egonomy/static/egonomy/js/slideshow.js Fri Jun 28 12:12:57 2013 +0200 @@ -1,7 +1,11 @@ $(function() { var currentSlide = 0, jqwin = $(window), jqcaption = $(".caption"), - margin = 50, jqmainimg = $(".main-image"), jqbackdrop = $(".backdrop"), + margin = 50, + jqimgcontainer = $(".image-container"), + jqmainimg = $(".main-image"), + jqbackdrop = $(".backdrop"), + jqpath = $(".clip-path"), lastSlide = null; function showSlide() { @@ -10,34 +14,53 @@ if (slide !== lastSlide) { jqcaption.find("h2").text(slide.title); jqcaption.find("h3").text(slide.author); - jqcaption.find("p").text(slide.description); - jqmainimg.attr("src", slide.image.src); + var captiondiv = jqcaption.find(".caption-description"); + captiondiv.empty(); + slide.description.split(/\s*[\r\n]\s*/gm).forEach(function(p) { + captiondiv.append($("

").text(p)); + }); + jqmainimg.attr("xlink:href", slide.image.src); jqbackdrop.attr("src", slide.image.src); + jqpath.attr("d", slide.path); } lastSlide = slide; if (slide.image && slide.image.width) { - var ww = jqwin.width(), + var pathcoords = slide.path.match(/[\d\.]+/g), + pathx = pathcoords.filter(function(p,i) { + return !(i%2); + }), + pathy = pathcoords.filter(function(p,i) { + return (i%2); + }), + minpx = Math.min.apply(Math,pathx), + maxpx = Math.max.apply(Math,pathx), + minpy = Math.min.apply(Math,pathy), + maxpy = Math.max.apply(Math,pathy), + ww = jqwin.width(), wh = jqwin.height(), cw = jqcaption.outerWidth(), ch = jqcaption.outerHeight(), wi = slide.image.width, - hi = slide.image.height, + hi = slide.image.height, + wp = wi * (maxpx - minpx), + hp = hi * (maxpy - minpy), w1 = ww - 2 * margin, w2 = w1 - cw h1 = wh - 2 * margin, h2 = h1 - ch, ra = Math.max( - Math.min((h1 / hi), (w2 / wi)), - Math.min((h2 / hi), (w1 / wi)) + Math.min((h1 / hp), (w2 / wp)), + Math.min((h2 / hp), (w1 / wp)) ), - wa = wi * ra, ha = hi * ra, + wa = wp * ra, ha = hp * ra, rb = Math.max(ww / wi, wh / hi), wb = wi * rb, hb = hi * rb, xb = (ww - wb) / 2, yb = (wh - hb) / 2; - jqmainimg.css({ + jqimgcontainer.css({ width: wa, height: ha }); + jqimgcontainer[0].setAttribute("viewBox", [minpx,minpy,(maxpx-minpx),(maxpy-minpy)].join(" ")); jqbackdrop.css({ width: wb, height: hb, @@ -86,13 +109,16 @@ $(".right-arrow").click(nextSlide); slides.forEach(function(slide, k) { + if (!slide.path) { + slide.path = "M0 0L1 0L1 1L0 1Z" + } slide.image = new Image(); slide.image.onload = function() { if (k === currentSlide) { showSlide(); } }; - slide.image.src = imgurlbase + slide.url; + slide.image.src = imgurlbase + slide.src; }); showSlide(); diff -r 4b67b2e26925 -r af621f52de70 src/egonomy/templates/egonomy_embed_slideshow.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/egonomy/templates/egonomy_embed_slideshow.html Fri Jun 28 12:12:57 2013 +0200 @@ -0,0 +1,79 @@ +{% load static %} +{% load i18n %} +{% load egostringfilters %} + + + + + + + + + + eGonomy : Diaporama + + + + + +

+ +
+
+

+

+
+
+
+ + + + + + + + +
+ +
+
+ +
+
+ + + + + + \ No newline at end of file diff -r 4b67b2e26925 -r af621f52de70 src/egonomy/templates/egonomy_view_collection.html --- a/src/egonomy/templates/egonomy_view_collection.html Fri Jun 28 12:10:28 2013 +0200 +++ b/src/egonomy/templates/egonomy_view_collection.html Fri Jun 28 12:12:57 2013 +0200 @@ -1,7 +1,6 @@ {% extends "egonomy_newbase.html" %} {% load static %} {% load i18n %} -{% load thumbnail %} {% block title %}{% trans "View a collection" %}{% endblock %} @@ -83,12 +82,14 @@

{{ col.title }} / par {{ col.author }}

@@ -106,7 +107,7 @@
{% if items %} - {% ifequal display "slideshow" %} + {% ifequal display "list" %}