fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7226da0
)
progress
author
Radek Czajka
<rczajka@rczajka.pl>
Mon, 5 Feb 2024 08:20:44 +0000
(09:20 +0100)
committer
Radek Czajka
<rczajka@rczajka.pl>
Mon, 5 Feb 2024 08:20:44 +0000
(09:20 +0100)
src/catalogue/models/book.py
patch
|
blob
|
history
src/catalogue/templates/catalogue/book_text.html
patch
|
blob
|
history
src/wolnelektury/settings/static.py
patch
|
blob
|
history
src/wolnelektury/static/2022/styles/layout/_text.scss
patch
|
blob
|
history
diff --git
a/src/catalogue/models/book.py
b/src/catalogue/models/book.py
index
b2d960b
..
10e9d22
100644
(file)
--- 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)
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_))
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
a494e24
..
421d439
100644
(file)
--- a/
src/catalogue/templates/catalogue/book_text.html
+++ b/
src/catalogue/templates/catalogue/book_text.html
@@
-133,14
+133,14
@@
{% block main %}
{% block main %}
- <div id="global-progress" class="l-container">
+ <div id="global-progress" class="l-container"
data-t="{{ book.get_time }}"
>
<div class="bar">
<span class="piece" style="flex-grow: 100;">
<span class="filled"></span>
</span>
</div>
<div class="progress-text">
<div class="bar">
<span class="piece" style="flex-grow: 100;">
<span class="filled"></span>
</span>
</div>
<div class="progress-text">
- Szacowany czas do końca: <span class="progress-text-value">
56 min
</span>
+ Szacowany czas do końca: <span class="progress-text-value">
-
</span>
</div>
</div>
</div>
</div>
diff --git
a/src/wolnelektury/settings/static.py
b/src/wolnelektury/settings/static.py
index
dfc84d1
..
b3edb72
100644
(file)
--- 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/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',
'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
20aa174
..
8959c62
100644
(file)
--- a/
src/wolnelektury/static/2022/styles/layout/_text.scss
+++ b/
src/wolnelektury/static/2022/styles/layout/_text.scss
@@
-1,5
+1,4
@@
#global-progress {
#global-progress {
- display: none;
position: sticky;
top: 0;
background: white;
position: sticky;
top: 0;
background: white;