book.tags = book_tags
if hasattr(book_info, 'parts'):
- for part_url, n in enumerate(book_info.parts):
+ for n, part_url in enumerate(book_info.parts):
base, slug = part_url.rsplit('/', 1)
child_book = Book.objects.get(slug=slug)
child_book.parent = book
book = get_object_or_404(models.Book, slug=slug)
tags = list(book.tags.filter(~Q(category='set')))
categories = split_tags(tags)
+ book_children = book.children.all().order_by('parent_number')
form = forms.SearchForm()
return render_to_response('catalogue/book_detail.html', locals(),
margin-left: 3.5em;
}
-.book-thumbnail {
+.book-thumbnail, .book-parent-thumbnail {
background: transparent url(/media/img/book.png) no-repeat 0 0;
width: 3em;
height: 3em;
float: left;
}
+.book-parent-thumbnail {
+ background: transparent url(/media/img/book-parent.png) no-repeat 0 0;
+}
+
+
/* =============== */
/* = Simple form = */
/* =============== */
</ul>
</div>
- {% if book.children.all %}
+ {% if book_children %}
<div id="book-children">
<h2>Utwory składające się na ten utwór:</h2>
- {% for book in book.children.all %}
- <li><a href="{{ book.get_absolute_url }}">{{ book.title }}</a></li>
+ <ol>
+ {% for book in book_children %}
+ <li>{{ book.short_html }}</li>
{% endfor %}
+ </ol>
</div>
{% endif %}
<div class="change-sets">
<a href="{% url catalogue.views.book_sets book.slug %}" class="jqm-trigger">Na półkę!</a>
</div>
- {% if book.children %}
+ {% if book.children.all|length %}
<div class="book-parent-thumbnail"></div>
{% else %}
<div class="book-thumbnail"></div>