From: Lukasz Date: Tue, 11 May 2010 09:52:43 +0000 (+0200) Subject: Merge branch 'master' of http://github.com/fnp/wolnelektury X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/20d46221c322ee9165596246639c8b897a06d120?hp=373f20f311d78b22849e9529299eddcbefb080bd Merge branch 'master' of github.com/fnp/wolnelektury --- diff --git a/.gitignore b/.gitignore index 1152ea7a0..d78f78f5e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ thumbs.db .project .settings .pydevproject +.tmp_* + diff --git a/apps/catalogue/forms.py b/apps/catalogue/forms.py index 4b600b639..b040ef911 100644 --- a/apps/catalogue/forms.py +++ b/apps/catalogue/forms.py @@ -18,7 +18,7 @@ class BookImportForm(forms.Form): class SearchForm(forms.Form): - q = JQueryAutoCompleteField('/katalog/tags/', {'minChars': 2, 'selectFirst': True, 'cacheLength': 50}) + q = JQueryAutoCompleteField('/katalog/tags/', {'minChars': 2, 'selectFirst': True, 'cacheLength': 50, 'matchContains': "word"}) tags = forms.CharField(widget=forms.HiddenInput, required=False) def __init__(self, *args, **kwargs): diff --git a/wolnelektury/static/js/jquery.autocomplete.js b/wolnelektury/static/js/jquery.autocomplete.js index 9d12a29f2..7cdb359d5 100644 --- a/wolnelektury/static/js/jquery.autocomplete.js +++ b/wolnelektury/static/js/jquery.autocomplete.js @@ -10,6 +10,11 @@ * Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $ */ +/* + * Modified by Radek Czajka, Fundacja Nowoczesna Polska, 2010-05-10: + * escape regex for word start checking in matchSubset + */ + ;(function($) { $.fn.extend({ @@ -442,7 +447,7 @@ $.Autocompleter.Cache = function(options) { s = s.toLowerCase(); var i = s.indexOf(sub); if (options.matchContains == "word"){ - i = s.toLowerCase().search("\\b" + sub.toLowerCase()); + i = s.toLowerCase().search("\\b" + sub.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1").toLowerCase()); } if (i == -1) return false; return i == 0 || options.matchContains; diff --git a/wolnelektury/static/js/jquery.countdown-pl.js b/wolnelektury/static/js/jquery.countdown-pl.js index 34b805ac2..4d6d1d44c 100644 --- a/wolnelektury/static/js/jquery.countdown-pl.js +++ b/wolnelektury/static/js/jquery.countdown-pl.js @@ -7,7 +7,9 @@ labels: ['lat', 'miesięcy', 'tygodni', 'dni', 'godzin', 'minut', 'sekund'], labels1: ['rok', 'miesiąc', 'tydzień', 'dzień', 'godzina', 'minuta', 'sekunda'], labels2: ['lata', 'miesiące', 'tygodnie', 'dni', 'godziny', 'minuty', 'sekundy'], - compactLabels: ['l', 'm', 't', 'd'], compactLabels1: ['r', 'm', 't', 'd'], + compactLabels: ['l', 'm', 't', 'd'], + compactLabels1: ['r', 'm', 't', 'd'], + compactLabels2: ['l', 'm', 't', 'd'], timeSeparator: ':', isRTL: false, which: function(n){ return n==1 ? 1 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 2 : 0; diff --git a/wolnelektury/static/js/jquery.countdown.js b/wolnelektury/static/js/jquery.countdown.js index 5375ce815..11d550612 100644 --- a/wolnelektury/static/js/jquery.countdown.js +++ b/wolnelektury/static/js/jquery.countdown.js @@ -6,7 +6,7 @@ Please attribute the author if you use it. */ /* Modified by Radek Czajka, Fundacja Nowoczesna Polska (radoslaw.czajka(at)nowoczesnapolska.org.pl) */ - +w /* Display a countdown timer. Attach it with options like: $('div selector').countdown( @@ -471,7 +471,10 @@ $.extend(Countdown.prototype, { var timeSeparator = this._get(inst, 'timeSeparator'); var description = this._get(inst, 'description') || ''; var showCompact = function(period) { - var labelsNum = $.countdown._get(inst, 'compactLabels' + periods[period]); + var which = $.countdown._get(inst, 'which'); + if (which) { + var labelsNum = $.countdown._get(inst, 'compactLabels' + which(periods[period])); + } return (show[period] ? periods[period] + (labelsNum ? labelsNum[period] : labels[period]) + ' ' : ''); }; diff --git a/wolnelektury/templates/1percent.html b/wolnelektury/templates/1percent.html index 2e4c5576b..e53caeefd 100644 --- a/wolnelektury/templates/1percent.html +++ b/wolnelektury/templates/1percent.html @@ -1,5 +1,5 @@ -{% load i18n %} {% extends 'base.html' %} +{% load i18n %} {% block title %}1% podatku na WolneLektury.pl{% endblock title %} diff --git a/wolnelektury/templates/admin/base_site.html b/wolnelektury/templates/admin/base_site.html index 087a3bb32..7e6b49227 100644 --- a/wolnelektury/templates/admin/base_site.html +++ b/wolnelektury/templates/admin/base_site.html @@ -1,5 +1,5 @@ -{% load i18n %} {% extends "admin/base.html" %} +{% load i18n %} {% block title %}{{ title }} | {% trans "Site administration" %} - WolneLektury.pl{% endblock %} diff --git a/wolnelektury/templates/admin/catalogue/book/change_list.html b/wolnelektury/templates/admin/catalogue/book/change_list.html index ee2b43f39..09e567a5d 100644 --- a/wolnelektury/templates/admin/catalogue/book/change_list.html +++ b/wolnelektury/templates/admin/catalogue/book/change_list.html @@ -1,5 +1,5 @@ -{% load i18n %} {% extends "admin/change_list.html" %} +{% load i18n %} {% block content %}
diff --git a/wolnelektury/templates/auth/login.html b/wolnelektury/templates/auth/login.html index 733314dac..2e80c55a3 100644 --- a/wolnelektury/templates/auth/login.html +++ b/wolnelektury/templates/auth/login.html @@ -1,5 +1,5 @@ -{% load i18n %} {% extends "base.html" %} +{% load i18n %} {% block title %}{% trans "Sign in" %} / {% trans "Register on"%} WolneLektury.pl{% endblock %} diff --git a/wolnelektury/templates/catalogue/book_detail.html b/wolnelektury/templates/catalogue/book_detail.html index 4cc4ea82a..03b46bc7b 100644 --- a/wolnelektury/templates/catalogue/book_detail.html +++ b/wolnelektury/templates/catalogue/book_detail.html @@ -1,5 +1,5 @@ -{% load i18n %} {% extends "base.html" %} +{% load i18n %} {% load catalogue_tags pagination_tags %} {% block title %}{{ book.title }} w WolneLektury.pl{% endblock %} @@ -34,10 +34,10 @@ {% trans "Download PDF" %} {% endif %} {% if book.odt_file %} - {% trans "Download ODT %} + {% trans "Download ODT" %} {% endif %} {% if book.txt_file %} - {% trans "Download TXT %} + {% trans "Download TXT" %} {% endif %} {% if book.mp3_file %}
diff --git a/wolnelektury/templates/catalogue/book_fragments.html b/wolnelektury/templates/catalogue/book_fragments.html index bb5fba2b8..0a90e459c 100644 --- a/wolnelektury/templates/catalogue/book_fragments.html +++ b/wolnelektury/templates/catalogue/book_fragments.html @@ -1,5 +1,5 @@ -{% load i18n %} {% extends "base.html" %} +{% load i18n %} {% load catalogue_tags pagination_tags %} {% block title %}{% trans "Theme" %} {{ theme }} {% trans "in work " %} {{ book }} {% "on " %} WolneLektury.pl{% endblock %} diff --git a/wolnelektury/templates/catalogue/book_list.html b/wolnelektury/templates/catalogue/book_list.html index b6a9e6cbb..3e6a9c555 100644 --- a/wolnelektury/templates/catalogue/book_list.html +++ b/wolnelektury/templates/catalogue/book_list.html @@ -1,5 +1,5 @@ -{% load i18n %} {% extends "base.html" %} +{% load i18n %} {% load catalogue_tags chunks %} {% block bodyid %}book-a-list{% endblock %} diff --git a/wolnelektury/templates/catalogue/tagged_object_list.html b/wolnelektury/templates/catalogue/tagged_object_list.html index beb3eae50..b8d091a92 100644 --- a/wolnelektury/templates/catalogue/tagged_object_list.html +++ b/wolnelektury/templates/catalogue/tagged_object_list.html @@ -1,5 +1,5 @@ -{% load i18n %} {% extends "base.html" %} +{% load i18n %} {% load catalogue_tags pagination_tags %} {% block title %}{% title_from_tags tags %} w WolneLektury.pl{% endblock %} diff --git a/wolnelektury/templates/lessons/document_detail.html b/wolnelektury/templates/lessons/document_detail.html index 17faaea48..7c6406c19 100644 --- a/wolnelektury/templates/lessons/document_detail.html +++ b/wolnelektury/templates/lessons/document_detail.html @@ -1,5 +1,5 @@ -{% load i18n %} {% extends 'base.html' %} +{% load i18n %} {% block title %}{{ object.title }} w WolneLektury.pl{% endblock %} diff --git a/wolnelektury/templates/lessons/document_list.html b/wolnelektury/templates/lessons/document_list.html index 9d30d519e..84dee5352 100644 --- a/wolnelektury/templates/lessons/document_list.html +++ b/wolnelektury/templates/lessons/document_list.html @@ -1,5 +1,5 @@ -{% load i18n %} {% extends "base.html" %} +{% load i18n %} {% load catalogue_tags chunks %} {% block bodyid %}document-list-body{% endblock %}