From: Radek Czajka Date: Mon, 5 Feb 2024 08:20:44 +0000 (+0100) Subject: progress X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/c36c3891e56611e2ad4c518daa46b8cc3f28188e?ds=inline;hp=7226da0450b08dd90714bd8e78cfe4920848415b progress --- 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;