| author | veltr |
| Wed, 14 Aug 2013 16:42:33 +0200 | |
| changeset 87 | 70cc8154164c |
| parent 86 | bf707ad8aa1a |
| child 88 | 87443e64bece |
--- a/src/jocondelab/locale/en/LC_MESSAGES/django.po Fri Aug 09 20:08:40 2013 +0200 +++ b/src/jocondelab/locale/en/LC_MESSAGES/django.po Wed Aug 14 16:42:33 2013 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-07-30 16:14+0200\n" +"POT-Creation-Date: 2013-08-12 04:17-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -16,7 +16,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: admin.py:11 forms.py:173 +#: admin.py:11 forms.py:179 msgid "language" msgstr "language" @@ -97,6 +97,31 @@ msgid "French" msgstr "French" +#: settings.py:43 +msgid "English" +msgstr "" + +#: templates/jocondelab/front_search.html:10 +#: templates/jocondelab/front_search.html:12 +msgid "Multilingual search" +msgstr "" + +#: templates/jocondelab/front_search.html:29 +msgid "Title:" +msgstr "" + +#: templates/jocondelab/front_search.html:30 +msgid "Denomination:" +msgstr "" + +#: templates/jocondelab/front_search.html:31 +msgid "Author(s):" +msgstr "" + +#: templates/jocondelab/front_search.html:35 +msgid ":" +msgstr "" + #: templates/jocondelab/term_edit.html:73 msgid "prev" msgstr "prev"
--- a/src/jocondelab/locale/fr/LC_MESSAGES/django.po Fri Aug 09 20:08:40 2013 +0200 +++ b/src/jocondelab/locale/fr/LC_MESSAGES/django.po Wed Aug 14 16:42:33 2013 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-07-30 16:14+0200\n" +"POT-Creation-Date: 2013-08-12 04:17-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -17,7 +17,7 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: admin.py:11 forms.py:173 +#: admin.py:11 forms.py:179 msgid "language" msgstr "langue" @@ -98,6 +98,56 @@ msgid "French" msgstr "Français" +#: settings.py:43 +msgid "English" +msgstr "Anglais" + +#: templates/jocondelab/front_search.html:10 +#: templates/jocondelab/front_search.html:12 +msgid "Multilingual search" +msgstr "Recherche multilingue" + +#: templates/jocondelab/front_search.html:29 +msgid "Title:" +msgstr "Titre :" + +#: templates/jocondelab/front_search.html:30 +msgid "Denomination:" +msgstr "Dénomination :" + +#: templates/jocondelab/front_search.html:31 +msgid "Author(s):" +msgstr "Auteur(s) :" + +#: templates/jocondelab/front_search.html:35 +msgid ":" +msgstr " :" + +# Thesaurus Identifiers +msgid "AUTR" +msgstr "Auteur" + +msgid "DOMN" +msgstr "Domaine" + +msgid "ECOL" +msgstr "École" + +msgid "EPOQ" +msgstr "Époque" + +msgid "LIEUX" +msgstr "Lieu" + +msgid "PERI" +msgstr "Période" + +msgid "REPR" +msgstr "Sujet représenté" + +msgid "SREP" +msgstr "Source de la représentation" + #: templates/jocondelab/term_edit.html:73 msgid "prev" msgstr "préc." @@ -190,6 +240,3 @@ #: templates/registration/login.html:19 msgid "login" msgstr "connex." - -msgid "English" -msgstr "Anglais"
--- a/src/jocondelab/migrations/0005_populate_dbpedia_table.py Fri Aug 09 20:08:40 2013 +0200 +++ b/src/jocondelab/migrations/0005_populate_dbpedia_table.py Wed Aug 14 16:42:33 2013 +0200 @@ -44,6 +44,7 @@ def backwards(self, orm): # Clearing table 'DbpediaResource' + db.clear_table(u'jocondelab_dbpediatranslation') db.clear_table(u'jocondelab_dbpediaresource')
--- a/src/jocondelab/settings.py Fri Aug 09 20:08:40 2013 +0200 +++ b/src/jocondelab/settings.py Wed Aug 14 16:42:33 2013 +0200 @@ -41,8 +41,6 @@ LANGUAGES = ( ('fr', ugettext('French')), ('en', ugettext('English')), - ('es', ugettext('Spanish')), - ('it', ugettext('Italian')), )
--- a/src/jocondelab/static/jocondelab/css/front-common.css Fri Aug 09 20:08:40 2013 +0200 +++ b/src/jocondelab/static/jocondelab/css/front-common.css Wed Aug 14 16:42:33 2013 +0200 @@ -66,6 +66,14 @@ /* END OF THE RESET PART */ +a { + text-decoration: none; color: inherit; +} + +a:hover { + text-decoration: underline; +} + /* FONT DECLARATIONS */ @font-face { @@ -117,8 +125,12 @@ /* HEADER > TITLE */ +header { + position: relative; height: 70px; +} + .main-title { - float: left; line-height: 50px; margin: 10px 0; + float: left; margin-top: 10px; height: 50px; line-height: 50px; } .main-title h1, .main-title h2 { @@ -129,18 +141,33 @@ font-size: 26px; } -.main-title h2 { +.breadcrumbs { font-size: 16px; } +.breadcrumbs:before { + content: "»"; margin: 0 5px; +} + .title-lab { font-weight: 800; } +/* HEADER > SEARCH FORM */ + +.header-search-form { + position: absolute; top: 32px; right: 0; max-width: 35%; text-align: right; +} + +.header-search-input { + margin: 0 auto; width: 260px; max-width: 90%; line-height: 28px; height: 28px; font-size: 16px; font-family: 'OpenSans'; padding: 0 9px; + border-radius: 9px; box-shadow: 2px 2px 4px #333333 inset; background: #ffffff; border: none; +} + /* HEADER > FLAGS */ .language-select { - float: right; margin-top: 10px; + position: absolute; top: 10px; height: 12px; right: 0; } .language-select form { @@ -156,42 +183,3 @@ opacity: 1; } -/* TERM CLOUD */ - -.term-cloud { - line-height: 26px; width: 80%; font-size: 12px; text-align: center; margin: 0 auto; -} - -.term-cloud li { - display: inline-block; margin: 0 10px; -} - -.term-cloud a { - text-decoration: none; color: inherit; -} - -.term-frequency { - font-size: .8em; -} - -/* NOTICE LIST */ - -.notice-list { - margin: 0 auto; -} - -.notice-item { - width: 160px; - height: 160px; - overflow: hidden; - float: left; -} - -.notice-item .notice-metadata { - display: none; -} - -.notice-popin { - position: absolute; padding: 10px; - background: url('../img/background-pinstripe-yellow.png'); border: 1px solid #cccccc; box-shadow: 0 0 5px #333333; -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jocondelab/static/jocondelab/css/front-notice.css Wed Aug 14 16:42:33 2013 +0200 @@ -0,0 +1,53 @@ +.notice-images { + float: left; width: 33%; margin-top: 10px; text-align: center; +} + +.notice-images li { + margin: 5px 0; +} + +.notice-images img { + max-width: 100%; +} + +.notice-datasheet { + font-size: 13px; padding-top: 10px; padding-left: 20px; + float: left; width: 66%; +} + +.notice-title { + font-size: 15px; +} + +.notice-datasheet tr { + line-height: 1.1em; +} + +.notice-datasheet th { + width: 130px; font-weight: 700; text-align: left; padding: 5px 0; +} + +.notice-datasheet td { + padding: 5px 0; +} + +.notice-term { + display: inline-block; padding: 3px; + border-radius: 3px; margin: -2px 5px 4px 0; +} + +.term-translated { + background: #d0e0f0; +} + +.term-translated:hover { + background: #ffffff; +} + +.term-untranslated { + color: #333333; font-style: italic; +} + +.datasheet-small { + font-size: 11px; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jocondelab/static/jocondelab/css/front-search.css Wed Aug 14 16:42:33 2013 +0200 @@ -0,0 +1,59 @@ +.notice-list { + margin: 0 auto; +} + +.notice-item { + width: 160px; + height: 160px; + overflow: hidden; + float: left; +} + +.notice-item .notice-metadata { + display: none; +} + +.notice-popin { + position: absolute; padding: 10px; + background: url('../img/background-pinstripe-yellow.png'); border: 1px solid #cccccc; box-shadow: 0 0 5px #333333; +} + +.notice-contents h2 { + font-size: 15px; margin-bottom: 6px; line-height: 1.1em; +} + +.notice-title { + font-weight: bold; +} + +.notice-thesaurus { + font-size: 13px; margin-bottom: 6px; +} + +.notice-term { + display: inline-block; padding: 3px; background: #d0e0f0; + border-radius: 3px; margin: 0 5px 2px 0; +} + +.big-search-form { + text-align: center; margin: 20px 0; +} + +.big-search-input { + margin: 0 auto; width: 80%; line-height: 32px; height: 32px; font-size: 16px; font-family: 'OpenSans'; padding: 0 9px; + border-radius: 9px; box-shadow: 2px 2px 4px #333333 inset; background: #ffffff; border: none; +} + +/* TERM CLOUD */ + +.term-cloud { + line-height: 26px; width: 80%; font-size: 12px; text-align: center; margin: 0 auto; +} + +.term-cloud li { + display: inline-block; margin: 0 10px; +} + +.term-frequency { + font-size: .8em; +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jocondelab/static/jocondelab/js/front-notice.js Wed Aug 14 16:42:33 2013 +0200 @@ -0,0 +1,3 @@ +$(function() { + $('.notice-images a').magnificPopup({type:'image'}); +});
--- a/src/jocondelab/static/jocondelab/js/front-search.js Fri Aug 09 20:08:40 2013 +0200 +++ b/src/jocondelab/static/jocondelab/js/front-search.js Wed Aug 14 16:42:33 2013 +0200 @@ -29,7 +29,7 @@ x = refo.left + refw / 2; $popin.css({ top: refo.top - 11, - width: refw + 220 + width: refw + 260 }) if (x < winw / 2) { $img.css({ @@ -79,19 +79,35 @@ }); } - $tblist.find(".notice-image").load(function() { - var iw = this.width, - ih = this.height, - scale = gridsize / Math.min(iw, ih), - nw = scale * iw, - nh = scale * ih; - $(this).css({ - width: nw + "px", - height: nh + "px", - "margin-top": (gridsize - nh) / 2 + "px", - "margin-left": (gridsize - nw) / 2 + "px" + function checkSizes() { + var notloaded = false; + $tblist.find(".notice-image").each(function() { + if (this.__isloaded) { + return; + } + var ih = this.height; + if (ih < 30) { + notloaded = true; + return; + } + var iw = this.width, + scale = gridsize / Math.min(iw, ih), + nw = scale * iw, + nh = scale * ih; + $(this).css({ + width: nw + "px", + height: nh + "px", + "margin-top": (gridsize - nh) / 2 + "px", + "margin-left": (gridsize - nw) / 2 + "px" + }); + this.__isloaded = true; }); - }); + if (notloaded) { + setTimeout(checkSizes, 500); + } + } + + checkSizes(); $win.resize(function() { adaptGrid();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jocondelab/static/jocondelab/lib/jquery.magnific-popup.min.js Wed Aug 14 16:42:33 2013 +0200 @@ -0,0 +1,4 @@ +/*! Magnific Popup - v0.9.3 - 2013-07-16 +* http://dimsemenov.com/plugins/magnific-popup/ +* Copyright (c) 2013 Dmitry Semenov; */ +(function(e){var t,i,n,o,a,r,s,l="Close",c="BeforeClose",d="AfterClose",u="BeforeAppend",p="MarkupParse",f="Open",m="Change",g="mfp",v="."+g,h="mfp-ready",C="mfp-removing",y="mfp-prevent-close",w=function(){},b=!!window.jQuery,I=e(window),x=function(e,i){t.ev.on(g+e+v,i)},k=function(t,i,n,o){var a=document.createElement("div");return a.className="mfp-"+t,n&&(a.innerHTML=n),o?i&&i.appendChild(a):(a=e(a),i&&a.appendTo(i)),a},T=function(i,n){t.ev.triggerHandler(g+i,n),t.st.callbacks&&(i=i.charAt(0).toLowerCase()+i.slice(1),t.st.callbacks[i]&&t.st.callbacks[i].apply(t,e.isArray(n)?n:[n]))},E=function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).trigger("focus")},S=function(i){return i===s&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),s=i),t.currTemplate.closeBtn},P=function(){e.magnificPopup.instance||(t=new w,t.init(),e.magnificPopup.instance=t)},_=function(i){if(!e(i).hasClass(y)){var n=t.st.closeOnContentClick,o=t.st.closeOnBgClick;if(n&&o)return!0;if(!t.content||e(i).hasClass("mfp-close")||t.preloader&&i===t.preloader[0])return!0;if(i===t.content[0]||e.contains(t.content[0],i)){if(n)return!0}else if(o&&e.contains(document,i))return!0;return!1}},O=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1};w.prototype={constructor:w,init:function(){var i=navigator.appVersion;t.isIE7=-1!==i.indexOf("MSIE 7."),t.isIE8=-1!==i.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(i),t.isIOS=/iphone|ipad|ipod/gi.test(i),t.supportsTransition=O(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),n=e(document.body),o=e(document),t.popupsCache={}},open:function(i){var n;if(i.isObj===!1){t.items=i.items.toArray(),t.index=0;var a,s=i.items;for(n=0;s.length>n;n++)if(a=s[n],a.parsed&&(a=a.el[0]),a===i.el[0]){t.index=n;break}}else t.items=e.isArray(i.items)?i.items:[i.items],t.index=i.index||0;if(t.isOpen)return t.updateItemHTML(),void 0;t.types=[],r="",t.ev=i.mainEl&&i.mainEl.length?i.mainEl.eq(0):o,i.key?(t.popupsCache[i.key]||(t.popupsCache[i.key]={}),t.currTemplate=t.popupsCache[i.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,i),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=k("bg").on("click"+v,function(){t.close()}),t.wrap=k("wrap").attr("tabindex",-1).on("click"+v,function(e){_(e.target)&&t.close()}),t.container=k("container",t.wrap)),t.contentContainer=k("content"),t.st.preloader&&(t.preloader=k("preloader",t.container,t.st.tLoading));var l=e.magnificPopup.modules;for(n=0;l.length>n;n++){var c=l[n];c=c.charAt(0).toUpperCase()+c.slice(1),t["init"+c].call(t)}T("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(x(p,function(e,t,i,n){i.close_replaceWith=S(n.type)}),r+=" mfp-close-btn-in"):t.wrap.append(S())),t.st.alignTop&&(r+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:I.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:o.height(),position:"absolute"}),t.st.enableEscapeKey&&o.on("keyup"+v,function(e){27===e.keyCode&&t.close()}),I.on("resize"+v,function(){t.updateSize()}),t.st.closeOnContentClick||(r+=" mfp-auto-cursor"),r&&t.wrap.addClass(r);var d=t.wH=I.height(),u={};if(t.fixedContentPos&&t._hasScrollBar(d)){var m=t._getScrollbarSize();m&&(u.paddingRight=m)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):u.overflow="hidden");var g=t.st.mainClass;t.isIE7&&(g+=" mfp-ie7"),g&&t._addClassToMFP(g),t.updateItemHTML(),T("BuildControls"),e("html").css(u),t.bgOverlay.add(t.wrap).prependTo(document.body),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(h),E()):t.bgOverlay.addClass(h),o.on("focusin"+v,function(i){return i.target===t.wrap[0]||e.contains(t.wrap[0],i.target)?void 0:(E(),!1)})},16),t.isOpen=!0,t.updateSize(d),T(f)},close:function(){t.isOpen&&(T(c),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(C),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){T(l);var i=C+" "+h+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(i+=t.st.mainClass+" "),t._removeClassFromMFP(i),t.fixedContentPos){var n={paddingRight:""};t.isIE7?e("body, html").css("overflow",""):n.overflow="",e("html").css(n)}o.off("keyup"+v+" focusin"+v),t.ev.off(v),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).trigger("focus"),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,T(d)},updateSize:function(e){if(t.isIOS){var i=document.documentElement.clientWidth/window.innerWidth,n=window.innerHeight*i;t.wrap.css("height",n),t.wH=n}else t.wH=e||I.height();t.fixedContentPos||t.wrap.css("height",t.wH),T("Resize")},updateItemHTML:function(){var i=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),i.parsed||(i=t.parseEl(t.index));var n=i.type;if(T("BeforeChange",[t.currItem?t.currItem.type:"",n]),t.currItem=i,!t.currTemplate[n]){var o=t.st[n]?t.st[n].markup:!1;T("FirstMarkupParse",o),t.currTemplate[n]=o?e(o):!0}a&&a!==i.type&&t.container.removeClass("mfp-"+a+"-holder");var r=t["get"+n.charAt(0).toUpperCase()+n.slice(1)](i,t.currTemplate[n]);t.appendContent(r,n),i.preloaded=!0,T(m,i),a=i.type,t.container.prepend(t.contentContainer),T("AfterChange")},appendContent:function(e,i){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&t.currTemplate[i]===!0?t.content.find(".mfp-close").length||t.content.append(S()):t.content=e:t.content="",T(u),t.container.addClass("mfp-"+i+"-holder"),t.contentContainer.append(t.content)},parseEl:function(i){var n=t.items[i],o=n.type;if(n=n.tagName?{el:e(n)}:{data:n,src:n.src},n.el){for(var a=t.types,r=0;a.length>r;r++)if(n.el.hasClass("mfp-"+a[r])){o=a[r];break}n.src=n.el.attr("data-mfp-src"),n.src||(n.src=n.el.attr("href"))}return n.type=o||t.st.type||"inline",n.index=i,n.parsed=!0,t.items[i]=n,T("ElementParse",n),t.items[i]},addGroup:function(e,i){var n=function(n){n.mfpEl=this,t._openClick(n,e,i)};i||(i={});var o="click.magnificPopup";i.mainEl=e,i.items?(i.isObj=!0,e.off(o).on(o,n)):(i.isObj=!1,i.delegate?e.off(o).on(o,i.delegate,n):(i.items=e,e.off(o).on(o,n)))},_openClick:function(i,n,o){var a=void 0!==o.midClick?o.midClick:e.magnificPopup.defaults.midClick;if(a||2!==i.which&&!i.ctrlKey&&!i.metaKey){var r=void 0!==o.disableOn?o.disableOn:e.magnificPopup.defaults.disableOn;if(r)if(e.isFunction(r)){if(!r.call(t))return!0}else if(r>I.width())return!0;i.type&&(i.preventDefault(),t.isOpen&&i.stopPropagation()),o.el=e(i.mfpEl),o.delegate&&(o.items=n.find(o.delegate)),t.open(o)}},updateStatus:function(e,n){if(t.preloader){i!==e&&t.container.removeClass("mfp-s-"+i),n||"loading"!==e||(n=t.st.tLoading);var o={status:e,text:n};T("UpdateStatus",o),e=o.status,n=o.text,t.preloader.html(n),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),i=e}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?o.height():document.body.scrollHeight)>(e||I.height())},_parseMarkup:function(t,i,n){var o;n.data&&(i=e.extend(n.data,i)),T(p,[t,i,n]),e.each(i,function(e,i){if(void 0===i||i===!1)return!0;if(o=e.split("_"),o.length>1){var n=t.find(v+"-"+o[0]);if(n.length>0){var a=o[1];"replaceWith"===a?n[0]!==i[0]&&n.replaceWith(i):"img"===a?n.is("img")?n.attr("src",i):n.replaceWith('<img src="'+i+'" class="'+n.attr("class")+'" />'):n.attr(o[1],i)}}else t.find(v+"-"+e).html(i)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.id="mfp-sbm",e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:w.prototype,modules:[],open:function(e,t){return P(),e||(e={}),e.isObj=!0,e.index=t||0,this.instance.open(e)},close:function(){return e.magnificPopup.instance.close()},registerModule:function(t,i){i.options&&(e.magnificPopup.defaults[t]=i.options),e.extend(this.proto,i.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(i){P();var n=e(this);if("string"==typeof i)if("open"===i){var o,a=b?n.data("magnificPopup"):n[0].magnificPopup,r=parseInt(arguments[1],10)||0;a.items?o=a.items[r]:(o=n,a.delegate&&(o=o.find(a.delegate)),o=o.eq(r)),t._openClick({mfpEl:o},n,a)}else t.isOpen&&t[i].apply(t,Array.prototype.slice.call(arguments,1));else b?n.data("magnificPopup",i):n[0].magnificPopup=i,t.addGroup(n,i);return n};var z,M,B,H="inline",L=function(){B&&(M.after(B.addClass(z)).detach(),B=null)};e.magnificPopup.registerModule(H,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(H),x(l+"."+H,function(){L()})},getInline:function(i,n){if(L(),i.src){var o=t.st.inline,a=e(i.src);if(a.length){var r=a[0].parentNode;r&&r.tagName&&(M||(z=o.hiddenClass,M=k(z),z="mfp-"+z),B=a.after(M).detach().removeClass(z)),t.updateStatus("ready")}else t.updateStatus("error",o.tNotFound),a=e("<div>");return i.inlineElement=a,a}return t.updateStatus("ready"),t._parseMarkup(n,{},i),n}}});var A,F="ajax",j=function(){A&&n.removeClass(A)};e.magnificPopup.registerModule(F,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){t.types.push(F),A=t.st.ajax.cursor,x(l+"."+F,function(){j(),t.req&&t.req.abort()})},getAjax:function(i){A&&n.addClass(A),t.updateStatus("loading");var o=e.extend({url:i.src,success:function(n,o,a){var r={data:n,xhr:a};T("ParseAjax",r),t.appendContent(e(r.data),F),i.finished=!0,j(),E(),setTimeout(function(){t.wrap.addClass(h)},16),t.updateStatus("ready"),T("AjaxContentAdded")},error:function(){j(),i.finished=i.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",i.src))}},t.st.ajax.settings);return t.req=e.ajax(o),""}}});var N,W=function(i){if(i.data&&void 0!==i.data.title)return i.data.title;var n=t.st.image.titleSrc;if(n){if(e.isFunction(n))return n.call(t,i);if(i.el)return i.el.attr(n)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><div class="mfp-img"></div><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var e=t.st.image,i=".image";t.types.push("image"),x(f+i,function(){"image"===t.currItem.type&&e.cursor&&n.addClass(e.cursor)}),x(l+i,function(){e.cursor&&n.removeClass(e.cursor),I.off("resize"+v)}),x("Resize"+i,t.resizeImage),t.isLowIE&&x("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e.img&&t.st.image.verticalFit){var i=0;t.isLowIE&&(i=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-i)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,N&&clearInterval(N),e.isCheckingImgSize=!1,T("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var i=0,n=e.img[0],o=function(a){N&&clearInterval(N),N=setInterval(function(){return n.naturalWidth>0?(t._onImageHasSize(e),void 0):(i>200&&clearInterval(N),i++,3===i?o(10):40===i?o(50):100===i&&o(500),void 0)},a)};o(1)},getImage:function(i,n){var o=0,a=function(){i&&(i.img[0].complete?(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("ready")),i.hasSize=!0,i.loaded=!0,T("ImageLoadComplete")):(o++,200>o?setTimeout(a,100):r()))},r=function(){i&&(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("error",s.tError.replace("%url%",i.src))),i.hasSize=!0,i.loaded=!0,i.loadError=!0)},s=t.st.image,l=n.find(".mfp-img");if(l.length){var c=new Image;c.className="mfp-img",i.img=e(c).on("load.mfploader",a).on("error.mfploader",r),c.src=i.src,l.is("img")&&(i.img=i.img.clone()),i.img[0].naturalWidth>0&&(i.hasSize=!0)}return t._parseMarkup(n,{title:W(i),img_replaceWith:i.img},i),t.resizeImage(),i.hasSize?(N&&clearInterval(N),i.loadError?(n.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",i.src))):(n.removeClass("mfp-loading"),t.updateStatus("ready")),n):(t.updateStatus("loading"),i.loading=!0,i.hasSize||(i.imgHidden=!0,n.addClass("mfp-loading"),t.findImageSize(i)),n)}}});var R,Z=function(){return void 0===R&&(R=void 0!==document.createElement("p").style.MozTransform),R};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e=t.st.zoom,i=".zoom";if(e.enabled&&t.supportsTransition){var n,o,a=e.duration,r=function(t){var i=t.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),n="all "+e.duration/1e3+"s "+e.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},a="transition";return o["-webkit-"+a]=o["-moz-"+a]=o["-o-"+a]=o[a]=n,i.css(o),i},s=function(){t.content.css("visibility","visible")};x("BuildControls"+i,function(){if(t._allowZoom()){if(clearTimeout(n),t.content.css("visibility","hidden"),image=t._getItemToZoom(),!image)return s(),void 0;o=r(image),o.css(t._getOffset()),t.wrap.append(o),n=setTimeout(function(){o.css(t._getOffset(!0)),n=setTimeout(function(){s(),setTimeout(function(){o.remove(),image=o=null,T("ZoomAnimationEnded")},16)},a)},16)}}),x(c+i,function(){if(t._allowZoom()){if(clearTimeout(n),t.st.removalDelay=a,!image){if(image=t._getItemToZoom(),!image)return;o=r(image)}o.css(t._getOffset(!0)),t.wrap.append(o),t.content.css("visibility","hidden"),setTimeout(function(){o.css(t._getOffset())},16)}}),x(l+i,function(){t._allowZoom()&&(s(),o&&o.remove())})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return t.currItem.hasSize?t.currItem.img:!1},_getOffset:function(i){var n;n=i?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var o=n.offset(),a=parseInt(n.css("padding-top"),10),r=parseInt(n.css("padding-bottom"),10);o.top-=e(window).scrollTop()-a;var s={width:n.width(),height:(b?n.innerHeight():n[0].offsetHeight)-r-a};return Z()?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var q="iframe",D="//about:blank",K=function(e){if(t.currTemplate[q]){var i=t.currTemplate[q].find("iframe");i.length&&(e||(i[0].src=D),t.isIE8&&i.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(q,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(q),x("BeforeChange",function(e,t,i){t!==i&&(t===q?K():i===q&&K(!0))}),x(l+"."+q,function(){K()})},getIframe:function(i,n){var o=i.src,a=t.st.iframe;e.each(a.patterns,function(){return o.indexOf(this.index)>-1?(this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1):void 0});var r={};return a.srcAction&&(r[a.srcAction]=o),t._parseMarkup(n,r,i),t.updateStatus("ready"),n}}});var Y=function(e){var i=t.items.length;return e>i-1?e-i:0>e?i+e:e},U=function(e,t,i){return e.replace("%curr%",t+1).replace("%total%",i)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var i=t.st.gallery,n=".mfp-gallery",a=Boolean(e.fn.mfpFastClick);return t.direction=!0,i&&i.enabled?(r+=" mfp-gallery",x(f+n,function(){i.navigateByImgClick&&t.wrap.on("click"+n,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),o.on("keydown"+n,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),x("UpdateStatus"+n,function(e,i){i.text&&(i.text=U(i.text,t.currItem.index,t.items.length))}),x(p+n,function(e,n,o,a){var r=t.items.length;o.counter=r>1?U(i.tCounter,a.index,r):""}),x("BuildControls"+n,function(){if(t.items.length>1&&i.arrows&&!t.arrowLeft){var n=i.arrowMarkup,o=t.arrowLeft=e(n.replace("%title%",i.tPrev).replace("%dir%","left")).addClass(y),r=t.arrowRight=e(n.replace("%title%",i.tNext).replace("%dir%","right")).addClass(y),s=a?"mfpFastClick":"click";o[s](function(){t.prev()}),r[s](function(){t.next()}),t.isIE7&&(k("b",o[0],!1,!0),k("a",o[0],!1,!0),k("b",r[0],!1,!0),k("a",r[0],!1,!0)),t.container.append(o.add(r))}}),x(m+n,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),x(l+n,function(){o.off(n),t.wrap.off("click"+n),t.arrowLeft&&a&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}),void 0):!1},next:function(){t.direction=!0,t.index=Y(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=Y(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,i=t.st.gallery.preload,n=Math.min(i[0],t.items.length),o=Math.min(i[1],t.items.length);for(e=1;(t.direction?o:n)>=e;e++)t._preloadItem(t.index+e);for(e=1;(t.direction?n:o)>=e;e++)t._preloadItem(t.index-e)},_preloadItem:function(i){if(i=Y(i),!t.items[i].preloaded){var n=t.items[i];n.parsed||(n=t.parseEl(i)),T("LazyLoad",n),"image"===n.type&&(n.img=e('<img class="mfp-img" />').on("load.mfploader",function(){n.hasSize=!0}).on("error.mfploader",function(){n.hasSize=!0,n.loadError=!0,T("LazyLoadError",n)}).attr("src",n.src)),n.preloaded=!0}}}});var G="retina";e.magnificPopup.registerModule(G,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,i=e.ratio;i=isNaN(i)?i():i,i>1&&(x("ImageHasSize."+G,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/i,width:"100%"})}),x("ElementParse."+G,function(t,n){n.src=e.replaceSrc(n,i)}))}}}}),function(){var t=1e3,i="ontouchstart"in window,n=function(){I.off("touchmove"+a+" touchend"+a)},o="mfpFastClick",a="."+o;e.fn.mfpFastClick=function(o){return e(this).each(function(){var r,s=e(this);if(i){var l,c,d,u,p,f;s.on("touchstart"+a,function(e){u=!1,f=1,p=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=p.clientX,d=p.clientY,I.on("touchmove"+a,function(e){p=e.originalEvent?e.originalEvent.touches:e.touches,f=p.length,p=p[0],(Math.abs(p.clientX-c)>10||Math.abs(p.clientY-d)>10)&&(u=!0,n())}).on("touchend"+a,function(e){n(),u||f>1||(r=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){r=!1},t),o())})})}s.on("click"+a,function(){r||o()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+a+" click"+a),i&&I.off("touchmove"+a+" touchend"+a)}}()})(window.jQuery||window.Zepto); \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jocondelab/static/jocondelab/lib/magnific-popup.css Wed Aug 14 16:42:33 2013 +0200 @@ -0,0 +1,394 @@ +/* Magnific Popup CSS */ +.mfp-bg { + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1042; + overflow: hidden; + position: fixed; + background: #0b0b0b; + opacity: 0.8; + filter: alpha(opacity=80); } + +.mfp-wrap { + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1043; + position: fixed; + outline: none !important; + -webkit-backface-visibility: hidden; } + +.mfp-container { + text-align: center; + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + padding: 0 8px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } + +.mfp-container:before { + content: ''; + display: inline-block; + height: 100%; + vertical-align: middle; } + +.mfp-align-top .mfp-container:before { + display: none; } + +.mfp-content { + position: relative; + display: inline-block; + vertical-align: middle; + margin: 0 auto; + text-align: left; + z-index: 1045; } + +.mfp-inline-holder .mfp-content, +.mfp-ajax-holder .mfp-content { + width: 100%; + cursor: auto; } + +.mfp-ajax-cur { + cursor: progress; } + +.mfp-zoom-out-cur, +.mfp-zoom-out-cur .mfp-image-holder .mfp-close { + cursor: -moz-zoom-out; + cursor: -webkit-zoom-out; + cursor: zoom-out; } + +.mfp-zoom { + cursor: pointer; + cursor: -webkit-zoom-in; + cursor: -moz-zoom-in; + cursor: zoom-in; } + +.mfp-auto-cursor .mfp-content { + cursor: auto; } + +.mfp-close, +.mfp-arrow, +.mfp-preloader, +.mfp-counter { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; } + +.mfp-loading.mfp-figure { + display: none; } + +.mfp-hide { + display: none !important; } + +.mfp-preloader { + color: #cccccc; + position: absolute; + top: 50%; + width: auto; + text-align: center; + margin-top: -0.8em; + left: 8px; + right: 8px; + z-index: 1044; } + +.mfp-preloader a { + color: #cccccc; } + +.mfp-preloader a:hover { + color: white; } + +.mfp-s-ready .mfp-preloader { + display: none; } + +.mfp-s-error .mfp-content { + display: none; } + +button.mfp-close, +button.mfp-arrow { + overflow: visible; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; + display: block; + padding: 0; + z-index: 1046; } + +button::-moz-focus-inner { + padding: 0; + border: 0; } + +.mfp-close { + width: 44px; + height: 44px; + line-height: 44px; + position: absolute; + right: 0; + top: 0; + text-decoration: none; + text-align: center; + opacity: 0.65; + padding: 0 0 18px 10px; + color: white; + font-style: normal; + font-size: 28px; + font-family: Arial, Baskerville, monospace; } + .mfp-close:hover, .mfp-close:focus { + opacity: 1; } + .mfp-close:active { + top: 1px; } + +.mfp-close-btn-in .mfp-close { + color: #333333; } + +.mfp-image-holder .mfp-close, +.mfp-iframe-holder .mfp-close { + color: white; + right: -6px; + text-align: right; + padding-right: 6px; + width: 100%; } + +.mfp-counter { + position: absolute; + top: 0; + right: 0; + color: #cccccc; + font-size: 12px; + line-height: 18px; } + +.mfp-arrow { + position: absolute; + opacity: 0.65; + margin: 0; + top: 50%; + margin-top: -55px; + padding: 0; + width: 90px; + height: 110px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } + +.mfp-arrow:active { + margin-top: -54px; } + +.mfp-arrow:hover, +.mfp-arrow:focus { + opacity: 1; } + +.mfp-arrow:before, .mfp-arrow:after, +.mfp-arrow .mfp-b, +.mfp-arrow .mfp-a { + content: ''; + display: block; + width: 0; + height: 0; + position: absolute; + left: 0; + top: 0; + margin-top: 35px; + margin-left: 35px; + border: medium inset transparent; } +.mfp-arrow:after, +.mfp-arrow .mfp-a { + border-top-width: 13px; + border-bottom-width: 13px; + top: 8px; } +.mfp-arrow:before, +.mfp-arrow .mfp-b { + border-top-width: 21px; + border-bottom-width: 21px; } + +.mfp-arrow-left { + left: 0; } + .mfp-arrow-left:after, + .mfp-arrow-left .mfp-a { + border-right: 17px solid white; + margin-left: 31px; } + .mfp-arrow-left:before, + .mfp-arrow-left .mfp-b { + margin-left: 25px; + border-right: 27px solid #3f3f3f; } + +.mfp-arrow-right { + right: 0; } + .mfp-arrow-right:after, + .mfp-arrow-right .mfp-a { + border-left: 17px solid white; + margin-left: 39px; } + .mfp-arrow-right:before, + .mfp-arrow-right .mfp-b { + border-left: 27px solid #3f3f3f; } + +.mfp-iframe-holder { + padding-top: 40px; + padding-bottom: 40px; } + +.mfp-iframe-holder .mfp-content { + line-height: 0; + width: 100%; + max-width: 900px; } + +.mfp-iframe-scaler { + width: 100%; + height: 0; + overflow: hidden; + padding-top: 56.25%; } + +.mfp-iframe-scaler iframe { + position: absolute; + display: block; + top: 0; + left: 0; + width: 100%; + height: 100%; + box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); + background: black; } + +.mfp-iframe-holder .mfp-close { + top: -40px; } + +/* Main image in popup */ +img.mfp-img { + width: auto; + max-width: 100%; + height: auto; + display: block; + line-height: 0; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 40px 0 40px; + margin: 0 auto; } + +/* The shadow behind the image */ +.mfp-figure:after { + content: ''; + position: absolute; + left: 0; + top: 40px; + bottom: 40px; + display: block; + right: 0; + width: auto; + height: auto; + z-index: -1; + box-shadow: 0 0 8px rgba(0, 0, 0, 0.6); + background: #444444; } + +.mfp-figure { + line-height: 0; } + +.mfp-bottom-bar { + margin-top: -36px; + position: absolute; + top: 100%; + left: 0; + width: 100%; + cursor: auto; } + +.mfp-title { + text-align: left; + line-height: 18px; + color: #f3f3f3; + word-break: break-word; + padding-right: 36px; } + +.mfp-figure small { + color: #bdbdbd; + display: block; + font-size: 12px; + line-height: 14px; } + +.mfp-image-holder .mfp-content { + max-width: 100%; } + +.mfp-gallery .mfp-image-holder .mfp-figure { + cursor: pointer; } + +@media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) { + /** + * Remove all paddings around the image on small screen + */ + .mfp-img-mobile .mfp-image-holder { + padding-left: 0; + padding-right: 0; } + + .mfp-img-mobile img.mfp-img { + padding: 0; } + + /* The shadow behind the image */ + .mfp-img-mobile .mfp-figure:after { + top: 0; + bottom: 0; } + + .mfp-img-mobile .mfp-bottom-bar { + background: rgba(0, 0, 0, 0.6); + bottom: 0; + margin: 0; + top: auto; + padding: 3px 5px; + position: fixed; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; } + + .mfp-img-mobile .mfp-bottom-bar:empty { + padding: 0; } + + .mfp-img-mobile .mfp-counter { + right: 5px; + top: 3px; } + + .mfp-img-mobile .mfp-close { + top: 0; + right: 0; + width: 35px; + height: 35px; + line-height: 35px; + background: rgba(0, 0, 0, 0.6); + position: fixed; + text-align: center; + padding: 0; } + + .mfp-img-mobile .mfp-figure small { + display: inline; + margin-left: 5px; } } +@media all and (max-width: 900px) { + .mfp-arrow { + -webkit-transform: scale(0.75); + transform: scale(0.75); } + + .mfp-arrow-left { + -webkit-transform-origin: 0; + transform-origin: 0; } + + .mfp-arrow-right { + -webkit-transform-origin: 100%; + transform-origin: 100%; } + + .mfp-container { + padding-left: 6px; + padding-right: 6px; } } +.mfp-ie7 .mfp-img { + padding: 0; } +.mfp-ie7 .mfp-bottom-bar { + width: 600px; + left: 50%; + margin-left: -300px; + margin-top: 5px; + padding-bottom: 5px; } +.mfp-ie7 .mfp-container { + padding: 0; } +.mfp-ie7 .mfp-content { + padding-top: 44px; } +.mfp-ie7 .mfp-close { + top: 0; + right: 0; + padding-top: 0; }
--- a/src/jocondelab/templates/jocondelab/front_base.html Fri Aug 09 20:08:40 2013 +0200 +++ b/src/jocondelab/templates/jocondelab/front_base.html Wed Aug 14 16:42:33 2013 +0200 @@ -12,16 +12,21 @@ <script type="text/javascript" src="{{STATIC_URL}}jocondelab/lib/underscore-min.js"></script> <script type="text/javascript" src="{{STATIC_URL}}jocondelab/lib/jquery.min.js"></script> <script type="text/javascript" src="{{STATIC_URL}}jocondelab/lib/jquery-ui.min.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}jocondelab/js/front-common.js"></script> {% endblock %} - + {% block css_import %} <link rel="stylesheet" href="{{STATIC_URL}}jocondelab/css/smoothness/jquery-ui-1.10.3.custom.min.css" type="text/css"/> <link rel="stylesheet" href="{{STATIC_URL}}jocondelab/css/front-common.css" type="text/css"/> {% endblock %} - {% block css_declaration %}{% endblock %} + {% block css_declaration %} + <link rel="stylesheet" href="{{STATIC_URL}}jocondelab/css/front-common.css" type="text/css"/> + {% endblock %} - {% block js_declaration %}{% endblock %} + {% block js_declaration %} + <script type="text/javascript" src="{{STATIC_URL}}jocondelab/js/front-common.js"></script> + {% endblock %} {% endblock %} </head> @@ -31,7 +36,7 @@ <header> {% block header %} <div class="main-title"> - <h1>Joconde<span class="title-lab">Lab </span></h1> + <h1><a href="{% url 'multilingual_search' %}">Joconde<span class="title-lab">Lab</span></a></h1> <h2 class="breadcrumbs">{% block breadcrumbs %}{% endblock %}</h2> </div> <div class="language-select"> @@ -43,6 +48,11 @@ {% endfor %} </form> </div> + {% block header_search %} + <form class="header-search-form" action="{% url 'multilingual_search' %}"> + <input class="header-search-input" type="search" name="q" /> + </form> + {% endblock %} {% endblock %} </header> </div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/jocondelab/templates/jocondelab/front_notice.html Wed Aug 14 16:42:33 2013 +0200 @@ -0,0 +1,100 @@ +{% extends "jocondelab/front_base.html" %} +{% load i18n %} +{% load l10n %} + +{% block js_import %} + {{block.super}} + <script type="text/javascript" src="{{STATIC_URL}}jocondelab/lib/jquery.magnific-popup.min.js"></script> +{% endblock %} + +{% block js_declaration %} + {{block.super}} + <script type="text/javascript" src="{{STATIC_URL}}jocondelab/js/front-notice.js"></script> +{% endblock %} + +{% block css_import %} + {{block.super}} + <link rel="stylesheet" href="{{STATIC_URL}}jocondelab/lib/magnific-popup.css" type="text/css" /> +{% endblock %} + +{% block css_declaration %} + {{block.super}} + <link rel="stylesheet" href="{{STATIC_URL}}jocondelab/css/front-notice.css" type="text/css" /> +{% endblock %} + +{% block title %}JocondeLab » {{title}}{% endblock %} + +{% block breadcrumbs %}<a href="{% url 'front_notice' notice.id %}">{{title|truncatechars:30}}</a>{% endblock %} + +{% block main %} + + <ul class="notice-images"> + {% for img in images %} + <li> + <a href="{{JOCONDE_IMG_BASE_URL}}{{img}}" title="{{title}}"> + <img src="{{JOCONDE_IMG_BASE_URL}}{{img}}" /> + </a> + </li> + {% endfor %} + </ul> + + <table class="notice-datasheet"> + {% if notice.titr %} + <tr class="notice-title"> + <th>{% trans 'Title:' %}</th> + <td>{{notice.titr}}</td> + </tr> + {% endif %} + {% if notice.deno %} + <tr {% if not notice.titr %}class="notice-title"{% endif %}> + <th>{% trans 'Denomination:' %}</th> + <td>{{notice.deno}}</td> + </tr> + {% endif %} + {% for thesaurus, terms in terms_by_thesaurus.items %} + <tr> + <th>{% trans thesaurus %}{% trans ':' %}</th> + <td> + <ul class="datasheet-contents notice-term-list"> + {% for termtype, terms in terms.items %} + {% for term in terms %} + <li class="notice-term term-{{termtype}}"><a href="{% url 'multilingual_search' %}?q={{term.locale_label|urlencode}}">{{term.locale_label}}</a></li> + {% endfor %} + {% endfor %} + </ul> + </td> + </tr> + {% endfor %} + {% if notice.desc %} + <tr> + <th>{% trans 'Description:' %}</th> + <td>{{notice.desc}}</td> + </tr> + {% endif %} + {% if notice.hist %} + <tr> + <th>{% trans 'History:' %}</th> + <td>{{notice.hist}}</td> + </tr> + {% endif %} + {% if notice.loca %} + <tr> + <th>{% trans 'Conservation location:' %}</th> + <td>{{notice.loca}}</td> + </tr> + {% endif %} + {% if notice.copy %} + <tr class="datasheet-small"> + <th>{% trans 'Datasheet rights:' %}</th> + <td>{{notice.copy}}</td> + </tr> + {% endif %} + {% if notice.phot %} + <tr class="datasheet-item datasheet-small"> + <th>{% trans 'Images rights:' %}</th> + <td>{{notice.phot}}</td> + </tr> + {% endif %} + </table> + +{% endblock %}
--- a/src/jocondelab/templates/jocondelab/front_search.html Fri Aug 09 20:08:40 2013 +0200 +++ b/src/jocondelab/templates/jocondelab/front_search.html Wed Aug 14 16:42:33 2013 +0200 @@ -2,44 +2,69 @@ {% load i18n %} {% load l10n %} -{% block js_import %} +{% block js_declaration %} {{block.super}} <script type="text/javascript" src="{{STATIC_URL}}jocondelab/js/front-search.js"></script> {% endblock %} +{% block css_declaration %} + {{block.super}} + <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}jocondelab/css/front-search.css"></script> +{% endblock %} + {% block title %}JocondeLab » {% trans 'Multilingual search' %}{% endblock %} -{% block breadcrumbs %}» {% trans 'Multilingual search' %}{% endblock %} +{% block breadcrumbs %}<a href="{% url 'multilingual_search' %}">{% trans 'Multilingual search' %}</a>{% endblock %} + +{% block header_search %}{% endblock %} {% block main %} + + <form class="big-search-form"> + <input class="big-search-input" type="search" name="q" value="{{queryterms}}" /> + </form> + <ul class="term-cloud"> {% for word in words %} <li style="font-size: {{word.font_size|unlocalize}}em"> - <a href="#">{{word.label}} <span class="term-frequency">({{word.notice_count}})</span></a> + <a href="{% url 'multilingual_search' %}?q={{word.label|urlencode}}">{{word.label}} <span class="term-frequency">({{word.notice_count}})</span></a> </li> {% endfor %} </ul> + <div class="resultcount">{{rescount}} {% trans 'results' %} -- {{duration}} secondes</div> + <ul class="notice-list clearfix"> {% for notice in notices %} <li class="notice-item" data-notice-id="{{notice.id}}"> <div class="notice-contents"> - <img class="notice-image" alt="{{notice.imagetitle}}" title="{{notice.imagetitle}}" src="{{JOCONDE_IMG_BASE_URL}}{{ notice.image }}" /> + <a href="{% url 'front_notice' notice.id %}" title="{{notice.imagetitle}}"> + <img class="notice-image" alt="{{notice.imagetitle}}" src="{{JOCONDE_IMG_BASE_URL}}{{ notice.image }}" /> + </a> <div class="notice-metadata"> - {% if notice.title %}<h2>{% trans 'Title:' %} {{notice.title}}</h2>{% endif %} - {% if not notice.title and notice.denomination %}<h2>{% trans 'Denomination:' %} {{notice.denomination}}</h2>{% endif %} - {% if not notice.terms_by_thesaurus.AUTR and notice.author %}<h2>{% trans 'Author:' %} {{notice.author}}</h2>{% endif %} + {% if notice.title %}<h2><a href="{% url 'front_notice' notice.id %}">{% trans 'Title:' %} <span class="notice-title">{{notice.title}}</span></a></h2>{% endif %} + {% if not notice.title and notice.denomination %}<h2><a href="{% url 'front_notice' notice.id %}">{% trans 'Denomination:' %} <span class="notice-title">{{notice.denomination}}</span></a></h2>{% endif %} <ul> - {% for thesaurus, terms in notice.terms_by_thesaurus.items %} - <li> + {% if not notice.terms_by_thesaurus.AUTR and notice.authors %} + <li class="notice-thesaurus"> + <h3 class="notice-thesaurus-title">{% trans 'Author(s):' %}</h3> + <ul class="notice-terms-list"> + {% for author in notice.authors %} + <li class="notice-term"><a href="{% url 'multilingual_search' %}?q={{author|urlencode}}">{{author}}</a></li> + {% endfor %} + </ul> + </li> + {% endif %} + {% for thesaurus, terms in notice.terms_by_thesaurus.items %} + <li class="notice-thesaurus"> <h3>{% trans thesaurus %}{% trans ':' %}</h3> - <ul> - {% for term in terms %} - <li>{{term.locale_label}}</li> - {% endfor %} + <ul class="notice-term-list"> + {% for term in terms %} + <li class="notice-term"><a href="{% url 'multilingual_search' %}?q={{term.locale_label|urlencode}}">{{term.locale_label}}</a></li> + {% endfor %} </ul> </li> - {% endfor %} + {% endfor %} </ul> </div> </div>
--- a/src/jocondelab/urls.py Fri Aug 09 20:08:40 2013 +0200 +++ b/src/jocondelab/urls.py Wed Aug 14 16:42:33 2013 +0200 @@ -1,7 +1,7 @@ from jocondelab.views.back_office import (TermListView, TermEditView, TermModifyWpLink, TermRemoveWpLink, TermValidate, TermWikipediaEdition, TermLinkSemanticLevelEdition, ThesaurusTree, TermListTableView) -from jocondelab.views.front_office import (MultilingualSearch) +from jocondelab.views.front_office import (MultilingualSearch, NoticeView) from core import urls as core_urls from django.conf.urls import patterns, include, url from django.contrib import admin @@ -32,5 +32,6 @@ url(r'^bo/term/validate/$', login_required(TermValidate.as_view()), name='validate_term'), url(r'^bo/tree/(?P<thes_id>\d+)/$', login_required(ThesaurusTree.as_view()), name='term_tree'), url(r'^mlsearch/$', MultilingualSearch.as_view(), name='multilingual_search'), + url(r'^notice/(?P<notice_id>\d+)/$', NoticeView.as_view(), name='front_notice'), )
--- a/src/jocondelab/views/front_office.py Fri Aug 09 20:08:40 2013 +0200 +++ b/src/jocondelab/views/front_office.py Wed Aug 14 16:42:33 2013 +0200 @@ -10,7 +10,10 @@ from django.conf import settings from django.views.generic import View from django.views.generic.base import TemplateResponseMixin +from django.db.models import Q, Count import random +import re +import time class MultilingualSearch(View, TemplateResponseMixin): @@ -18,86 +21,133 @@ def get(self, request): + starttime = time.time() + context = {} lang = request.GET.get('lang',request.LANGUAGE_CODE) - queryterms = request.GET.get('q', None) + querystr = request.GET.get('q', "") + search_in_title = request.GET.get('search_in_title', True) + search_in_translations = request.GET.get('search_in_translations', True) + show_tagcloud = request.GET.get('show_tagcloud', True) + queryterms = [s.strip(" ") for s in re.split("[,;]",querystr) if s.strip(" ")] if (search_in_title or search_in_translations) else None - npp = 12 + npp = 48 if queryterms else 24 notices = [] - qs = Notice.objects.filter(image=True) - - nbnotices = qs.count() - subrangelength = 2 - - locale_labels = {} + if queryterms and search_in_translations and search_in_title: + mainq = Q() + if search_in_translations: + uriq = Q() + for term in queryterms: + uriq = uriq | Q(translations__label__icontains=term) + ds = DbpediaResource.objects.filter(translations__lang=lang).filter(uriq) + mainq = mainq | Q(dbpedia_resources__dbpediaresource__in=ds) + if search_in_title: + for term in queryterms: + mainq = mainq | Q(titr__icontains=term) + qs = Notice.objects.filter(Q(image=True) & mainq).distinct() + nbnotices = qs.count() + ns = qs[:npp] + else: + qs = Notice.objects.filter(image=True) + nbnotices = qs.count() + ns = qs.order_by('?')[:npp] # --- A bit slow + # minmax = Notice.objects.aggregate(Min('id'), Max('id')) + # ns = ns.filter(id__in = [random.randint(minmax['id__min'],minmax['id__max']) for i in range(npp * 3)])[:npp] # --- slightly better - while len(notices) < npp: - offset = int(random.random()*(nbnotices-subrangelength)) - ns = qs[offset:(offset+subrangelength)].select_related('images','noticeterm_set__term__thesaurus') - for n in ns: - terms = [{ - "label": ts.term.label, - "dbpedia_uri": ts.term.dbpedia_uri, - "thesaurus": ts.term.thesaurus.label - } for ts in n.noticeterm_set.all()] - for term in terms: - if term["dbpedia_uri"]: - locale_labels[term["dbpedia_uri"]] = None - noticedict = { - "id": n.id, - "imagetitle": n.titr if n.titr else n.deno, - "title": n.titr, - "denomination": n.deno, - "image": n.images.all()[0].url, - "author": n.autr, - "all_terms": terms - } - notices.append(noticedict) - - llqs = DbpediaTranslation.objects.select_related('dbpediaresource').filter(lang = lang, dbpediaresource__uri__in=[term["dbpedia_uri"] for term in terms]) - locale_labels = { - ll.dbpediaresource.uri: ll.label for ll in llqs - } - for n in notices: + for n in ns: + terms = [{ + "locale_label": ts.dbpediaresource.translations.get(lang=lang).label, + "thesaurus": ts.thesaurus.label + } for ts in n.dbpedia_resources.filter(dbpediaresource__translations__lang=lang)] termsbythesaurus = {} - for term in n["all_terms"]: - if term["dbpedia_uri"] in locale_labels: - term["locale_label"] = locale_labels[term["dbpedia_uri"]] - if not term["thesaurus"] in termsbythesaurus: - termsbythesaurus[term["thesaurus"]] = [] - termsbythesaurus[term["thesaurus"]].append(term) - n["terms_by_thesaurus"] = termsbythesaurus - - random.shuffle(notices) + for term in terms: + if not term["thesaurus"] in termsbythesaurus: + termsbythesaurus[term["thesaurus"]] = [] + termsbythesaurus[term["thesaurus"]].append(term) + noticedict = { + "id": n.id, + "imagetitle": n.titr if n.titr else n.deno, + "title": n.titr, + "denomination": n.deno, + "image": n.images.all()[0].url if n.images.count() else "", + "author": n.autr, + "authors": re.split("\s?;\s?", n.autr) if n.autr else [], + "all_terms": terms, + "terms_by_thesaurus": termsbythesaurus + } + notices.append(noticedict) context["lang"] = lang context["rescount"] = nbnotices context["notices"] = notices - context["translations"] = locale_labels + context["queryterms"] = querystr + + # The word cloud is very time-consuming ! wpp = 30 - - wqs = DbpediaResource.objects.select_related('translations').filter(translations__lang=lang) - wqs = wqs.extra(select = { - "notice_count": "SELECT COUNT(DISTINCT(core_noticeterm.id)) FROM core_noticeterm JOIN core_term ON core_term.id = core_noticeterm.term_id WHERE core_term.dbpedia_uri = jocondelab_dbpediaresource.uri" - }).order_by("-notice_count")[:wpp] - - words = [{ - "uri": w.uri, - "label": w.translations.get(lang=lang).label, - "notice_count": w.notice_count - } for w in wqs] - - fontmax = 2.5 - fontmin = 1. - scale = (fontmax - fontmin)/max(1,words[0]["notice_count"]-words[-1]["notice_count"]) - - for w in words: - w["font_size"] = fontmin + scale * w["notice_count"] - + if show_tagcloud: + wqs = DbpediaResource.objects.filter(translations__lang=lang, notices__in=qs).annotate(notice_count=Count('notices')).order_by("-notice_count")[:wpp] + + words = [{ + "uri": w.uri, + "label": w.translations.get(lang=lang).label, + "notice_count": w.notice_count + } for w in wqs] + else: + words = [] + if words: + fontmax = 2.5 + fontmin = 1. + scale = (fontmax - fontmin)/max(1,words[0]["notice_count"]-words[-1]["notice_count"]) + + for w in words: + w["font_size"] = fontmin + scale * w["notice_count"] + context["words"] = words context['JOCONDE_IMG_BASE_URL'] = settings.JOCONDE_IMG_BASE_URL + context['duration'] = "%.2f"%(time.time() - starttime) + + return self.render_to_response(context) + +class NoticeView(View, TemplateResponseMixin): + + template_name = "jocondelab/front_notice.html" + + def get(self, request, notice_id): + + context = {} + lang = request.GET.get('lang',request.LANGUAGE_CODE) + + notice = Notice.objects.get(id=notice_id) + + context["notice"] = notice + context["title"] = notice.titr if notice.titr else notice.deno + context["images"] = [i.url for i in notice.images.exclude(relative_url__endswith='v.jpg')] + terms = [{ + "label": nt.term.label, + "thesaurus": nt.term.thesaurus.label, + "dbpedia_uri": nt.term.dbpedia_uri + } for nt in notice.noticeterm_set.select_related('term__thesaurus').all()] + uris = [t["dbpedia_uri"] for t in terms if t["dbpedia_uri"]] + lls = DbpediaTranslation.objects.filter(lang=lang, dbpediaresource__uri__in=uris).all() + locale_labels = {l.dbpediaresource.uri: l.label for l in lls} + for t in terms: + t["translated"] = (t["dbpedia_uri"] in locale_labels) + t["locale_label"] = locale_labels.get(t["dbpedia_uri"], t["label"]) + termsbythesaurus = {} + for term in terms: + if not term["thesaurus"] in termsbythesaurus: + termsbythesaurus[term["thesaurus"]] = { + "translated": [], + "untranslated": [] + } + termsbythesaurus[term["thesaurus"]]["translated" if term["translated"] else "untranslated"].append(term) + + context["terms_by_thesaurus"] = termsbythesaurus + + context['JOCONDE_IMG_BASE_URL'] = settings.JOCONDE_IMG_BASE_URL + return self.render_to_response(context) \ No newline at end of file