From: Radek Czajka Date: Fri, 16 Sep 2011 14:11:00 +0000 (+0200) Subject: footnotes dictionary fixes X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/5411431fe8c247572635a206cc977816dded415c footnotes dictionary fixes --- diff --git a/apps/dictionary/locale/pl/LC_MESSAGES/django.mo b/apps/dictionary/locale/pl/LC_MESSAGES/django.mo index 1104f8ba7..9e999eb97 100644 Binary files a/apps/dictionary/locale/pl/LC_MESSAGES/django.mo and b/apps/dictionary/locale/pl/LC_MESSAGES/django.mo differ diff --git a/apps/dictionary/locale/pl/LC_MESSAGES/django.po b/apps/dictionary/locale/pl/LC_MESSAGES/django.po index 8184c9a75..4600948cc 100644 --- a/apps/dictionary/locale/pl/LC_MESSAGES/django.po +++ b/apps/dictionary/locale/pl/LC_MESSAGES/django.po @@ -5,24 +5,40 @@ # msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: WolneLektury-dictionary\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-16 12:21+0200\n" -"PO-Revision-Date: 2011-09-16 12:21+0100\n" +"POT-Creation-Date: 2011-09-16 16:08+0200\n" +"PO-Revision-Date: 2011-09-16 16:10+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" -"Language: \n" +"Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#: templates/dictionary/note_list.html:11 +#: templates/dictionary/note_list.html:8 +msgid "Footnotes on WolneLektury.pl" +msgstr "Przypisy w WolneLektury.pl" + +#: templates/dictionary/note_list.html:12 +msgid "Footnotes" +msgstr "Przypisy" + +#: templates/dictionary/note_list.html:17 msgid "By first letter" msgstr "Pierwsza litera" -#: templates/dictionary/note_list.html:13 -#: templates/dictionary/note_list.html:15 +#: templates/dictionary/note_list.html:19 +#: templates/dictionary/note_list.html:21 msgid "all" msgstr "wszystkie" +#: templates/dictionary/note_list.html:36 +#, python-format +msgid "%(c)s footnote found" +msgid_plural "%(c)s footnotes found" +msgstr[0] "Znaleziono %(c)s przypis." +msgstr[1] "Znaleziono %(c)s przypisy." +msgstr[2] "Znaleziono %(c)s przypisów." + diff --git a/apps/dictionary/models.py b/apps/dictionary/models.py index f2a9ddf28..b22e4be42 100644 --- a/apps/dictionary/models.py +++ b/apps/dictionary/models.py @@ -25,7 +25,8 @@ def notes_from_book(sender, **kwargs): if sender.html_file: for anchor, text_str, html_str in html.extract_annotations(sender.html_file.path): Note.objects.create(book=sender, anchor=anchor, - html=html_str, sort_key=sortify(text_str)[:128]) + html=html_str, + sort_key=sortify(text_str).strip()[:128]) # always re-extract notes after making a HTML in a Book Book.html_built.connect(notes_from_book) diff --git a/apps/dictionary/templates/dictionary/note_list.html b/apps/dictionary/templates/dictionary/note_list.html index 6ae3664ea..e0b10f3c2 100755 --- a/apps/dictionary/templates/dictionary/note_list.html +++ b/apps/dictionary/templates/dictionary/note_list.html @@ -2,8 +2,14 @@ {% load i18n pagination_tags %} {% load catalogue_tags %} + +{% block bodyid %}footnotes{% endblock %} + +{% block title %}{% trans "Footnotes on WolneLektury.pl" %}{% endblock %} + + {% block body %} -

Przypisy

+

{% trans "Footnotes" %}

{% search_form %} @@ -26,6 +32,10 @@


+

+{% blocktrans count object_list.count as c %}{{c}} footnote found{% plural %}{{c}} footnotes found{% endblocktrans %} +

+ {% if object_list %} {% autopaginate object_list 100 %} diff --git a/apps/dictionary/urls.py b/apps/dictionary/urls.py index 84a30d7e0..435e0bd6b 100755 --- a/apps/dictionary/urls.py +++ b/apps/dictionary/urls.py @@ -7,6 +7,6 @@ from django.conf.urls.defaults import * urlpatterns = patterns('dictionary.views', url(r'^$', 'letter_notes', name='dictionary_notes'), - url(r'(?P[a-z])/$', 'letter_notes', name='dictionary_notes'), + url(r'(?P[a-z]|0-9)/$', 'letter_notes', name='dictionary_notes'), ) diff --git a/apps/dictionary/views.py b/apps/dictionary/views.py index 9f0022475..e12006366 100755 --- a/apps/dictionary/views.py +++ b/apps/dictionary/views.py @@ -8,9 +8,11 @@ from dictionary.models import Note def letter_notes(request, letter=None): form = SearchForm() - letters = [chr(a) for a in range(ord('a'), ord('z')+1)] + letters = ["0-9"] + [chr(a) for a in range(ord('a'), ord('z')+1)] objects = Note.objects.all() - if letter: + if letter == "0-9": + objects = objects.filter(sort_key__regex=r"^[0-9]") + elif letter: objects = objects.filter(sort_key__startswith=letter) return object_list(request, queryset=objects, extra_context=locals()) diff --git a/wolnelektury/static/css/master.css b/wolnelektury/static/css/master.css index 89040a5b7..4100e2b7c 100644 --- a/wolnelektury/static/css/master.css +++ b/wolnelektury/static/css/master.css @@ -1180,3 +1180,7 @@ div.shown-tags p, div.all-tags p { .dictionary-note-source { margin-top: -1em; } + +#footnotes .pagination { + margin-top: 1em; +}