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:
8ce0115
)
Fixes
author
Radek Czajka
<rczajka@rczajka.pl>
Fri, 22 Apr 2022 13:31:47 +0000
(15:31 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Fri, 22 Apr 2022 13:31:47 +0000
(15:31 +0200)
src/catalogue/models/book.py
patch
|
blob
|
history
src/catalogue/templates/catalogue/book_text.html
patch
|
blob
|
history
src/wolnelektury/static/2021/scripts/main.js
patch
|
blob
|
history
src/wolnelektury/static/2022/styles/components/_player.scss
patch
|
blob
|
history
diff --git
a/src/catalogue/models/book.py
b/src/catalogue/models/book.py
index
2371103
..
ea4debd
100644
(file)
--- a/
src/catalogue/models/book.py
+++ b/
src/catalogue/models/book.py
@@
-296,23
+296,24
@@
class Book(models.Model):
return self.parent.get_prev_text()
return self.parent.get_prev_text()
- def get_next_text(self):
- child = self.children.order_by('parent_number').first()
- if child is not None:
- return child.get_first_text()
+ def get_next_text(self, inside=True):
+ if inside:
+ child = self.children.order_by('parent_number').first()
+ if child is not None:
+ return child.get_first_text()
if not self.parent:
return None
sibling = self.parent.children.filter(parent_number__gt=self.parent_number).order_by('parent_number').first()
if sibling is not None:
return sibling.get_first_text()
if not self.parent:
return None
sibling = self.parent.children.filter(parent_number__gt=self.parent_number).order_by('parent_number').first()
if sibling is not None:
return sibling.get_first_text()
- return self.parent.get_next_text()
+ return self.parent.get_next_text(
inside=False
)
def get_child_audiobook(self):
BookMedia = apps.get_model('catalogue', 'BookMedia')
if not BookMedia.objects.filter(book__ancestor=self).exists():
return None
def get_child_audiobook(self):
BookMedia = apps.get_model('catalogue', 'BookMedia')
if not BookMedia.objects.filter(book__ancestor=self).exists():
return None
- for child in self.children.all():
+ for child in self.children.
order_by('parent_number').
all():
if child.has_mp3_file():
return child
child_sub = child.get_child_audiobook()
if child.has_mp3_file():
return child
child_sub = child.get_child_audiobook()
diff --git
a/src/catalogue/templates/catalogue/book_text.html
b/src/catalogue/templates/catalogue/book_text.html
index
158396f
..
9d28bd7
100644
(file)
--- a/
src/catalogue/templates/catalogue/book_text.html
+++ b/
src/catalogue/templates/catalogue/book_text.html
@@
-114,7
+114,7
@@
{% block footer %}
<div id="wltoc" class="box">
{% if book.parent %}
{% block footer %}
<div id="wltoc" class="box">
{% if book.parent %}
- {% for b in book.ancestor
.all
%}
+ {% for b in book.ancestor
s
%}
{% if forloop.counter > 1 %}
<li>
{% endif %}
{% if forloop.counter > 1 %}
<li>
{% endif %}
diff --git
a/src/wolnelektury/static/2021/scripts/main.js
b/src/wolnelektury/static/2021/scripts/main.js
index
6870837
..
4d17771
100644
(file)
--- a/
src/wolnelektury/static/2021/scripts/main.js
+++ b/
src/wolnelektury/static/2021/scripts/main.js
@@
-28,7
+28,7
@@
});
})();
});
})();
-// Ebook/Audiobook Btns
+//
/
Ebook/Audiobook Btns
(function() {
let button = $('.c-media__btn button:not(.l-button--media--full)');
let popupLayer = $('.c-media__popup');
(function() {
let button = $('.c-media__btn button:not(.l-button--media--full)');
let popupLayer = $('.c-media__popup');
@@
-138,6
+138,14
@@
}
if($change.length) { change(); }
}
if($change.length) { change(); }
+
+
+ function quit_experiment() {
+ document.cookie = 'EXPERIMENT_layout=off; path=/; max-age=31536000';
+ window.location.reload(true);
+ }
+ $(".quit-experiment").click(quit_experiment);
+
})();
//Switch
})();
//Switch
diff --git
a/src/wolnelektury/static/2022/styles/components/_player.scss
b/src/wolnelektury/static/2022/styles/components/_player.scss
index
6adafd7
..
2589d9c
100644
(file)
--- a/
src/wolnelektury/static/2022/styles/components/_player.scss
+++ b/
src/wolnelektury/static/2022/styles/components/_player.scss
@@
-307,3
+307,9
@@
}
}
}
}
}
}
+
+
+.project-icon {
+ max-width: 100px;
+ max-height: 50px;
+}