From c36c3891e56611e2ad4c518daa46b8cc3f28188e Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 5 Feb 2024 09:20:44 +0100 Subject: [PATCH] progress --- src/catalogue/models/book.py | 3 +++ src/catalogue/templates/catalogue/book_text.html | 4 ++-- src/wolnelektury/settings/static.py | 1 + src/wolnelektury/static/2022/styles/layout/_text.scss | 1 - 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index b2d960b67..10e9d22e3 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -331,6 +331,9 @@ class Book(models.Model): total += app_settings.GET_MP3_LENGTH(media.file.path) return int(total) + def get_time(self): + return round(self.xml_file.size / 1000 * 40) + def has_media(self, type_): if type_ in Book.formats: return bool(getattr(self, "%s_file" % type_)) diff --git a/src/catalogue/templates/catalogue/book_text.html b/src/catalogue/templates/catalogue/book_text.html index a494e24b6..421d439fe 100644 --- a/src/catalogue/templates/catalogue/book_text.html +++ b/src/catalogue/templates/catalogue/book_text.html @@ -133,14 +133,14 @@ {% block main %} -
+
- Szacowany czas do końca: 56 min + Szacowany czas do końca: -
diff --git a/src/wolnelektury/settings/static.py b/src/wolnelektury/settings/static.py index dfc84d1c5..b3edb72cb 100644 --- a/src/wolnelektury/settings/static.py +++ b/src/wolnelektury/settings/static.py @@ -76,6 +76,7 @@ PIPELINE = { 'js/book_text/references.js', 'js/book_text/settings.js', 'js/book_text/toc.js', + 'js/book_text/progress.js', 'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js', 'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js', diff --git a/src/wolnelektury/static/2022/styles/layout/_text.scss b/src/wolnelektury/static/2022/styles/layout/_text.scss index 20aa174b1..8959c62f2 100644 --- a/src/wolnelektury/static/2022/styles/layout/_text.scss +++ b/src/wolnelektury/static/2022/styles/layout/_text.scss @@ -1,5 +1,4 @@ #global-progress { - display: none; position: sticky; top: 0; background: white; -- 2.20.1