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

    This is the view to search information about books by rating.
    This view shows a form with a combo element to select a book
    rating between 0 to 10.

    If there are books matched to inserted rating, these books will
    be listed in another view, where the user can access to view
    details of every book.
-->

    <section data-ng-controller="BooksController" data-ng-init="getRatings()">
        <h1>Búsqueda de libros por valoración</h1><hr>
        <form data-ng-submit="listBooksByRating()" novalidate>
            <div>
                <label for="bookRating">Valoración del libro:</label>
                <div>
                    <select data-ng-model="rating" id="bookRating" required>
                        <option data-ng-repeat="rating in ratings"
                                data-ng-value="rating" data-ng-bind="rating">
                        </option>
                    </select>
                </div>
            </div><br>
            <div>
                <input type="submit" value="Buscar libros">
            </div><hr>
            <br>
            <div data-ng-show="error">
                <strong data-ng-bind="error"></strong>
            </div>
            <br>
            <a data-ng-href="/#!/books">Volver al menú anterior</a>
        </form>
    </section>