From: Jan Szejko
Date: Thu, 20 Dec 2018 11:42:49 +0000 (+0100)
Subject: mobile PDF option
X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/refs/heads/production?ds=inline;hp=29ef20529bc67b9c1ecb09cd067c4481d252916f
mobile PDF option
---
diff --git a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo
index 8c88b6b0..87bdfbf9 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 53b753b1..6387b5d6 100644
--- a/apps/catalogue/locale/pl/LC_MESSAGES/django.po
+++ b/apps/catalogue/locale/pl/LC_MESSAGES/django.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Platforma Redakcyjna\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-03-15 18:38+0100\n"
+"POT-Creation-Date: 2018-12-20 12:30+0100\n"
"PO-Revision-Date: 2014-03-27 13:17+0100\n"
"Last-Translator: Radek Czajka \n"
"Language-Team: Fundacja Nowoczesna Polska =20) ? 1 : 2);\n"
"X-Generator: Poedit 1.5.4\n"
-#: forms.py:39
+#: forms.py:40
msgid "Text file must be UTF-8 encoded."
msgstr "Plik powinien mieÄ kodowanie UTF-8."
-#: forms.py:42
+#: forms.py:43
msgid "You must either enter text or upload a file"
msgstr "ProszÄ wpisaÄ tekst albo wybraÄ plik do zaÅadowania"
-#: forms.py:51
+#: forms.py:52
msgid "ZIP file"
msgstr "Plik ZIP"
-#: forms.py:52
+#: forms.py:53
msgid "Directories are documents in chunks"
msgstr "Katalogi zawierajÄ
dokumenty w czÄÅciach"
-#: forms.py:76 forms.py:165
+#: forms.py:77 forms.py:178
msgid "Assigned to"
msgstr "Przypisane do"
-#: forms.py:97 forms.py:111
+#: forms.py:98 forms.py:112
msgid "Chunk with this slug already exists"
msgstr "CzÄÅÄ z tym slugiem już istnieje"
-#: forms.py:120
+#: forms.py:121
msgid "Append to"
msgstr "DoÅÄ
cz do"
-#: views.py:168
+#: views.py:172
#, python-format
msgid "Slug already used for %s"
msgstr "Slug taki sam jak dla pliku %s"
-#: views.py:170
+#: views.py:174
msgid "Slug already used in repository."
msgstr "Dokument o tym slugu już istnieje w repozytorium."
-#: views.py:176
+#: views.py:180
msgid "File should be UTF-8 encoded."
msgstr "Plik powinien mieÄ kodowanie UTF-8."
-#: views.py:595 models/book.py:56
+#: views.py:619 models/book.py:56
msgid "books"
msgstr "ksiÄ
żki"
-#: views.py:597
+#: views.py:621
msgid "scan gallery"
msgstr "galeria skanów"
@@ -105,19 +105,19 @@ msgstr "KsiÄ
żka nie ma czÄÅci."
msgid "Not all chunks have publishable revisions."
msgstr "Niektóre czÄÅci nie sÄ
gotowe do publikacji."
-#: models/book.py:272 models/image.py:82
+#: models/book.py:272 models/image.py:86
msgid "Invalid XML"
msgstr "NieprawidÅowy XML"
-#: models/book.py:274 models/image.py:84
+#: models/book.py:274 models/image.py:88
msgid "No Dublin Core found."
msgstr "Brak sekcji Dublin Core."
-#: models/book.py:276 models/image.py:86
+#: models/book.py:276 models/image.py:90
msgid "Invalid Dublin Core"
msgstr "NieprawidÅowy Dublin Core"
-#: models/book.py:279 models/image.py:90
+#: models/book.py:279 models/image.py:94
msgid "rdf:about is not"
msgstr "rdf:about jest różny od"
@@ -216,7 +216,7 @@ msgstr "Użytkownicy aktywni od"
msgid "Activity"
msgstr "AktywnoÅÄ"
-#: templates/catalogue/base.html:8
+#: templates/catalogue/base.html:10
msgid "Platforma Redakcyjna"
msgstr "Platforma Redakcyjna"
@@ -226,8 +226,7 @@ msgid "Append book"
msgstr "DoÅÄ
cz ksiÄ
żkÄ"
#: templates/catalogue/book_detail.html:18
-#: templates/catalogue/book_edit.html:13
-#: templates/catalogue/chunk_edit.html:16
+#: templates/catalogue/book_edit.html:13 templates/catalogue/chunk_edit.html:16
#: templates/catalogue/image_detail.html:18
msgid "Save"
msgstr "Zapisz"
@@ -272,33 +271,32 @@ msgid "PDF version"
msgstr "Wersja PDF"
#: templates/catalogue/book_detail.html:72
+msgid "PDF version for mobiles"
+msgstr "Wersja PDF na telefony"
+
+#: templates/catalogue/book_detail.html:73
msgid "EPUB version"
msgstr "Wersja EPUB"
-#: templates/catalogue/book_detail.html:73
+#: templates/catalogue/book_detail.html:74
msgid "MOBI version"
msgstr "Wersja MOBI"
-#: templates/catalogue/book_detail.html:86
+#: templates/catalogue/book_detail.html:88
#: templates/catalogue/image_detail.html:57
msgid "Publish"
msgstr "Opublikuj"
-#: templates/catalogue/book_detail.html:90
+#: templates/catalogue/book_detail.html:92
#: templates/catalogue/image_detail.html:61
msgid "Log in to publish."
msgstr "Zaloguj siÄ, aby opublikowaÄ."
-#: templates/catalogue/book_detail.html:93
+#: templates/catalogue/book_detail.html:95
#: templates/catalogue/image_detail.html:64
msgid "This book can't be published yet, because:"
msgstr "Ta ksiÄ
żka nie może jeszcze zostaÄ opublikowana. Powód:"
-#: templates/catalogue/book_detail.html:103
-#: templates/catalogue/image_detail.html:72
-msgid "Comments"
-msgstr "Komentarze"
-
#: templates/catalogue/book_edit.html:5
msgid "Edit book"
msgstr "Edytuj ksiÄ
żkÄ"
@@ -494,8 +492,7 @@ msgstr "Twoje ostatnie edycje"
msgid "Recent activity for"
msgstr "Ostatnia aktywnoÅÄ dla:"
-#: templates/catalogue/upload_pdf.html:5
-#: templates/catalogue/upload_pdf.html:11
+#: templates/catalogue/upload_pdf.html:5 templates/catalogue/upload_pdf.html:11
msgid "PDF file upload"
msgstr "Åadowanie pliku PDF"
@@ -581,6 +578,9 @@ msgstr "Zmiana"
msgid "Comment"
msgstr "Komentarz"
+#~ msgid "Comments"
+#~ msgstr "Komentarze"
+
#~ msgid "Mark publishable"
#~ msgstr "Oznacz do publikacji"
diff --git a/apps/catalogue/templates/catalogue/book_detail.html b/apps/catalogue/templates/catalogue/book_detail.html
index 65a22876..4712edf3 100755
--- a/apps/catalogue/templates/catalogue/book_detail.html
+++ b/apps/catalogue/templates/catalogue/book_detail.html
@@ -69,6 +69,7 @@
{% trans "HTML version" %}
{% trans "TXT version" %}
{% trans "PDF version" %}
+ {% trans "PDF version for mobiles" %}
{% trans "EPUB version" %}
{% trans "MOBI version" %}
diff --git a/apps/catalogue/urls.py b/apps/catalogue/urls.py
index 022839e8..e81c0a36 100644
--- a/apps/catalogue/urls.py
+++ b/apps/catalogue/urls.py
@@ -43,6 +43,7 @@ urlpatterns = patterns('catalogue.views',
url(r'^book/(?P[^/]+)/epub$', 'book_epub', name="catalogue_book_epub"),
url(r'^book/(?P[^/]+)/mobi$', 'book_mobi', name="catalogue_book_mobi"),
url(r'^book/(?P[^/]+)/pdf$', 'book_pdf', name="catalogue_book_pdf"),
+ url(r'^book/(?P[^/]+)/pdf-mobile$', 'book_pdf', kwargs={'mobile': True}, name="catalogue_book_pdf_mobile"),
url(r'^chunk_add/(?P[^/]+)/(?P[^/]+)/$',
'chunk_add', name="catalogue_chunk_add"),
diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py
index 76001f9e..b6521c7f 100644
--- a/apps/catalogue/views.py
+++ b/apps/catalogue/views.py
@@ -264,7 +264,7 @@ def book_html(request, slug):
@never_cache
-def book_pdf(request, slug):
+def book_pdf(request, slug, mobile=False):
book = get_object_or_404(Book, slug=slug)
if not book.accessible(request):
return HttpResponseForbidden("Not authorized.")
@@ -272,7 +272,8 @@ def book_pdf(request, slug):
# TODO: move to celery
doc = book.wldocument()
# TODO: error handling
- pdf_file = doc.as_pdf(cover=True, ilustr_path=book.gallery_path())
+ customizations = ['26pt', 'nothemes', 'nomargins', 'notoc'] if mobile else None
+ pdf_file = doc.as_pdf(cover=True, ilustr_path=book.gallery_path(), customizations=customizations)
from catalogue.ebook_utils import serve_file
return serve_file(pdf_file.get_filename(),
book.slug + '.pdf', 'application/pdf')
diff --git a/lib/librarian b/lib/librarian
index 2efffe35..03c22584 160000
--- a/lib/librarian
+++ b/lib/librarian
@@ -1 +1 @@
-Subproject commit 2efffe35d382709702c66b9f03131662ae2605fb
+Subproject commit 03c2258429bf8f80e88025fce45126960bfcd827