/**
 * Created by fran lopez on 8/12/15.
 */

    /**
     * New CommonJS module configuration block, inject the "$routeProvider"
     * object, and use it to define routes for books AngularJS module.
     */

    /**
     * The "angular.module()" method is used to grab the example module and
     * execute the "config()" method to create a new configuration block. Then,
     * the dependency injection is applied to inject the "$routeProvider" object
     * to the configuration function, and the "$routeProvider.when()" method to
     * define a new route. The first argument of the "$routeProvider.when()"
     * method is the route's URL, and the second one is an options object, where
     * was defined a template's URL.
     */

    angular.module('books').config(['$routeProvider',
        function($routeProvider) {
            $routeProvider.
                when('/books', {
                    templateUrl: 'books/views/viewSearchesForBooks.client.view.html'
                }).
                when('/books/booksByTitle', {
                    templateUrl: 'books/views/viewToFindBooksByTitle.client.view.html',
                    css: 'books/css/books.client.styles.css'
                }).
                when('/books/booksByYear', {
                    templateUrl: 'books/views/viewToFindBooksByYear.client.view.html',
                    css: 'books/css/books.client.styles.css'
                }).
                when('/books/booksByGenre', {
                    templateUrl: 'books/views/viewToFindBooksByGenre.client.view.html',
                    css: 'books/css/books.client.styles.css'
                }).
                when('/books/booksByProtagonist', {
                    templateUrl: 'books/views/viewToFindBooksByProtagonist.client.view.html',
                    css: 'books/css/books.client.styles.css'
                }).
                when('/books/booksByWriter', {
                    templateUrl: 'books/views/viewToFindBooksByWriter.client.view.html',
                    css: 'books/css/books.client.styles.css'
                }).
                when('/books/booksByRating', {
                    templateUrl: 'books/views/viewToFindBooksByRating.client.view.html',
                    css: 'films/css/films.client.styles.css'
                }).
                when('/books/listOfBooks/:searchType/:patternToSearch', {
                    templateUrl: 'books/views/viewListOfBooks.client.view.html'
                }).
                when('/books/:bookId', {
                    templateUrl: 'books/views/viewBookDetails.client.view.html',
                    css: 'books/css/books.client.styles.css'
                });
        }
    ]);