fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
35e339d
)
No cover option in custom PDF.
author
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 22 Aug 2012 12:14:35 +0000
(14:14 +0200)
committer
Radek Czajka
<radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 22 Aug 2012 12:14:35 +0000
(14:14 +0200)
apps/catalogue/forms.py
patch
|
blob
|
history
apps/catalogue/locale/pl/LC_MESSAGES/django.mo
patch
|
blob
|
history
apps/catalogue/locale/pl/LC_MESSAGES/django.po
patch
|
blob
|
history
apps/catalogue/tasks.py
patch
|
blob
|
history
diff --git
a/apps/catalogue/forms.py
b/apps/catalogue/forms.py
index
5fb113c
..
480eddf
100644
(file)
--- a/
apps/catalogue/forms.py
+++ b/
apps/catalogue/forms.py
@@
-46,6
+46,7
@@
CUSTOMIZATION_FLAGS = (
('nofootnotes', _("Don't show footnotes")),
('nothemes', _("Don't disply themes")),
('nowlfont', _("Don't use our custom font")),
('nofootnotes', _("Don't show footnotes")),
('nothemes', _("Don't disply themes")),
('nowlfont', _("Don't use our custom font")),
+ ('no-cover', _("Without cover")),
)
CUSTOMIZATION_OPTIONS = (
('leading', _("Leading"), (
)
CUSTOMIZATION_OPTIONS = (
('leading', _("Leading"), (
diff --git
a/apps/catalogue/locale/pl/LC_MESSAGES/django.mo
b/apps/catalogue/locale/pl/LC_MESSAGES/django.mo
index
5e2032d
..
dfd8de0
100644
(file)
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
ea16abf
..
f97d119
100644
(file)
--- 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"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-0
7-19 11:39
+0200\n"
-"PO-Revision-Date: 2012-0
1-27 16:36
+0100\n"
+"POT-Creation-Date: 2012-0
8-22 14:06
+0200\n"
+"PO-Revision-Date: 2012-0
8-22 14:12
+0100\n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
@@
-37,201
+37,226
@@
msgstr "Bez motywów"
msgid "Don't use our custom font"
msgstr "Bez naszego kroju pisma"
msgid "Don't use our custom font"
msgstr "Bez naszego kroju pisma"
-#: forms.py:51
+#: forms.py:49
+msgid "Without cover"
+msgstr "Bez okładki"
+
+#: forms.py:52
msgid "Leading"
msgstr "Interlinia"
msgid "Leading"
msgstr "Interlinia"
-#: forms.py:5
2
+#: forms.py:5
3
msgid "Normal leading"
msgstr "Zwykła interlinia"
msgid "Normal leading"
msgstr "Zwykła interlinia"
-#: forms.py:5
3
+#: forms.py:5
4
msgid "One and a half leading"
msgstr "Powiększona interlinia"
msgid "One and a half leading"
msgstr "Powiększona interlinia"
-#: forms.py:5
4
+#: forms.py:5
5
msgid "Double leading"
msgstr "Podwójna interlinia"
msgid "Double leading"
msgstr "Podwójna interlinia"
-#: forms.py:5
6
+#: forms.py:5
7
msgid "Font size"
msgstr "Rozmiar tekstu"
msgid "Font size"
msgstr "Rozmiar tekstu"
-#: forms.py:5
7
+#: forms.py:5
8
msgid "Default"
msgstr "Domyślnie"
msgid "Default"
msgstr "Domyślnie"
-#: forms.py:5
8
+#: forms.py:5
9
msgid "Big"
msgstr "Duży"
msgid "Big"
msgstr "Duży"
-#: forms.py:8
1
+#: forms.py:8
2
msgid "Queue is full. Please try again later."
msgstr ""
msgid "Queue is full. Please try again later."
msgstr ""
-#: models.py:33
-msgid "author"
-msgstr "autor"
-
-#: models.py:34
-msgid "epoch"
-msgstr "epoka"
+#: views.py:500
+#, python-format
+msgid ""
+"An error occurred: %(exception)s\n"
+"\n"
+"%(tb)s"
+msgstr ""
+"Wystąpił błąd: %(exception)s\n"
+"\n"
+"%(tb)s"
-#:
models.py:35
-msgid "
kind
"
-msgstr "
rodzaj
"
+#:
views.py:501
+msgid "
Book imported successfully
"
+msgstr "
Książka zaimportowana
"
-#: models.py:36
-msgid "genre"
-msgstr "gatunek"
+#: views.py:503
+#, python-format
+msgid "Error importing file: %r"
+msgstr "Błąd podczas importowania pliku: %r"
-#:
models.py:37
-msgid "
theme
"
-msgstr "
motyw
"
+#:
views.py:535
+msgid "
Download custom PDF
"
+msgstr "
Stwórz własny PDF
"
-#: models.py:38
-msgid "set"
-msgstr "półka"
+#: views.py:536
+#: templates/catalogue/book_short.html:92
+#: templates/catalogue/book_text.html:28
+#: templates/catalogue/book_wide.html:63
+msgid "Download"
+msgstr "Pobierz"
-#: models.py:39 models.py:368
-msgid "book"
-msgstr "książka"
+#: models/book.py:28
+#: models/collection.py:11
+msgid "title"
+msgstr "tytuł"
-#: models.py:60 models.py:230
-msgid "name"
-msgstr "nazwa"
+#: models/book.py:29
+#: models/tag.py:31
+msgid "sort key"
+msgstr "klucz sortowania"
-#: models.py:61 models.py:333 models.py:335 models.py:973 models.py:976
+#: models/book.py:30
+#: models/book.py:32
+#: models/collection.py:12
+#: models/collection.py:15
+#: models/tag.py:30
msgid "slug"
msgstr "slug"
msgid "slug"
msgstr "slug"
-#: models.py:62 models.py:332
-msgid "sort key"
-msgstr "klucz sortowania"
-
-#: models.py:63
-msgid "category"
-msgstr "kategoria"
+#: models/book.py:33
+msgid "language code"
+msgstr "Kod języka"
-#: models.py:65 models.py:106 models.py:338 models.py:441 models.py:974
+#: models/book.py:35
+#: models/book.py:140
+#: models/collection.py:13
+#: models/tag.py:34
+#: models/tag.py:76
msgid "description"
msgstr "opis"
msgid "description"
msgstr "opis"
-#: models
.py:68
-msgid "book count"
-msgstr "liczba książek"
-
-#: models
.py:72 models.py:73 models.py:232 models.py:339 models.py:340
+#: models
/book.py:36
+#: models/book.py:37
+#: models/bookmedia.py:28
+#: models/tag.py:41
+#: models
/tag.py:42
msgid "creation date"
msgstr "data utworzenia"
msgid "creation date"
msgstr "data utworzenia"
-#: models.py:90
-msgid "tag"
-msgstr "tag"
-
-#: models.py:91
-msgid "tags"
-msgstr "tagi"
-
-#: models.py:226 models.py:915
-#, python-format
-msgid "%s file"
-msgstr "plik %s"
-
-#: models.py:229
-msgid "type"
-msgstr "typ"
-
-#: models.py:231
-msgid "file"
-msgstr "plik"
+#: models/book.py:38
+msgid "parent number"
+msgstr "numer rodzica"
-#: models.py:233 models.py:342
+#: models/book.py:39
+#: models/bookmedia.py:29
msgid "extra information"
msgstr "dodatkowe informacje"
msgid "extra information"
msgstr "dodatkowe informacje"
-#: models.py:242 models.py:243
-msgid "book media"
-msgstr "media książki"
-
-#: models.py:331 models.py:972
-msgid "title"
-msgstr "tytuł"
-
-#: models.py:336
-msgid "language code"
-msgstr "Kod języka"
-
-#: models.py:341
-msgid "parent number"
-msgstr "numer rodzica"
-
-#: models.py:347
+#: models/book.py:44
msgid "cover"
msgstr "okładka"
msgid "cover"
msgstr "okładka"
-#: models.py:369
+#: models/book.py:66
+#: models/tag.py:20
+msgid "book"
+msgstr "książka"
+
+#: models/book.py:67
msgid "books"
msgstr "książki"
msgid "books"
msgstr "książki"
-#: models
.py:620
+#: models
/book.py:238
#, python-format
msgid "Book \"%s\" does not exist."
msgstr "Utwór \"%s\" nie istnieje."
#, python-format
msgid "Book \"%s\" does not exist."
msgstr "Utwór \"%s\" nie istnieje."
-#: models
.py:634
+#: models
/book.py:252
#, python-format
msgid "Book %s already exists"
msgstr "Książka %s już istnieje"
#, python-format
msgid "Book %s already exists"
msgstr "Książka %s już istnieje"
-#: models.py:935
-msgid "fragment"
-msgstr "fragment"
+#: models/book.py:585
+#: models/bookmedia.py:22
+#, python-format
+msgid "%s file"
+msgstr "plik %s"
-#: models
.py:936
-msgid "
fragments
"
-msgstr "
fragmenty
"
+#: models
/bookmedia.py:25
+msgid "
type
"
+msgstr "
typ
"
-#: models.py:977
+#: models/bookmedia.py:26
+#: models/tag.py:29
+msgid "name"
+msgstr "nazwa"
+
+#: models/bookmedia.py:27
+msgid "file"
+msgstr "plik"
+
+#: models/bookmedia.py:38
+#: models/bookmedia.py:39
+msgid "book media"
+msgstr "media książki"
+
+#: models/collection.py:16
msgid "book slugs"
msgstr "slugi utworów"
msgid "book slugs"
msgstr "slugi utworów"
-#: models
.py:981
+#: models
/collection.py:20
msgid "collection"
msgstr "kolekcja"
msgid "collection"
msgstr "kolekcja"
-#: models
.py:982
+#: models
/collection.py:21
msgid "collections"
msgstr "kolekcje"
msgid "collections"
msgstr "kolekcje"
-#: views.py:500
-#, python-format
-msgid ""
-"An error occurred: %(exception)s\n"
-"\n"
-"%(tb)s"
-msgstr ""
-"Wystąpił błąd: %(exception)s\n"
-"\n"
-"%(tb)s"
+#: models/fragment.py:32
+msgid "fragment"
+msgstr "fragment"
-#:
views.py:501
-msgid "
Book imported successfully
"
-msgstr "
Książka zaimportowana
"
+#:
models/fragment.py:33
+msgid "
fragments
"
+msgstr "
fragmenty
"
-#: views.py:503
-#, python-format
-msgid "Error importing file: %r"
-msgstr "Błąd podczas importowania pliku: %r"
+#: models/tag.py:14
+msgid "author"
+msgstr "autor"
-#:
views.py:53
5
-msgid "
Download custom PDF
"
-msgstr "
Stwórz własny PDF
"
+#:
models/tag.py:1
5
+msgid "
epoch
"
+msgstr "
epoka
"
-#: views.py:536 templates/catalogue/book_short.html:92
-#: templates/catalogue/book_text.html:28 templates/catalogue/book_wide.html:63
-msgid "Download"
-msgstr "Pobierz"
+#: models/tag.py:16
+msgid "kind"
+msgstr "rodzaj"
+
+#: models/tag.py:17
+msgid "genre"
+msgstr "gatunek"
+
+#: models/tag.py:18
+msgid "theme"
+msgstr "motyw"
+
+#: models/tag.py:19
+msgid "set"
+msgstr "półka"
+
+#: models/tag.py:32
+msgid "category"
+msgstr "kategoria"
+
+#: models/tag.py:37
+msgid "book count"
+msgstr "liczba książek"
+
+#: models/tag.py:59
+msgid "tag"
+msgstr "tag"
+
+#: models/tag.py:60
+msgid "tags"
+msgstr "tagi"
#: templates/catalogue/audiobook_list.html:7
#: templates/catalogue/audiobook_list.html:16
#: templates/catalogue/audiobook_list.html:7
#: templates/catalogue/audiobook_list.html:16
@@
-281,8
+306,7
@@
msgid ""
" distributed. If there are any additional copyrighted materials\n"
" provided with this work (such as annotations, motifs etc.), those\n"
" materials are licensed under the \n"
" distributed. If there are any additional copyrighted materials\n"
" provided with this work (such as annotations, motifs etc.), those\n"
" materials are licensed under the \n"
-" <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\">Creative "
-"Commons Attribution-ShareAlike 3.0</a>\n"
+" <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\">Creative Commons Attribution-ShareAlike 3.0</a>\n"
" license."
msgstr ""
" license."
msgstr ""
@@
-298,7
+322,8
@@
msgstr ""
msgid "Cover image by:"
msgstr ""
msgid "Cover image by:"
msgstr ""
-#: templates/catalogue/book_list.html:7 templates/catalogue/book_list.html:10
+#: templates/catalogue/book_list.html:7
+#: templates/catalogue/book_list.html:10
msgid "Listing of all works"
msgstr ""
msgid "Listing of all works"
msgstr ""
@@
-315,7
+340,8
@@
msgstr ""
msgid "Put a book on the shelf!"
msgstr "Książki nie ma na półce"
msgid "Put a book on the shelf!"
msgstr "Książki nie ma na półce"
-#: templates/catalogue/book_sets.html:3 templates/catalogue/book_sets.html:6
+#: templates/catalogue/book_sets.html:3
+#: templates/catalogue/book_sets.html:6
#: templates/catalogue/fragment_sets.html:16
#, fuzzy
msgid "Create new shelf"
#: templates/catalogue/fragment_sets.html:16
#, fuzzy
msgid "Create new shelf"
@@
-365,11
+391,12
@@
msgid "for Kindle"
msgstr ""
#: templates/catalogue/book_short.html:104
msgstr ""
#: templates/catalogue/book_short.html:104
+#: templates/catalogue/book_text.html:50
msgid "FictionBook"
msgstr ""
#: templates/catalogue/book_short.html:107
msgid "FictionBook"
msgstr ""
#: templates/catalogue/book_short.html:107
-#: templates/catalogue/book_text.html:5
0
+#: templates/catalogue/book_text.html:5
3
msgid "for advanced usage"
msgstr ""
msgid "for advanced usage"
msgstr ""
@@
-378,7
+405,8
@@
msgstr ""
msgid "Listen"
msgstr ""
msgid "Listen"
msgstr ""
-#: templates/catalogue/book_text.html:10 templates/catalogue/player.html:11
+#: templates/catalogue/book_text.html:10
+#: templates/catalogue/player.html:11
msgid "Wolne Lektury"
msgstr ""
msgid "Wolne Lektury"
msgstr ""
@@
-386,7
+414,8
@@
msgstr ""
msgid "Table of contents"
msgstr ""
msgid "Table of contents"
msgstr ""
-#: templates/catalogue/book_text.html:24 templates/catalogue/menu.html:27
+#: templates/catalogue/book_text.html:24
+#: templates/catalogue/menu.html:27
#, fuzzy
msgid "Themes"
msgstr "motyw"
#, fuzzy
msgid "Themes"
msgstr "motyw"
@@
-399,7
+428,8
@@
msgstr ""
msgid "Infobox"
msgstr ""
msgid "Infobox"
msgstr ""
-#: templates/catalogue/book_text.html:27 templates/catalogue/player.html:34
+#: templates/catalogue/book_text.html:27
+#: templates/catalogue/player.html:34
msgid "Book's page"
msgstr ""
msgid "Book's page"
msgstr ""
@@
-407,7
+437,8
@@
msgstr ""
msgid "for a reader"
msgstr ""
msgid "for a reader"
msgstr ""
-#: templates/catalogue/book_text.html:54 templates/catalogue/book_wide.html:67
+#: templates/catalogue/book_text.html:57
+#: templates/catalogue/book_wide.html:67
msgid "Download all audiobooks for this book"
msgstr ""
msgid "Download all audiobooks for this book"
msgstr ""
@@
-456,7
+487,8
@@
msgstr ""
msgid "Mix this book"
msgstr ""
msgid "Mix this book"
msgstr ""
-#: templates/catalogue/catalogue.html:6 templates/catalogue/catalogue.html:11
+#: templates/catalogue/catalogue.html:6
+#: templates/catalogue/catalogue.html:11
msgid "Catalogue"
msgstr ""
msgid "Catalogue"
msgstr ""
@@
-464,27
+496,31
@@
msgstr ""
msgid "Download the catalogue in PDF format."
msgstr ""
msgid "Download the catalogue in PDF format."
msgstr ""
-#: templates/catalogue/catalogue.html:19 templates/catalogue/menu.html:7
+#: templates/catalogue/catalogue.html:19
+#: templates/catalogue/menu.html:7
#: templates/catalogue/search_multiple_hits.html:17
#: templates/catalogue/tagged_object_list.html:26
#, fuzzy
msgid "Authors"
msgstr "autor"
#: templates/catalogue/search_multiple_hits.html:17
#: templates/catalogue/tagged_object_list.html:26
#, fuzzy
msgid "Authors"
msgstr "autor"
-#: templates/catalogue/catalogue.html:22 templates/catalogue/menu.html:17
+#: templates/catalogue/catalogue.html:22
+#: templates/catalogue/menu.html:17
#: templates/catalogue/search_multiple_hits.html:25
#: templates/catalogue/tagged_object_list.html:34
msgid "Kinds"
msgstr ""
#: templates/catalogue/search_multiple_hits.html:25
#: templates/catalogue/tagged_object_list.html:34
msgid "Kinds"
msgstr ""
-#: templates/catalogue/catalogue.html:25 templates/catalogue/menu.html:12
+#: templates/catalogue/catalogue.html:25
+#: templates/catalogue/menu.html:12
#: templates/catalogue/search_multiple_hits.html:33
#: templates/catalogue/tagged_object_list.html:42
#, fuzzy
msgid "Genres"
msgstr "gatunek"
#: templates/catalogue/search_multiple_hits.html:33
#: templates/catalogue/tagged_object_list.html:42
#, fuzzy
msgid "Genres"
msgstr "gatunek"
-#: templates/catalogue/catalogue.html:28 templates/catalogue/menu.html:22
+#: templates/catalogue/catalogue.html:28
+#: templates/catalogue/menu.html:22
#: templates/catalogue/search_multiple_hits.html:41
#: templates/catalogue/tagged_object_list.html:50
#, fuzzy
#: templates/catalogue/search_multiple_hits.html:41
#: templates/catalogue/tagged_object_list.html:50
#, fuzzy
@@
-508,8
+544,7
@@
msgstr ""
msgid ""
"System DAISY to uznany na całym świecie format udostępniania książek\n"
"dostosowany do potrzeb osób słabowidzących, niewidomych oraz innych osób\n"
msgid ""
"System DAISY to uznany na całym świecie format udostępniania książek\n"
"dostosowany do potrzeb osób słabowidzących, niewidomych oraz innych osób\n"
-"mających trudności z czytaniem. Możecie z nich korzystać bezpłatnie i bez "
-"ograniczeń."
+"mających trudności z czytaniem. Możecie z nich korzystać bezpłatnie i bez ograniczeń."
msgstr ""
#: templates/catalogue/differentiate_tags.html:12
msgstr ""
#: templates/catalogue/differentiate_tags.html:12
@@
-627,8
+662,7
@@
msgstr ""
#: templates/catalogue/player.html:125
#, python-format
#: templates/catalogue/player.html:125
#, python-format
-msgid ""
-"Audiobooks were prepared as a part of the %(cs)s project funded by %(fb)s."
+msgid "Audiobooks were prepared as a part of the %(cs)s project funded by %(fb)s."
msgstr ""
#: templates/catalogue/player.html:127
msgstr ""
#: templates/catalogue/player.html:127
@@
-672,8
+706,7
@@
msgstr ""
#: templates/catalogue/search_no_hits.html:21
msgid ""
#: templates/catalogue/search_no_hits.html:21
msgid ""
-"Search engine supports following criteria: title, author, theme/topic, "
-"epoch, kind and genre.\n"
+"Search engine supports following criteria: title, author, theme/topic, epoch, kind and genre.\n"
"\t\tAs for now we do not support full text search."
msgstr ""
"\t\tAs for now we do not support full text search."
msgstr ""
diff --git
a/apps/catalogue/tasks.py
b/apps/catalogue/tasks.py
index
af00c35
..
03f4a39
100644
(file)
--- a/
apps/catalogue/tasks.py
+++ b/
apps/catalogue/tasks.py
@@
-43,7
+43,14
@@
def build_custom_pdf(book_id, customizations, file_name):
print "will gen %s" % DefaultStorage().path(file_name)
if not DefaultStorage().exists(file_name):
print "will gen %s" % DefaultStorage().path(file_name)
if not DefaultStorage().exists(file_name):
+ kwargs = {
+ 'cover': True,
+ }
+ if 'no-cover' in customizations:
+ kwargs['cover'] = False
+ customizations.remove('no-cover')
pdf = Book.objects.get(pk=book_id).wldocument().as_pdf(
customizations=customizations,
pdf = Book.objects.get(pk=book_id).wldocument().as_pdf(
customizations=customizations,
- morefloats=settings.LIBRARIAN_PDF_MOREFLOATS)
+ morefloats=settings.LIBRARIAN_PDF_MOREFLOATS,
+ **kwargs)
DefaultStorage().save(file_name, File(open(pdf.get_filename())))
DefaultStorage().save(file_name, File(open(pdf.get_filename())))