for child in self.children.all():
child.parent_cover_changed()
+ def other_versions(self):
+ """Find other versions (i.e. in other languages) of the book."""
+ return type(self).objects.filter(common_slug=self.common_slug).exclude(pk=self.pk)
+
def related_info(self):
"""Keeps info about related objects (tags, media) in cache field."""
if self._related_info is not None:
<li><a class="open-player" target="_blank" href="{% url "book_player" book.slug %}">
{% trans "Listen" %}</a></li>
{% endif %}
+ {% if book.other_versions.exists %}
+ <li><a class="menu" href="#other-versions">Inne wersje</a></li>
+ {% endif %}
</ul>
</div>
<div id="info">
{% endif %}
</ul>
</div>
+ {% if book.other_versions.exists %}
+ <div id="other-versions">
+ <ul>
+ {% for version in book.other_versions %}
+ <li>{{ version.pretty_title }}:
+ <br/><a href="#" class="display-other" data-other="{{ version.html_file.url }}">porównaj</a>,
+ <a href="{{ version.get_absolute_url }}">przejdź</a>.
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+ {% endif %}
<div id="header">
<a href="/"><img src="{% static "img/logo-220.png" %}" alt="Wolne Lektury" /></a>
</div>
- {{ book.html_file.read|safe }}
+
+ <div style="position:relative; margin: 4.5em 0">
+ {{ book.html_file.read|safe }}
+ <div id="other-text"
+ style="display:none;position: absolute; top: 0; left: 780px; border-left: 1px solid #ddd">
+ <a id="other-text-close" href="#" style="position: absolute; top: -1.5em;">(zamknij)</a>
+ <div id="other-text-waiter">wait...</div>
+ <div id="other-text-body" style="display: none;"></div>
+ </div>
+ </div>
{{ piwik_tag|safe }}
</body>
</html>
}
#book-text {
- margin: 3em;
+ margin: 0 3em;
max-width: 36em;
}
+#other-text #book-text {
+ width: 36em;
+}
+
/* ================================== */
/* = Header with logo and menu = */
/* ================================== */
}
-#toc, #themes, #nota_red, #info {
+#toc, #themes, #nota_red, #info, #other-versions {
position: fixed;
left: 0em;
top: 1.5em;
/* =================================================== */
h1 {
font-size: 3em;
- margin: 1.5em 0;
+ margin: 0 0 1.5em 0;
text-align: center;
line-height: 1.5em;
font-weight: bold;
'js/jquery.eventdelegation.js',
'js/jquery.scrollto.js',
'js/jquery.highlightfade.js',
+ 'js/book_text/other.js',
'js/book.js',
'player/openplayer.js',
],