Add lists of recent audiobooks and DAISY files.
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 12 Jun 2013 10:50:59 +0000 (12:50 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 12 Jun 2013 10:54:31 +0000 (12:54 +0200)
apps/catalogue/locale/pl/LC_MESSAGES/django.mo
apps/catalogue/locale/pl/LC_MESSAGES/django.po
apps/catalogue/templates/catalogue/recent_audiobooks_list.html [new file with mode: 0755]
apps/catalogue/templates/catalogue/recent_daisy_list.html [new file with mode: 0755]
apps/catalogue/templates/catalogue/recent_list.html
apps/catalogue/urls.py

index 7bb6169..4710d28 100644 (file)
Binary files a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo and b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo differ
index 6a4b4b4..13f11dc 100644 (file)
@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-06-12 11:04+0200\n"
-"PO-Revision-Date: 2013-06-12 11:05+0100\n"
+"POT-Creation-Date: 2013-06-12 12:48+0200\n"
+"PO-Revision-Date: 2013-06-12 12:54+0100\n"
 "Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "MIME-Version: 1.0\n"
@@ -621,11 +621,30 @@ msgstr ""
 msgid "Audiobooks were prepared as a part of the %(cs)s project."
 msgstr "Audiobooki przygotowane w ramach projektu %(cs)s."
 
+#: templates/catalogue/recent_audiobooks_list.html:5
+#: templates/catalogue/recent_audiobooks_list.html:10
+msgid "Recent audiobooks"
+msgstr "Ostatnio dodane audiobooki"
+
+#: templates/catalogue/recent_daisy_list.html:5
+#: templates/catalogue/recent_daisy_list.html:10
+msgid "Recent DAISY files"
+msgstr "Ostatnio dodane pliki DAISY"
+
 #: templates/catalogue/recent_list.html:5
 #: templates/catalogue/recent_list.html:10
 msgid "Recent publications"
 msgstr "Ostatnie publikacje"
 
+#: templates/catalogue/recent_list.html:15
+#, python-format
+msgid ""
+"You can also see <a href=\"%(a)s\">recent audiobooks</a>\n"
+"        and <a href=\"%(d)s\">recent DAISY files</a>."
+msgstr ""
+"Zobacz też listę <a href=\"%(a)s\">ostatnio dodanych audiobooków</a>\n"
+"       i <a href=\"%(d)s\">plików DAISY</a>."
+
 #: templates/catalogue/search_multiple_hits.html:5
 #: templates/catalogue/search_no_hits.html:5
 #: templates/catalogue/search_no_hits.html:10
diff --git a/apps/catalogue/templates/catalogue/recent_audiobooks_list.html b/apps/catalogue/templates/catalogue/recent_audiobooks_list.html
new file mode 100755 (executable)
index 0000000..762cb80
--- /dev/null
@@ -0,0 +1,15 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load catalogue_tags %}
+
+{% block titleextra %}{% trans "Recent audiobooks" %}{% endblock %}
+
+{% block bodyid %}recent-list{% endblock %}
+
+{% block body %}
+    <h1>{% trans "Recent audiobooks" %}</h1>
+
+    <div id="books-list">
+        {% work_list object_list %}
+    </div>
+{% endblock %}
diff --git a/apps/catalogue/templates/catalogue/recent_daisy_list.html b/apps/catalogue/templates/catalogue/recent_daisy_list.html
new file mode 100755 (executable)
index 0000000..6675af2
--- /dev/null
@@ -0,0 +1,15 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load catalogue_tags %}
+
+{% block titleextra %}{% trans "Recent DAISY files" %}{% endblock %}
+
+{% block bodyid %}recent-list{% endblock %}
+
+{% block body %}
+    <h1>{% trans "Recent DAISY files" %}</h1>
+
+    <div id="books-list">
+        {% work_list object_list %}
+    </div>
+{% endblock %}
index 31b2bde..28a96b8 100755 (executable)
@@ -9,6 +9,13 @@
 {% block body %}
     <h1>{% trans "Recent publications" %}</h1>
 
+    {% url 'recent_audiobooks_list' as a %}
+    {% url 'recent_daisy_list' as d %}
+    <p class='normal-text'>
+        {% blocktrans %}You can also see <a href="{{a}}">recent audiobooks</a>
+        and <a href="{{d}}">recent DAISY files</a>.{% endblocktrans %}
+    </p>
+
     <div id="books-list">
         {% work_list object_list %}
     </div>
index 7d6ff78..d88a68f 100644 (file)
@@ -3,6 +3,7 @@
 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
 #
 from django.conf.urls.defaults import *
+from django.db.models import Max
 from django.views.generic import ListView, RedirectView
 from catalogue.feeds import AudiobookFeed
 from catalogue.views import CustomPDFFormView
@@ -35,6 +36,12 @@ urlpatterns += patterns('catalogue.views',
     url(r'^nowe/$', ListView.as_view(
         queryset=Book.objects.filter(parent=None).order_by('-created_at'),
         template_name='catalogue/recent_list.html'), name='recent_list'),
+    url(r'^nowe/audiobooki/$', ListView.as_view(
+        queryset=Book.objects.filter(media__type__in=('mp3', 'ogg')).annotate(m=Max('media__uploaded_at')).order_by('-m'),
+            template_name='catalogue/recent_audiobooks_list.html'), name='recent_audiobooks_list'),
+    url(r'^nowe/daisy/$', ListView.as_view(
+        queryset=Book.objects.filter(media__type='daisy').annotate(m=Max('media__uploaded_at')).order_by('-m'),
+            template_name='catalogue/recent_daisy_list.html'), name='recent_daisy_list'),
 
     url(r'^custompdf/(?P<slug>%s)/$' % SLUG, CustomPDFFormView(), name='custom_pdf_form'),