{#
:param pagination: pagination object with page info and items
:param fn_author_to_query: function that accepts an author string and returns a string search query parameter
:param endpoint_desc: EndPoint object for use in url_for with pagination
#}
{% from 'macros/_misc.html' import render_pagination, render_book_table %}

{% extends 'layouts/base_navsearch.html' %}

{% set page_title = _('Project Gutenberg Index by Book Title') %}

{% block body %}
    {% if pagination and pagination.pages > 0 %}
        <p>{% trans total=pagination.total %}<strong>{{ total }}</strong> pages of books by title.{% endtrans %}</p>
        {{ render_book_table(pagination.items, pagination.per_page * (pagination.page - 1), fn_author_to_query, 'table table-striped table-hover') }}
        {{ render_pagination(pagination, endpoint_desc) }}
    {% else %}
        <p>{% trans %}No books found. Perhaps the data needs to be updated.{% endtrans %}</p>
    {% endif %}
{% endblock %}
