# HG changeset patch # User veltr # Date 1381242840 -7200 # Node ID 752062bdeb109308252e86b0d297af45af474e19 # Parent e2043b49682d1833eab3281f63bb5f13acb05a99 Corrected image load bug and added describe prev/next diff -r e2043b49682d -r 752062bdeb10 src/jocondelab/management/commands/populate_notice_years.py --- a/src/jocondelab/management/commands/populate_notice_years.py Mon Oct 07 13:32:09 2013 +0200 +++ b/src/jocondelab/management/commands/populate_notice_years.py Tue Oct 08 16:34:00 2013 +0200 @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- -from django.core.management.base import BaseCommand +from django.core.management.base import NoArgsCommand from core.models import (Notice) from core.utils import show_progress from jocondelab.models import NoticeYears from django.db import reset_queries, transaction +from optparse import make_option import re -class Command(BaseCommand): +class Command(NoArgsCommand): help = "Extract Years from MILL field" diff -r e2043b49682d -r 752062bdeb10 src/jocondelab/static/jocondelab/css/front-notice.css --- a/src/jocondelab/static/jocondelab/css/front-notice.css Mon Oct 07 13:32:09 2013 +0200 +++ b/src/jocondelab/static/jocondelab/css/front-notice.css Tue Oct 08 16:34:00 2013 +0200 @@ -15,11 +15,23 @@ } .describe-mode .notice-images li { - margin: 0; box-shadow: 0 0 3px #999999; display: inline-block; max-width: 100%; + margin: 0; display: inline-block; max-width: 80%; +} + +.describe-mode .notice-images li:nth-child(n+2) { + float: right; clear: right; width: 20%; } .describe-mode .notice-images img { - max-height: 500px; + max-height: 480px; +} + +.describe-mode .notice-images li:nth-child(n+2) img { + max-height: 160px; +} + +.describe-title { + font-size: 18px; margin: 5px 0; clear: both; font-weight: bold; } .notice-colright-wrapper { diff -r e2043b49682d -r 752062bdeb10 src/jocondelab/static/jocondelab/img/default-image.png Binary file src/jocondelab/static/jocondelab/img/default-image.png has changed diff -r e2043b49682d -r 752062bdeb10 src/jocondelab/static/jocondelab/js/front-common.js --- a/src/jocondelab/static/jocondelab/js/front-common.js Mon Oct 07 13:32:09 2013 +0200 +++ b/src/jocondelab/static/jocondelab/js/front-common.js Tue Oct 08 16:34:00 2013 +0200 @@ -1,3 +1,24 @@ +/* Image load events may be triggered before jQuery is loaded. + * Here we bind temporary functions to the Window namespace */ + +(function() { + + function tmpBind(property) { + window[property] = function() { + var arglist = Array.prototype.slice.call(arguments); + setTimeout(function() { + window[property].apply(window, arglist); + }, 500); + }; + } + + var propsToBind = [ "onWikiImageLoad", "onWikiImageError", "onResultImageError" ]; + for (var i = 0; i < propsToBind.length; i++) { + tmpBind(propsToBind[i]); + } + +})(); + $(function() { /* SEARCH TAG-IT */ @@ -332,6 +353,11 @@ adaptGrid(); }; + window.onResultImageError = function(img) { + img.src = urls.img_if_404; + throttledCheckSizes(); + }; + /* END NOTICE LIST MANAGEMENT */ /* AJAX SCROLL LOAD */ @@ -398,6 +424,7 @@ window.loadSearchResults = function(query) { $(".hide-on-search").hide(); $win.off("scroll.ajaxload"); + $(".wiki-info img").off("load error"); $results.empty(); $(".loading-please-wait").show(); $.ajax({ @@ -443,11 +470,17 @@ } } - /* */ - resizeWikiInfo(); - $(".wiki-info img").on("load", resizeWikiInfo); + window.onWikiImageLoad = function() { + resizeWikiInfo(true); + }; + window.onWikiImageError = function(img) { + $(img).hide(); + resizeWikiInfo(true); + }; + + /* */ $win.resize(function() { adaptGrid(); diff -r e2043b49682d -r 752062bdeb10 src/jocondelab/static/jocondelab/js/front-notice.js --- a/src/jocondelab/static/jocondelab/js/front-notice.js Mon Oct 07 13:32:09 2013 +0200 +++ b/src/jocondelab/static/jocondelab/js/front-notice.js Tue Oct 08 16:34:00 2013 +0200 @@ -291,4 +291,5 @@ }); return false; }); + }); diff -r e2043b49682d -r 752062bdeb10 src/jocondelab/templates/jocondelab/front_base.html --- a/src/jocondelab/templates/jocondelab/front_base.html Mon Oct 07 13:32:09 2013 +0200 +++ b/src/jocondelab/templates/jocondelab/front_base.html Tue Oct 08 16:34:00 2013 +0200 @@ -31,7 +31,8 @@ diff -r e2043b49682d -r 752062bdeb10 src/jocondelab/templates/jocondelab/front_describe.html --- a/src/jocondelab/templates/jocondelab/front_describe.html Mon Oct 07 13:32:09 2013 +0200 +++ b/src/jocondelab/templates/jocondelab/front_describe.html Tue Oct 08 16:34:00 2013 +0200 @@ -2,13 +2,12 @@ {% load i18n %} {% block title %}JocondeLab » {% trans "Contribuer" %}{% endblock %} - -{% block breadcrumbs %}{% trans "Contribuer" %}{% endblock %} +{% url 'front_about' as url %} +{% block breadcrumbs %}{% trans "Contribuer" %}{% endblock %} {% block main %}