From: Radek Czajka Date: Wed, 12 Jun 2013 10:50:59 +0000 (+0200) Subject: Add lists of recent audiobooks and DAISY files. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/d09ed2493a6532135e8ab6613def2e62b695fe95?ds=sidebyside;hp=--cc Add lists of recent audiobooks and DAISY files. --- d09ed2493a6532135e8ab6613def2e62b695fe95 diff --git a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo index 7bb6169c5..4710d284d 100644 Binary files a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo and b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo differ diff --git a/apps/catalogue/locale/pl/LC_MESSAGES/django.po b/apps/catalogue/locale/pl/LC_MESSAGES/django.po index 6a4b4b47a..13f11dccb 100644 --- a/apps/catalogue/locale/pl/LC_MESSAGES/django.po +++ b/apps/catalogue/locale/pl/LC_MESSAGES/django.po @@ -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 \n" "Language-Team: LANGUAGE \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 recent audiobooks\n" +" and recent DAISY files." +msgstr "" +"Zobacz też listę ostatnio dodanych audiobooków\n" +" i plików DAISY." + #: 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 index 000000000..762cb80d7 --- /dev/null +++ b/apps/catalogue/templates/catalogue/recent_audiobooks_list.html @@ -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 %} +

{% trans "Recent audiobooks" %}

+ +
+ {% work_list object_list %} +
+{% 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 index 000000000..6675af206 --- /dev/null +++ b/apps/catalogue/templates/catalogue/recent_daisy_list.html @@ -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 %} +

{% trans "Recent DAISY files" %}

+ +
+ {% work_list object_list %} +
+{% endblock %} diff --git a/apps/catalogue/templates/catalogue/recent_list.html b/apps/catalogue/templates/catalogue/recent_list.html index 31b2bde81..28a96b831 100755 --- a/apps/catalogue/templates/catalogue/recent_list.html +++ b/apps/catalogue/templates/catalogue/recent_list.html @@ -9,6 +9,13 @@ {% block body %}

{% trans "Recent publications" %}

+ {% url 'recent_audiobooks_list' as a %} + {% url 'recent_daisy_list' as d %} +

+ {% blocktrans %}You can also see recent audiobooks + and recent DAISY files.{% endblocktrans %} +

+
{% work_list object_list %}
diff --git a/apps/catalogue/urls.py b/apps/catalogue/urls.py index 7d6ff7857..d88a68f15 100644 --- a/apps/catalogue/urls.py +++ b/apps/catalogue/urls.py @@ -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%s)/$' % SLUG, CustomPDFFormView(), name='custom_pdf_form'),