From d09ed2493a6532135e8ab6613def2e62b695fe95 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Wed, 12 Jun 2013 12:50:59 +0200 Subject: [PATCH] Add lists of recent audiobooks and DAISY files. --- .../catalogue/locale/pl/LC_MESSAGES/django.mo | Bin 10776 -> 11193 bytes .../catalogue/locale/pl/LC_MESSAGES/django.po | 23 ++++++++++++++++-- .../catalogue/recent_audiobooks_list.html | 15 ++++++++++++ .../catalogue/recent_daisy_list.html | 15 ++++++++++++ .../templates/catalogue/recent_list.html | 7 ++++++ apps/catalogue/urls.py | 7 ++++++ 6 files changed, 65 insertions(+), 2 deletions(-) create mode 100755 apps/catalogue/templates/catalogue/recent_audiobooks_list.html create mode 100755 apps/catalogue/templates/catalogue/recent_daisy_list.html diff --git a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo index 7bb6169c5f6a803218f604e17502331c7e8dc012..4710d284df344d5841a291c5de111dcf919993b9 100644 GIT binary patch delta 3646 zcmZA23v5ky0LSrvX-n%(=UIA`R?WNWt%jP{JVrgL^}5=tZd<+d-ZHP9VWx}@#Vj!y zf|;-_U1SnwTiJ{)StgUQ*kX@lvBd<5Y)iI%fA{=tH~#VK=YP&U=l?wC*f-=EjG9S4>b`}@s+wZ# zgq5fn?nZXg>_=UH5ZmA})WFZ9t3Cgkif*`vYVc3g634XkW}b|?aUg0%rl2}3L@qVU zQ7f|%wPm|d6F82#?hLBKPf^$1#B}_vrEw!OY{hzU&ZM9k%tS5W7<)bsSuInF>R>IZ zgBsL;4`VgHg?fgDFiLGvHmbd`*dOz7AZ|n5SC_>4tD(!B;9heB@8KO(hqoBE8n}mA zfmnJUhsmfVEkZR^f{~R#t>{KP8)M8HsP^ZvuUd(v)-|a1wzyQZBnPns-$6Clfmc9# zmx_9Lx>+-=*{A`GN6mDKJwF@u%q+6Mm!mok+w&Xj`D)aF-Q85w(NR=KCr}UBY1Ed~ zA&X(Ip*s2%^)Nm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5Zx=786$8G2?uv#ypPNx801h&dD__Ui_INt#Vcn_qPa$nYzXSQ?W%2}BL*mIU@+cW7>p7?( z&ysbvG7U%CV=\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'), -- 2.20.1