{% block body %}
<div class="tabbed-filter">
- <h1>{% if tags %}
- {% html_title_from_tags tags %}
- {% elif list_type == 'gallery' %}{% trans "Gallery" %}{% elif list_type == 'audiobooks' %}{% trans "Audiobooks" %}{% else %}{% trans "Literature" %}
- {% endif %}
- </h1>
+ <h1>{% if tags %}{% html_title_from_tags tags %}{% endif %}</h1>
<div class="tabs">
<a class="tab white-box" data-id="authors">{% trans "Authors" %}</a>
{% if list_type == 'books' and not tags %}
<section>
<h1>{% trans "Recent publications" %}</h1>
- {% for book in last_published %}
- {% ssi_include 'catalogue_book_mini' pk=book.pk %}
- {% endfor %}
+ {% for book in last_published %}
+ {% ssi_include 'catalogue_book_mini' pk=book.pk %}
+ {% endfor %}
<a class="more" href="{% url 'recent_list' %}">{% trans "More recent publications" %}</a>
</section>
+ <section>
+ <h1>{% trans "Most popular books" %}</h1>
+ {% for book in most_popular %}
+ {% ssi_include 'catalogue_book_mini' pk=book.pk %}
+ {% endfor %}
+ </section>
{% endif %}
{% if theme_is_set %}
# this is becoming more and more hacky
if list_type == 'books' and not tags:
last_published = Book.objects.exclude(cover_thumb='').filter(parent=None).order_by('-created_at')[:20]
+ most_popular = Book.objects.exclude(cover_thumb='').order_by('-popularity__count')[:20]
else:
last_published = None
+ most_popular = None
return render_to_response(
'catalogue/tagged_object_list.html',
'list_type': list_type,
'daisy': daisy,
'last_published': last_published,
+ 'most_popular': most_popular,
'active_menu_item': 'theme' if theme_is_set else list_type,
},
context_instance=RequestContext(request))