<!--
    AngularJS template. Created by fran lopez on 14/12/15.

    This is the view to show a list of books as a result of a search
    using two route parameters:

        -> searchType: is the search type. Possible values:
            *> "booksByTitle"
            *> "booksByYear"
            *> "booksByGenre"
            *> "booksByProtagonist"
            *> "booksByWriter"
            *> "booksByRating"

        -> patternToSearch: is the pattern user to do the search.

    Every book in this list can be shown in details. Only a click on
    book name is necessary to show book details.

    If there aren't books matched to inserted pattern, the view will
    show a message.
-->

    <section data-ng-controller="BooksController" data-ng-init="find()">
        <h1>Listado de libros</h1><hr>
        <ul>
            <li data-ng-repeat="book in books">
                <a data-ng-href="#!/books/{{book._id}}"
                   data-ng-bind="book.title"></a>
                <br>
            </li>
        </ul>
        <label data-ng-hide="!books || books.length">
            No existen libros que coincidan con el patrón introducido
        </label>
        <hr><br>
        <a data-ng-href="#!/books/{{searchType}}">Volver al menú anterior</a>
    </section>