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

    This is the view to search information about books by year. This
    view shows a form with a combo element to select a book year
    from 2000 to 2015.

    If there are books matched to inserted year, 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="getYears()">
        <h1>Búsqueda de libros por fecha de publicación</h1><hr>
        <form data-ng-submit="listBooksByYear()" novalidate>
            <div>
                <label for="bookYear">Fecha de publicación:</label>
                <div>
                    <select data-ng-model="publicationDate" id="bookYear" required>
                        <option data-ng-repeat="year in years"
                                data-ng-value="year" data-ng-bind="year | filterToFormatPublicationDate">
                        </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>