{% import 'image.html' as image %} {% extends "layout.html" %} {% block body %} {% if current_user.show_detail_random() and page != "discover" %}

{{_('Discover (Random Books)')}}

{% for entry in random %}

{{entry.Books.title|shortentitle}}

{% for author in entry.Books.authors %} {% if loop.index > g.config_authors_max and g.config_authors_max != 0 %} {% if not loop.first %} & {% endif %} {{author.name.replace('|',',')|shortentitle(30)}} {% if loop.last %} (...) {% endif %} {% else %} {% if not loop.first %} & {% endif %} {{author.name.replace('|',',')|shortentitle(30)}} {% endif %} {% endfor %}

{% if entry.Books.series.__len__() > 0 %}

{{entry.Books.series[0].name}} ({{entry.Books.series_index|formatfloat(2)}})

{% endif %} {% if entry.Books.ratings.__len__() > 0 %}
{% for number in range((entry.Books.ratings[0].rating/2)|int(2)) %} {% if loop.last and loop.index < 5 %} {% for numer in range(5 - loop.index) %} {% endfor %} {% endif %} {% endfor %}
{% endif %}
{% endfor %}
{% endif %}

{{title}}

{% if page != 'discover' %} {% endif %}
{% if entries[0] %} {% for entry in entries %}

{{entry.Books.title|shortentitle}}

{% for author in entry.Books.authors %} {% if loop.index > g.config_authors_max and g.config_authors_max != 0 %} {% if not loop.first %} & {% endif %} {{author.name.replace('|',',')|shortentitle(30)}} {% if loop.last %} (...) {% endif %} {% else %} {% if not loop.first %} & {% endif %} {{author.name.replace('|',',')|shortentitle(30)}} {% endif %} {% endfor %} {% if entry.Books.data|music %} {% endif %}

{% if entry.Books.series.__len__() > 0 %}

{% if page != "series" %} {{entry.Books.series[0].name}} {% else %} {{entry.Books.series[0].name}} {% endif %} ({{entry.Books.series_index|formatfloat(2)}})

{% endif %} {% if entry.Books.ratings.__len__() > 0 %}
{% for number in range((entry.Books.ratings[0].rating/2)|int(2)) %} {% if loop.last and loop.index < 5 %} {% for numer in range(5 - loop.index) %} {% endfor %} {% endif %} {% endfor %}
{% endif %}
{% endfor %} {% endif %}
{% endblock %}