-@register.inclusion_tag('catalogue/book_wide.html', takes_context=True)
-def book_wide(context, book):
- ctx = book_short(context, book)
- ctx['extra_info'] = book.extra_info
- ctx['hide_about'] = ctx['extra_info'].get('about', '').startswith('http://wiki.wolnepodreczniki.pl')
- ctx['themes'] = book.related_themes()
- ctx['main_link'] = reverse('book_text', args=[book.slug]) if book.html_file else None
- return ctx
-
-
-@register.inclusion_tag('catalogue/book_short.html', takes_context=True)
-def book_short(context, book):
- stage_note, stage_note_url = book.stage_note()
-
- return {
- 'book': book,
- 'has_audio': book.has_media('mp3'),
- 'main_link': book.get_absolute_url(),
- 'parents': book.parents(),
- 'tags': split_tags(book.tags.exclude(category__in=('set', 'theme'))),
- 'request': context.get('request'),
- 'show_lang': book.language_code() != settings.LANGUAGE_CODE,
- 'stage_note': stage_note,
- 'stage_note_url': stage_note_url,
- }
-
-
-@register.inclusion_tag('catalogue/book_mini_box.html')
-def book_mini(book, with_link=True):
- author_str = ", ".join(tag.name
- for tag in book.tags.filter(category='author'))
- return {
- 'book': book,
- 'author_str': author_str,
- 'with_link': with_link,
- 'show_lang': book.language_code() != settings.LANGUAGE_CODE,
- }
-
-