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

    /**
     * New CommonJS module configuration block, inject the "$routeProvider"
     * object, and use it to define routes for films 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('films').config(['$routeProvider',
        function($routeProvider) {
            $routeProvider.
                when('/films', {
                    templateUrl: 'films/views/viewSearchesForFilms.client.view.html'
                }).
                when('/films/filmsByTitle', {
                    templateUrl: 'films/views/viewToFindFilmsByTitle.client.view.html',
                    css: 'films/css/films.client.styles.css'
                }).
                when('/films/filmsByYear', {
                    templateUrl: 'films/views/viewToFindFilmsByYear.client.view.html',
                    css: 'films/css/films.client.styles.css'
                }).
                when('/films/filmsByGenre', {
                    templateUrl: 'films/views/viewToFindFilmsByGenre.client.view.html',
                    css: 'films/css/films.client.styles.css'
                }).
                when('/films/filmsByProtagonist', {
                    templateUrl: 'films/views/viewToFindFilmsByProtagonist.client.view.html',
                    css: 'films/css/films.client.styles.css'
                }).
                when('/films/filmsByDirector', {
                    templateUrl: 'films/views/viewToFindFilmsByDirector.client.view.html',
                    css: 'films/css/films.client.styles.css'
                }).
                when('/films/filmsByRating', {
                    templateUrl: 'films/views/viewToFindFilmsByRating.client.view.html',
                    css: 'films/css/films.client.styles.css'
                }).
                when('/films/listOfFilms/:searchType/:patternToSearch', {
                    templateUrl: 'films/views/viewListOfFilms.client.view.html'
                }).
                when('/films/:filmId', {
                    templateUrl: 'films/views/viewFilmDetails.client.view.html',
                    css: 'films/css/films.client.styles.css'
                });
        }
    ]);