fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
30eacc6
)
Always use absolute base url for ebooks with images.
author
Radek Czajka
<rczajka@rczajka.pl>
Mon, 29 Mar 2021 10:16:08 +0000
(12:16 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Mon, 29 Mar 2021 10:22:24 +0000
(12:22 +0200)
12 files changed:
src/catalogue/fields.py
patch
|
blob
|
history
src/catalogue/locale/de/LC_MESSAGES/django.po
patch
|
blob
|
history
src/catalogue/locale/en/LC_MESSAGES/django.po
patch
|
blob
|
history
src/catalogue/locale/es/LC_MESSAGES/django.po
patch
|
blob
|
history
src/catalogue/locale/fr/LC_MESSAGES/django.po
patch
|
blob
|
history
src/catalogue/locale/it/LC_MESSAGES/django.po
patch
|
blob
|
history
src/catalogue/locale/lt/LC_MESSAGES/django.po
patch
|
blob
|
history
src/catalogue/locale/pl/LC_MESSAGES/django.po
patch
|
blob
|
history
src/catalogue/locale/ru/LC_MESSAGES/django.po
patch
|
blob
|
history
src/catalogue/locale/uk/LC_MESSAGES/django.po
patch
|
blob
|
history
src/catalogue/tasks.py
patch
|
blob
|
history
src/catalogue/utils.py
patch
|
blob
|
history
diff --git
a/src/catalogue/fields.py
b/src/catalogue/fields.py
index
79fe67e
..
4c832fd
100644
(file)
--- a/
src/catalogue/fields.py
+++ b/
src/catalogue/fields.py
@@
-8,7
+8,7
@@
from django.db import models
from django.db.models.fields.files import FieldFile
from catalogue import app_settings
from catalogue.constants import LANGUAGES_3TO2, EBOOK_FORMATS_WITH_CHILDREN, EBOOK_FORMATS_WITHOUT_CHILDREN
from django.db.models.fields.files import FieldFile
from catalogue import app_settings
from catalogue.constants import LANGUAGES_3TO2, EBOOK_FORMATS_WITH_CHILDREN, EBOOK_FORMATS_WITHOUT_CHILDREN
-from catalogue.utils import remove_zip, truncate_html_words, gallery_path, gallery_url
+from catalogue.utils import
absolute_url,
remove_zip, truncate_html_words, gallery_path, gallery_url
from celery.task import Task, task
from celery.utils.log import get_task_logger
from waiter.utils import clear_cache
from celery.task import Task, task
from celery.utils.log import get_task_logger
from waiter.utils import clear_cache
@@
-191,7
+191,7
@@
class BuildPdf(BuildEbook):
def transform(wldoc, fieldfile):
return wldoc.as_pdf(
morefloats=settings.LIBRARIAN_PDF_MOREFLOATS, cover=True,
def transform(wldoc, fieldfile):
return wldoc.as_pdf(
morefloats=settings.LIBRARIAN_PDF_MOREFLOATS, cover=True,
- base_url=
gallery_url(wldoc.book_info.url.slug
), customizations=['notoc'])
+ base_url=
absolute_url(gallery_url(wldoc.book_info.url.slug)
), customizations=['notoc'])
def build(self, fieldfile):
BuildEbook.build(self, fieldfile)
def build(self, fieldfile):
BuildEbook.build(self, fieldfile)
@@
-203,7
+203,7
@@
class BuildPdf(BuildEbook):
class BuildEpub(BuildEbook):
@staticmethod
def transform(wldoc, fieldfile):
class BuildEpub(BuildEbook):
@staticmethod
def transform(wldoc, fieldfile):
- return wldoc.as_epub(cover=True, base_url=
gallery_url(wldoc.book_info.url.slug
))
+ return wldoc.as_epub(cover=True, base_url=
absolute_url(gallery_url(wldoc.book_info.url.slug)
))
@BuildEbook.register('mobi')
@BuildEbook.register('mobi')
@@
-211,7
+211,7
@@
class BuildEpub(BuildEbook):
class BuildMobi(BuildEbook):
@staticmethod
def transform(wldoc, fieldfile):
class BuildMobi(BuildEbook):
@staticmethod
def transform(wldoc, fieldfile):
- return wldoc.as_mobi(cover=True, base_url=
gallery_url(wldoc.book_info.url.slug
))
+ return wldoc.as_mobi(cover=True, base_url=
absolute_url(gallery_url(wldoc.book_info.url.slug)
))
@BuildEbook.register('html')
@BuildEbook.register('html')
@@
-317,7
+317,7
@@
class BuildHtml(BuildEbook):
slug = url_elem.text.rstrip('/').rsplit('/', 1)[1]
gal_url = gallery_url(slug=slug)
gal_path = gallery_path(slug=slug)
slug = url_elem.text.rstrip('/').rsplit('/', 1)[1]
gal_url = gallery_url(slug=slug)
gal_path = gallery_path(slug=slug)
- return wldoc.as_html(gallery_path=gal_path, gallery_url=gal_url, base_url=
gal_url
)
+ return wldoc.as_html(gallery_path=gal_path, gallery_url=gal_url, base_url=
absolute_url(gal_url)
)
class BuildCover(BuildEbook):
class BuildCover(BuildEbook):
diff --git
a/src/catalogue/locale/de/LC_MESSAGES/django.po
b/src/catalogue/locale/de/LC_MESSAGES/django.po
index
c3b876f
..
b6944d6
100644
(file)
--- a/
src/catalogue/locale/de/LC_MESSAGES/django.po
+++ b/
src/catalogue/locale/de/LC_MESSAGES/django.po
@@
-214,7
+214,7
@@
msgstr "Erstellungsdatum"
msgid "parent number"
msgstr "Elternnummer"
msgid "parent number"
msgstr "Elternnummer"
-#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
1
+#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
3
msgid "extra information"
msgstr "zusätzliche Informationen"
msgid "extra information"
msgstr "zusätzliche Informationen"
@@
-313,7
+313,7
@@
msgstr ""
msgid "file"
msgstr "XML-Datei"
msgid "file"
msgstr "XML-Datei"
-#: catalogue/models/bookmedia.py:5
0 catalogue/models/bookmedia.py:51
+#: catalogue/models/bookmedia.py:5
2 catalogue/models/bookmedia.py:53
msgid "book media"
msgstr "book media"
msgid "book media"
msgstr "book media"
@@
-576,7
+576,7
@@
msgstr "Sprachenkode"
msgid "Read online"
msgstr "Online lesen"
msgid "Read online"
msgstr "Online lesen"
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
@@
-584,24
+584,24
@@
msgid ""
"bezpłatnie."
msgstr ""
"bezpłatnie."
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid "Print on demand –"
msgstr ""
msgid "Print on demand –"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:12
8
+#: catalogue/templates/catalogue/book_short.html:12
0
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Herunterladen"
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Herunterladen"
-#: catalogue/templates/catalogue/book_short.html:1
42
+#: catalogue/templates/catalogue/book_short.html:1
34
msgid "more"
msgstr ""
msgid "more"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
53
+#: catalogue/templates/catalogue/book_short.html:1
45
msgid "less"
msgstr ""
msgid "less"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
61
+#: catalogue/templates/catalogue/book_short.html:1
53
msgid "For now this work is only available for our subscribers."
msgstr ""
msgid "For now this work is only available for our subscribers."
msgstr ""
@@
-888,15
+888,15
@@
msgstr "Künstler"
msgid "director:"
msgstr "Regisseur"
msgid "director:"
msgstr "Regisseur"
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
1
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
4
msgid "previous"
msgstr ""
msgid "previous"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
2
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
5
msgid "Part"
msgstr ""
msgid "Part"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
3
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
6
msgid "next"
msgstr ""
msgid "next"
msgstr ""
diff --git
a/src/catalogue/locale/en/LC_MESSAGES/django.po
b/src/catalogue/locale/en/LC_MESSAGES/django.po
index
ba81501
..
b72edd4
100644
(file)
--- a/
src/catalogue/locale/en/LC_MESSAGES/django.po
+++ b/
src/catalogue/locale/en/LC_MESSAGES/django.po
@@
-214,7
+214,7
@@
msgstr "creation date"
msgid "parent number"
msgstr "Parent number"
msgid "parent number"
msgstr "Parent number"
-#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
1
+#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
3
msgid "extra information"
msgstr "Additional information"
msgid "extra information"
msgstr "Additional information"
@@
-312,7
+312,7
@@
msgstr ""
msgid "file"
msgstr "XML file"
msgid "file"
msgstr "XML file"
-#: catalogue/models/bookmedia.py:5
0 catalogue/models/bookmedia.py:51
+#: catalogue/models/bookmedia.py:5
2 catalogue/models/bookmedia.py:53
msgid "book media"
msgstr "book media"
msgid "book media"
msgstr "book media"
@@
-578,7
+578,7
@@
msgstr "language code"
msgid "Read online"
msgstr "Read online"
msgid "Read online"
msgstr "Read online"
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
@@
-586,24
+586,24
@@
msgid ""
"bezpłatnie."
msgstr ""
"bezpłatnie."
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid "Print on demand –"
msgstr ""
msgid "Print on demand –"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:12
8
+#: catalogue/templates/catalogue/book_short.html:12
0
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Download"
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Download"
-#: catalogue/templates/catalogue/book_short.html:1
42
+#: catalogue/templates/catalogue/book_short.html:1
34
msgid "more"
msgstr ""
msgid "more"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
53
+#: catalogue/templates/catalogue/book_short.html:1
45
msgid "less"
msgstr ""
msgid "less"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
61
+#: catalogue/templates/catalogue/book_short.html:1
53
msgid "For now this work is only available for our subscribers."
msgstr ""
msgid "For now this work is only available for our subscribers."
msgstr ""
@@
-889,15
+889,15
@@
msgstr "Reader"
msgid "director:"
msgstr "Director"
msgid "director:"
msgstr "Director"
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
1
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
4
msgid "previous"
msgstr ""
msgid "previous"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
2
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
5
msgid "Part"
msgstr ""
msgid "Part"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
3
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
6
msgid "next"
msgstr ""
msgid "next"
msgstr ""
diff --git
a/src/catalogue/locale/es/LC_MESSAGES/django.po
b/src/catalogue/locale/es/LC_MESSAGES/django.po
index
4e80a3d
..
02cc16b
100644
(file)
--- a/
src/catalogue/locale/es/LC_MESSAGES/django.po
+++ b/
src/catalogue/locale/es/LC_MESSAGES/django.po
@@
-214,7
+214,7
@@
msgstr "fecha de creación"
msgid "parent number"
msgstr "cifra matriz"
msgid "parent number"
msgstr "cifra matriz"
-#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
1
+#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
3
msgid "extra information"
msgstr "información adicional"
msgid "extra information"
msgstr "información adicional"
@@
-312,7
+312,7
@@
msgstr ""
msgid "file"
msgstr "archivo"
msgid "file"
msgstr "archivo"
-#: catalogue/models/bookmedia.py:5
0 catalogue/models/bookmedia.py:51
+#: catalogue/models/bookmedia.py:5
2 catalogue/models/bookmedia.py:53
msgid "book media"
msgstr "los medios de el libro"
msgid "book media"
msgstr "los medios de el libro"
@@
-583,7
+583,7
@@
msgstr "código de idioma"
msgid "Read online"
msgstr "Leer en línea"
msgid "Read online"
msgstr "Leer en línea"
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
@@
-591,24
+591,24
@@
msgid ""
"bezpłatnie."
msgstr ""
"bezpłatnie."
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid "Print on demand –"
msgstr ""
msgid "Print on demand –"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:12
8
+#: catalogue/templates/catalogue/book_short.html:12
0
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Descargar"
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Descargar"
-#: catalogue/templates/catalogue/book_short.html:1
42
+#: catalogue/templates/catalogue/book_short.html:1
34
msgid "more"
msgstr ""
msgid "more"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
53
+#: catalogue/templates/catalogue/book_short.html:1
45
msgid "less"
msgstr ""
msgid "less"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
61
+#: catalogue/templates/catalogue/book_short.html:1
53
msgid "For now this work is only available for our subscribers."
msgstr ""
msgid "For now this work is only available for our subscribers."
msgstr ""
@@
-900,15
+900,15
@@
msgstr "Artista"
msgid "director:"
msgstr "Director"
msgid "director:"
msgstr "Director"
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
1
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
4
msgid "previous"
msgstr ""
msgid "previous"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
2
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
5
msgid "Part"
msgstr ""
msgid "Part"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
3
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
6
msgid "next"
msgstr ""
msgid "next"
msgstr ""
diff --git
a/src/catalogue/locale/fr/LC_MESSAGES/django.po
b/src/catalogue/locale/fr/LC_MESSAGES/django.po
index
7775202
..
e1cdb40
100644
(file)
--- a/
src/catalogue/locale/fr/LC_MESSAGES/django.po
+++ b/
src/catalogue/locale/fr/LC_MESSAGES/django.po
@@
-213,7
+213,7
@@
msgstr "date de création"
msgid "parent number"
msgstr "nombre de parent"
msgid "parent number"
msgstr "nombre de parent"
-#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
1
+#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
3
msgid "extra information"
msgstr "information supplémentaire"
msgid "extra information"
msgstr "information supplémentaire"
@@
-311,7
+311,7
@@
msgstr ""
msgid "file"
msgstr "fichier"
msgid "file"
msgstr "fichier"
-#: catalogue/models/bookmedia.py:5
0 catalogue/models/bookmedia.py:51
+#: catalogue/models/bookmedia.py:5
2 catalogue/models/bookmedia.py:53
msgid "book media"
msgstr "book media"
msgid "book media"
msgstr "book media"
@@
-577,7
+577,7
@@
msgstr "code de langue"
msgid "Read online"
msgstr "Lire en ligne"
msgid "Read online"
msgstr "Lire en ligne"
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
@@
-585,24
+585,24
@@
msgid ""
"bezpłatnie."
msgstr ""
"bezpłatnie."
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid "Print on demand –"
msgstr ""
msgid "Print on demand –"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:12
8
+#: catalogue/templates/catalogue/book_short.html:12
0
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Téléchargez"
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Téléchargez"
-#: catalogue/templates/catalogue/book_short.html:1
42
+#: catalogue/templates/catalogue/book_short.html:1
34
msgid "more"
msgstr ""
msgid "more"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
53
+#: catalogue/templates/catalogue/book_short.html:1
45
msgid "less"
msgstr ""
msgid "less"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
61
+#: catalogue/templates/catalogue/book_short.html:1
53
msgid "For now this work is only available for our subscribers."
msgstr ""
msgid "For now this work is only available for our subscribers."
msgstr ""
@@
-893,15
+893,15
@@
msgstr "Artiste"
msgid "director:"
msgstr "Metteur en scène"
msgid "director:"
msgstr "Metteur en scène"
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
1
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
4
msgid "previous"
msgstr ""
msgid "previous"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
2
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
5
msgid "Part"
msgstr ""
msgid "Part"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
3
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
6
msgid "next"
msgstr ""
msgid "next"
msgstr ""
diff --git
a/src/catalogue/locale/it/LC_MESSAGES/django.po
b/src/catalogue/locale/it/LC_MESSAGES/django.po
index
2de5473
..
e91c157
100644
(file)
--- a/
src/catalogue/locale/it/LC_MESSAGES/django.po
+++ b/
src/catalogue/locale/it/LC_MESSAGES/django.po
@@
-214,7
+214,7
@@
msgstr "data di creazione"
msgid "parent number"
msgstr "numero del genitore"
msgid "parent number"
msgstr "numero del genitore"
-#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
1
+#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
3
msgid "extra information"
msgstr " ulteriori informazioni"
msgid "extra information"
msgstr " ulteriori informazioni"
@@
-312,7
+312,7
@@
msgstr ""
msgid "file"
msgstr "file"
msgid "file"
msgstr "file"
-#: catalogue/models/bookmedia.py:5
0 catalogue/models/bookmedia.py:51
+#: catalogue/models/bookmedia.py:5
2 catalogue/models/bookmedia.py:53
msgid "book media"
msgstr "book media"
msgid "book media"
msgstr "book media"
@@
-580,7
+580,7
@@
msgstr "codice della lingua"
msgid "Read online"
msgstr "Leggi online"
msgid "Read online"
msgstr "Leggi online"
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
@@
-588,24
+588,24
@@
msgid ""
"bezpłatnie."
msgstr ""
"bezpłatnie."
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid "Print on demand –"
msgstr ""
msgid "Print on demand –"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:12
8
+#: catalogue/templates/catalogue/book_short.html:12
0
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Scarica"
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Scarica"
-#: catalogue/templates/catalogue/book_short.html:1
42
+#: catalogue/templates/catalogue/book_short.html:1
34
msgid "more"
msgstr ""
msgid "more"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
53
+#: catalogue/templates/catalogue/book_short.html:1
45
msgid "less"
msgstr ""
msgid "less"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
61
+#: catalogue/templates/catalogue/book_short.html:1
53
msgid "For now this work is only available for our subscribers."
msgstr ""
msgid "For now this work is only available for our subscribers."
msgstr ""
@@
-896,15
+896,15
@@
msgstr "Artista"
msgid "director:"
msgstr "Direttore"
msgid "director:"
msgstr "Direttore"
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
1
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
4
msgid "previous"
msgstr ""
msgid "previous"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
2
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
5
msgid "Part"
msgstr ""
msgid "Part"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
3
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
6
msgid "next"
msgstr ""
msgid "next"
msgstr ""
diff --git
a/src/catalogue/locale/lt/LC_MESSAGES/django.po
b/src/catalogue/locale/lt/LC_MESSAGES/django.po
index
37e5f49
..
6174656
100644
(file)
--- a/
src/catalogue/locale/lt/LC_MESSAGES/django.po
+++ b/
src/catalogue/locale/lt/LC_MESSAGES/django.po
@@
-215,7
+215,7
@@
msgstr "sukūrimo data"
msgid "parent number"
msgstr "pirminis numeris"
msgid "parent number"
msgstr "pirminis numeris"
-#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
1
+#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
3
msgid "extra information"
msgstr "papildomos informacijos"
msgid "extra information"
msgstr "papildomos informacijos"
@@
-313,7
+313,7
@@
msgstr ""
msgid "file"
msgstr "failas "
msgid "file"
msgstr "failas "
-#: catalogue/models/bookmedia.py:5
0 catalogue/models/bookmedia.py:51
+#: catalogue/models/bookmedia.py:5
2 catalogue/models/bookmedia.py:53
msgid "book media"
msgstr "book media"
msgid "book media"
msgstr "book media"
@@
-580,7
+580,7
@@
msgstr "kalbos kodas"
msgid "Read online"
msgstr "Skaityti online"
msgid "Read online"
msgstr "Skaityti online"
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
@@
-588,24
+588,24
@@
msgid ""
"bezpłatnie."
msgstr ""
"bezpłatnie."
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid "Print on demand –"
msgstr ""
msgid "Print on demand –"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:12
8
+#: catalogue/templates/catalogue/book_short.html:12
0
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Atsisiųsti"
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Atsisiųsti"
-#: catalogue/templates/catalogue/book_short.html:1
42
+#: catalogue/templates/catalogue/book_short.html:1
34
msgid "more"
msgstr ""
msgid "more"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
53
+#: catalogue/templates/catalogue/book_short.html:1
45
msgid "less"
msgstr ""
msgid "less"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
61
+#: catalogue/templates/catalogue/book_short.html:1
53
msgid "For now this work is only available for our subscribers."
msgstr ""
msgid "For now this work is only available for our subscribers."
msgstr ""
@@
-894,15
+894,15
@@
msgstr "Artistas"
msgid "director:"
msgstr "Režisierus"
msgid "director:"
msgstr "Režisierus"
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
1
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
4
msgid "previous"
msgstr ""
msgid "previous"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
2
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
5
msgid "Part"
msgstr ""
msgid "Part"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
3
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
6
msgid "next"
msgstr ""
msgid "next"
msgstr ""
diff --git
a/src/catalogue/locale/pl/LC_MESSAGES/django.po
b/src/catalogue/locale/pl/LC_MESSAGES/django.po
index
29a62a9
..
3dc9832
100644
(file)
--- a/
src/catalogue/locale/pl/LC_MESSAGES/django.po
+++ b/
src/catalogue/locale/pl/LC_MESSAGES/django.po
@@
-187,7
+187,7
@@
msgstr "data modyfikacji"
msgid "parent number"
msgstr "numer rodzica"
msgid "parent number"
msgstr "numer rodzica"
-#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
1
+#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
3
msgid "extra information"
msgstr "dodatkowe informacje"
msgid "extra information"
msgstr "dodatkowe informacje"
@@
-283,7
+283,7
@@
msgstr "indeks"
msgid "file"
msgstr "plik"
msgid "file"
msgstr "plik"
-#: catalogue/models/bookmedia.py:5
0 catalogue/models/bookmedia.py:51
+#: catalogue/models/bookmedia.py:5
2 catalogue/models/bookmedia.py:53
msgid "book media"
msgstr "media książki"
msgid "book media"
msgstr "media książki"
@@
-524,7
+524,7
@@
msgstr "Język"
msgid "Read online"
msgstr "Czytaj online"
msgid "Read online"
msgstr "Czytaj online"
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
@@
-532,24
+532,24
@@
msgid ""
"bezpłatnie."
msgstr ""
"bezpłatnie."
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid "Print on demand –"
msgstr "Druk na żądanie z"
msgid "Print on demand –"
msgstr "Druk na żądanie z"
-#: catalogue/templates/catalogue/book_short.html:12
8
+#: catalogue/templates/catalogue/book_short.html:12
0
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Pobierz"
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Pobierz"
-#: catalogue/templates/catalogue/book_short.html:1
42
+#: catalogue/templates/catalogue/book_short.html:1
34
msgid "more"
msgstr "więcej"
msgid "more"
msgstr "więcej"
-#: catalogue/templates/catalogue/book_short.html:1
53
+#: catalogue/templates/catalogue/book_short.html:1
45
msgid "less"
msgstr "mniej"
msgid "less"
msgstr "mniej"
-#: catalogue/templates/catalogue/book_short.html:1
61
+#: catalogue/templates/catalogue/book_short.html:1
53
msgid "For now this work is only available for our subscribers."
msgstr "Jak na razie ten utwór jest dostępny wyłącznie dla naszych Przyjaciół."
msgid "For now this work is only available for our subscribers."
msgstr "Jak na razie ten utwór jest dostępny wyłącznie dla naszych Przyjaciół."
@@
-817,15
+817,15
@@
msgstr "Czyta"
msgid "director:"
msgstr "reż."
msgid "director:"
msgstr "reż."
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
1
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
4
msgid "previous"
msgstr "poprzednia"
msgid "previous"
msgstr "poprzednia"
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
2
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
5
msgid "Part"
msgstr "Część"
msgid "Part"
msgstr "Część"
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
3
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
6
msgid "next"
msgstr "następna"
msgid "next"
msgstr "następna"
diff --git
a/src/catalogue/locale/ru/LC_MESSAGES/django.po
b/src/catalogue/locale/ru/LC_MESSAGES/django.po
index
704d498
..
d5c4db5
100644
(file)
--- a/
src/catalogue/locale/ru/LC_MESSAGES/django.po
+++ b/
src/catalogue/locale/ru/LC_MESSAGES/django.po
@@
-214,7
+214,7
@@
msgstr "дата создания"
msgid "parent number"
msgstr "номер родителя"
msgid "parent number"
msgstr "номер родителя"
-#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
1
+#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
3
msgid "extra information"
msgstr "дополнительная информация"
msgid "extra information"
msgstr "дополнительная информация"
@@
-313,7
+313,7
@@
msgstr ""
msgid "file"
msgstr "XML файл"
msgid "file"
msgstr "XML файл"
-#: catalogue/models/bookmedia.py:5
0 catalogue/models/bookmedia.py:51
+#: catalogue/models/bookmedia.py:5
2 catalogue/models/bookmedia.py:53
msgid "book media"
msgstr "аудиокнига"
msgid "book media"
msgstr "аудиокнига"
@@
-582,7
+582,7
@@
msgstr "код языка"
msgid "Read online"
msgstr "Читать онлайн"
msgid "Read online"
msgstr "Читать онлайн"
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
@@
-590,24
+590,24
@@
msgid ""
"bezpłatnie."
msgstr ""
"bezpłatnie."
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid "Print on demand –"
msgstr ""
msgid "Print on demand –"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:12
8
+#: catalogue/templates/catalogue/book_short.html:12
0
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Загрузить"
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Загрузить"
-#: catalogue/templates/catalogue/book_short.html:1
42
+#: catalogue/templates/catalogue/book_short.html:1
34
msgid "more"
msgstr ""
msgid "more"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
53
+#: catalogue/templates/catalogue/book_short.html:1
45
msgid "less"
msgstr ""
msgid "less"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
61
+#: catalogue/templates/catalogue/book_short.html:1
53
msgid "For now this work is only available for our subscribers."
msgstr ""
msgid "For now this work is only available for our subscribers."
msgstr ""
@@
-896,15
+896,15
@@
msgstr "Артист"
msgid "director:"
msgstr "режиссер"
msgid "director:"
msgstr "режиссер"
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
1
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
4
msgid "previous"
msgstr ""
msgid "previous"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
2
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
5
msgid "Part"
msgstr ""
msgid "Part"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
3
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
6
msgid "next"
msgstr ""
msgid "next"
msgstr ""
diff --git
a/src/catalogue/locale/uk/LC_MESSAGES/django.po
b/src/catalogue/locale/uk/LC_MESSAGES/django.po
index
629ca15
..
78214aa
100644
(file)
--- a/
src/catalogue/locale/uk/LC_MESSAGES/django.po
+++ b/
src/catalogue/locale/uk/LC_MESSAGES/django.po
@@
-213,7
+213,7
@@
msgstr "дата створення"
msgid "parent number"
msgstr "номер батька"
msgid "parent number"
msgstr "номер батька"
-#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
1
+#: catalogue/models/book.py:69 catalogue/models/bookmedia.py:4
3
msgid "extra information"
msgstr "додаткова інформація"
msgid "extra information"
msgstr "додаткова інформація"
@@
-311,7
+311,7
@@
msgstr ""
msgid "file"
msgstr "файл"
msgid "file"
msgstr "файл"
-#: catalogue/models/bookmedia.py:5
0 catalogue/models/bookmedia.py:51
+#: catalogue/models/bookmedia.py:5
2 catalogue/models/bookmedia.py:53
msgid "book media"
msgstr "book media"
msgid "book media"
msgstr "book media"
@@
-579,7
+579,7
@@
msgstr "мовний код"
msgid "Read online"
msgstr "Читати онлайн"
msgid "Read online"
msgstr "Читати онлайн"
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
msgid ""
"Cena książki w druku cyfrowym jest zależna od liczby stron.<br>Przed zakupem "
"upewnij się, że cena druku na żądanie jest dla Ciebie odpowiednia."
@@
-587,24
+587,24
@@
msgid ""
"bezpłatnie."
msgstr ""
"bezpłatnie."
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
23
+#: catalogue/templates/catalogue/book_short.html:1
15
msgid "Print on demand –"
msgstr ""
msgid "Print on demand –"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:12
8
+#: catalogue/templates/catalogue/book_short.html:12
0
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Завантажити"
#: catalogue/templates/catalogue/custom_pdf_form.html:18 catalogue/views.py:404
msgid "Download"
msgstr "Завантажити"
-#: catalogue/templates/catalogue/book_short.html:1
42
+#: catalogue/templates/catalogue/book_short.html:1
34
msgid "more"
msgstr ""
msgid "more"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
53
+#: catalogue/templates/catalogue/book_short.html:1
45
msgid "less"
msgstr ""
msgid "less"
msgstr ""
-#: catalogue/templates/catalogue/book_short.html:1
61
+#: catalogue/templates/catalogue/book_short.html:1
53
msgid "For now this work is only available for our subscribers."
msgstr ""
msgid "For now this work is only available for our subscribers."
msgstr ""
@@
-890,15
+890,15
@@
msgstr "Художник"
msgid "director:"
msgstr "Режисер"
msgid "director:"
msgstr "Режисер"
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
1
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
4
msgid "previous"
msgstr ""
msgid "previous"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
2
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
5
msgid "Part"
msgstr ""
msgid "Part"
msgstr ""
-#: catalogue/templates/catalogue/snippets/jplayer.html:6
3
+#: catalogue/templates/catalogue/snippets/jplayer.html:6
6
msgid "next"
msgstr ""
msgid "next"
msgstr ""
diff --git
a/src/catalogue/tasks.py
b/src/catalogue/tasks.py
index
0da624d
..
f2ee55f
100644
(file)
--- a/
src/catalogue/tasks.py
+++ b/
src/catalogue/tasks.py
@@
-7,7
+7,7
@@
from celery.utils.log import get_task_logger
from django.conf import settings
from django.utils import timezone
from django.conf import settings
from django.utils import timezone
-from catalogue.utils import gallery_url
+from catalogue.utils import
absolute_url,
gallery_url
from waiter.models import WaitedFile
task_logger = get_task_logger(__name__)
from waiter.models import WaitedFile
task_logger = get_task_logger(__name__)
@@
-53,7
+53,7
@@
def build_custom_pdf(book_id, customizations, file_name, waiter_id=None):
pdf = wldoc.as_pdf(
customizations=customizations,
morefloats=settings.LIBRARIAN_PDF_MOREFLOATS,
pdf = wldoc.as_pdf(
customizations=customizations,
morefloats=settings.LIBRARIAN_PDF_MOREFLOATS,
- base_url=
gallery_url(wldoc.book_info.url.slug
),
+ base_url=
absolute_url(gallery_url(wldoc.book_info.url.slug)
),
**kwargs)
DefaultStorage().save(file_name, File(open(pdf.get_filename(), 'rb')))
finally:
**kwargs)
DefaultStorage().save(file_name, File(open(pdf.get_filename(), 'rb')))
finally:
diff --git
a/src/catalogue/utils.py
b/src/catalogue/utils.py
index
ca8ec0d
..
916fd70
100644
(file)
--- a/
src/catalogue/utils.py
+++ b/
src/catalogue/utils.py
@@
-11,8
+11,10
@@
from collections import defaultdict
from errno import EEXIST, ENOENT
from fcntl import flock, LOCK_EX
from os import mkdir, path, unlink
from errno import EEXIST, ENOENT
from fcntl import flock, LOCK_EX
from os import mkdir, path, unlink
+from urllib.parse import urljoin
from zipfile import ZipFile
from zipfile import ZipFile
+from django.apps import apps
from django.conf import settings
from django.core.files.storage import DefaultStorage
from django.core.files.uploadedfile import UploadedFile
from django.conf import settings
from django.core.files.storage import DefaultStorage
from django.core.files.uploadedfile import UploadedFile
@@
-310,6
+312,16
@@
def gallery_url(slug):
return '%s%s%s/' % (settings.MEDIA_URL, settings.IMAGE_DIR, slug)
return '%s%s%s/' % (settings.MEDIA_URL, settings.IMAGE_DIR, slug)
+def absolute_url(url):
+ Site = apps.get_model('sites', 'Site')
+ site = Site.objects.get_current()
+ base_url = '%s://%s' % (
+ 'https' if settings.SESSION_COOKIE_SECURE else 'http',
+ site.domain
+ )
+ return urljoin(base_url, url)
+
+
def get_mp3_length(path):
from mutagen.mp3 import MP3
return int(MP3(path).info.length)
def get_mp3_length(path):
from mutagen.mp3 import MP3
return int(MP3(path).info.length)