footnotes dictionary fixes
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 16 Sep 2011 14:11:00 +0000 (16:11 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 16 Sep 2011 14:11:00 +0000 (16:11 +0200)
apps/dictionary/locale/pl/LC_MESSAGES/django.mo
apps/dictionary/locale/pl/LC_MESSAGES/django.po
apps/dictionary/models.py
apps/dictionary/templates/dictionary/note_list.html
apps/dictionary/urls.py
apps/dictionary/views.py
wolnelektury/static/css/master.css

index 1104f8b..9e999eb 100644 (file)
Binary files a/apps/dictionary/locale/pl/LC_MESSAGES/django.mo and b/apps/dictionary/locale/pl/LC_MESSAGES/django.mo differ
index 8184c9a..4600948 100644 (file)
@@ -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 <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
 "Language-Team: LANGUAGE <LL@li.org>\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."
+
index f2a9ddf..b22e4be 100644 (file)
@@ -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)
index 6ae3664..e0b10f3 100755 (executable)
@@ -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 %}
-    <h1>Przypisy</h1>
+    <h1>{% trans "Footnotes" %}</h1>
     {% search_form %}
 
 
 </p>
 <hr/>
 
+<p>
+{% blocktrans count object_list.count as c %}{{c}} footnote found{% plural %}{{c}} footnotes found{% endblocktrans %}
+</p>
+
 {% if object_list %}
 
 {% autopaginate object_list 100 %}
index 84a30d7..435e0bd 100755 (executable)
@@ -7,6 +7,6 @@ from django.conf.urls.defaults import *
 
 urlpatterns = patterns('dictionary.views',
     url(r'^$', 'letter_notes', name='dictionary_notes'),
-    url(r'(?P<letter>[a-z])/$', 'letter_notes', name='dictionary_notes'),
+    url(r'(?P<letter>[a-z]|0-9)/$', 'letter_notes', name='dictionary_notes'),
 )
 
index 9f00224..e120063 100755 (executable)
@@ -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())
index 89040a5..4100e2b 100644 (file)
@@ -1180,3 +1180,7 @@ div.shown-tags p, div.all-tags p {
 .dictionary-note-source {
     margin-top: -1em;
 }
+
+#footnotes .pagination {
+    margin-top: 1em;
+}