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:
9574b97
)
Responsive images.
author
Radek Czajka
<rczajka@rczajka.pl>
Wed, 27 Jan 2021 13:07:48 +0000
(14:07 +0100)
committer
Radek Czajka
<rczajka@rczajka.pl>
Wed, 27 Jan 2021 13:07:48 +0000
(14:07 +0100)
requirements/requirements.txt
patch
|
blob
|
history
src/catalogue/fields.py
patch
|
blob
|
history
src/catalogue/management/commands/importbooks.py
patch
|
blob
|
history
src/catalogue/templatetags/catalogue_tags.py
patch
|
blob
|
history
src/catalogue/utils.py
patch
|
blob
|
history
src/wolnelektury/static/css/new.book.css
patch
|
blob
|
history
src/wolnelektury/static/scss/book_text/const.scss
patch
|
blob
|
history
diff --git
a/requirements/requirements.txt
b/requirements/requirements.txt
index
225b205
..
bfa9a8c
100644
(file)
--- a/
requirements/requirements.txt
+++ b/
requirements/requirements.txt
@@
-45,7
+45,7
@@
mutagen>=1.31
sorl-thumbnail==12.5.0
# home-brewed & dependencies
sorl-thumbnail==12.5.0
# home-brewed & dependencies
-librarian==1.1
2
+librarian==1.1
3
# celery tasks
celery[redis]==4.4.7
# celery tasks
celery[redis]==4.4.7
diff --git
a/src/catalogue/fields.py
b/src/catalogue/fields.py
index
4d49d30
..
c3e2b35
100644
(file)
--- a/
src/catalogue/fields.py
+++ b/
src/catalogue/fields.py
@@
-311,10
+311,13
@@
class BuildHtml(BuildEbook):
from librarian import DCNS
url_elem = wldoc.edoc.getroot().find('.//' + DCNS('identifier.url'))
if url_elem is None:
from librarian import DCNS
url_elem = wldoc.edoc.getroot().find('.//' + DCNS('identifier.url'))
if url_elem is None:
- gallery = ''
+ gal_url = ''
+ gal_path = ''
else:
else:
- gallery = gallery_url(slug=url_elem.text.rstrip('/').rsplit('/', 1)[1])
- return wldoc.as_html(options={'gallery': "'%s'" % gallery})
+ 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)
class BuildCover(BuildEbook):
class BuildCover(BuildEbook):
diff --git
a/src/catalogue/management/commands/importbooks.py
b/src/catalogue/management/commands/importbooks.py
index
e5e7c89
..
e9b3364
100644
(file)
--- a/
src/catalogue/management/commands/importbooks.py
+++ b/
src/catalogue/management/commands/importbooks.py
@@
-52,6
+52,7
@@
class Command(BaseCommand):
dont_build=dont_build,
search_index_tags=False,
findable=options.get('findable'),
dont_build=dont_build,
search_index_tags=False,
findable=options.get('findable'),
+ remote_gallery_url='file://' + os.path.dirname(os.path.abspath(file_base)) + '/img/'
)
for ebook_format in Book.ebook_formats:
if os.path.isfile(file_base + '.' + ebook_format):
)
for ebook_format in Book.ebook_formats:
if os.path.isfile(file_base + '.' + ebook_format):
diff --git
a/src/catalogue/templatetags/catalogue_tags.py
b/src/catalogue/templatetags/catalogue_tags.py
index
25976db
..
b582f89
100644
(file)
--- a/
src/catalogue/templatetags/catalogue_tags.py
+++ b/
src/catalogue/templatetags/catalogue_tags.py
@@
-503,7
+503,7
@@
def content_warning(book):
warnings_def = {
'wulgaryzmy': _('vulgar language'),
}
warnings_def = {
'wulgaryzmy': _('vulgar language'),
}
- warnings = book.get_extra_info_json().get('content_warnings')
+ warnings = book.get_extra_info_json().get('content_warnings'
, []
)
warnings = sorted(
warnings_def.get(w, w)
for w in warnings
warnings = sorted(
warnings_def.get(w, w)
for w in warnings
diff --git
a/src/catalogue/utils.py
b/src/catalogue/utils.py
index
d056579
..
ca8ec0d
100644
(file)
--- a/
src/catalogue/utils.py
+++ b/
src/catalogue/utils.py
@@
-303,7
+303,7
@@
def delete_from_cache_by_language(cache, key_template):
def gallery_path(slug):
def gallery_path(slug):
- return os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR, slug)
+ return os.path.join(settings.MEDIA_ROOT, settings.IMAGE_DIR, slug)
+ '/'
def gallery_url(slug):
def gallery_url(slug):
diff --git
a/src/wolnelektury/static/css/new.book.css
b/src/wolnelektury/static/css/new.book.css
index
77f8197
..
e2d44b6
100644
(file)
--- a/
src/wolnelektury/static/css/new.book.css
+++ b/
src/wolnelektury/static/css/new.book.css
@@
-13,6
+13,7
@@
a {
img {
max-width: 37.5rem;
margin-top: 1em;
img {
max-width: 37.5rem;
margin-top: 1em;
+ width: 100%;
}
.animacja {
margin-top: 1em;
}
.animacja {
margin-top: 1em;
diff --git
a/src/wolnelektury/static/scss/book_text/const.scss
b/src/wolnelektury/static/scss/book_text/const.scss
index
154c699
..
871a8b5
100644
(file)
--- a/
src/wolnelektury/static/scss/book_text/const.scss
+++ b/
src/wolnelektury/static/scss/book_text/const.scss
@@
-16,7
+16,7
@@
$W_NOTHEMES_TINY: 20px;
$S_NOTHEMES_TINY_MAX: 240px;
$W_NOTHEMES_SMALL: 30px;
$S_NOTHEMES_SMALL_MAX: 320px;
$S_NOTHEMES_TINY_MAX: 240px;
$W_NOTHEMES_SMALL: 30px;
$S_NOTHEMES_SMALL_MAX: 320px;
-$W_NOTHEMES: 4
4
px;
+$W_NOTHEMES: 4
5
px;
$S_THEMES: 600px;
$S_THEMES_WOTHER: 1200px;
$W_THEMES: 160px;
$S_THEMES: 600px;
$S_THEMES_WOTHER: 1200px;
$W_THEMES: 160px;