/**
 *
 */
angular.module("myApp", ["ngAnimate", "ui.router", "ui.bootstrap"]).config(function ($stateProvider, $urlRouterProvider, $locationProvider) {
    $locationProvider.hashPrefix('');
    //trở về trang mặc định
    $urlRouterProvider.otherwise("/leaveform");

    $stateProvider
        .state("layout2", {
            abstract: true,
            views: {
                "layout": {
                    templateUrl: "layout/layout2.html"
                }
            }
        })
        .state("admin", {
            parent: 'layout2',
            url: "/admin",
            views: {
                "content": {
                    templateUrl: "pages/adminhome/admin-home.html",
                    controller: "adminController"
                }
            }
        })
        .state("login", {
            parent: 'layout2',
            url: "/login",
            views: {
                "content": {
                    templateUrl: "pages/login/login.html",
                    controller: "loginController"
                }
            }
        })
        .state("register", {
            parent: 'layout2',
            url: "/register",
            views: {
                "content": {
                    templateUrl: "pages/login/register.html",
                    controller: "loginController"
                }
            }
        })
        .state("forgot-password", {
            parent: 'layout2',
            url: "/forgot-password",
            views: {
                "content": {
                    templateUrl: "pages/login/forgot-password.html",
                    controller: "loginController"
                }
            }
        })
        .state("news", {
            parent: 'layout2',
            url: "/news",
            views: {
                "content": {
                    templateUrl: "pages/homepage/homepage.html",
                    controller: "homeController"
                }
            }
        })
        .state("newsDetail",{
            parent:'layout2',
            url:"/news/:Id1",
            views:{
                "content":{
                    templateUrl: "pages/homepage/newsDetail.html",
                    controller: "homeController"
                }
            }
        })
        .state("NewsByCatalogi",{
            parent:'layout2',
            url:"/news/catagori/:catagoriId",
            views:{
                "content":{
                    templateUrl: "pages/homepage/newsDetailByCatalogi.html",
                    controller: "homeController"
                }
            }
        })
        .state("CatagoriManagement",{
            parent:'layout2',
            url:"/management/catagori",
            views:{
                "content":{
                    templateUrl: "pages/homepage/catagoriManagements.html",
                    controller: "homeController"
                }
            }
        })
        .state("newsManagement",{
            parent:'layout2',
            url:"/management/catagori/:myCatagoriId",
            views:{
                "content":{
                    templateUrl: "pages/homepage/newsManagements.html",
                    controller: "homeController"

                }
            }
        })
        .state("employees", {
            parent: 'layout2',
            url: "/employees",
            views: {
                "content": {
                    templateUrl: "pages/employee/employee.html",
                    controller: "employeeController"
                }
            }
        })
        .state("createEmployee", {
            parent: 'layout2',
            url: "/createEmployee",
            params: {
                emp: null
            },
            views: {
                "content": {
                    templateUrl: "pages/employee/createEmployee.html",
                    controller: "createEmployeeController"
                }
            }
        })
        .state("timeSheet", {
            parent: 'layout2',
            url: "/timesheet",
            views: {
                "content": {
                    templateUrl: "pages/timesheet/timeSheet.html",
                    controller: "timeSheetController"
                }
            }
        })
        .state("timeSheetDetail", {
            parent: 'layout2',
            url: "/timesheetdetail/:id",
            views: {
                "content": {
                    templateUrl: "pages/timesheet/timeSheetDetail.html",
                    controller: "timeSheetDetailController"
                }
            }
        })
        .state("leaveForm", {
            parent: 'layout2',
            url: "/leaveform",
            views: {
                "content": {
                    templateUrl: "pages/leaveform/leaveForm.html",
                    controller: "leaveFormController"
                }
            }
        })
        .state("leaveFormDetail", {
            parent: 'layout2',
            url: "/leaveformdetail/:id",
            views: {
                "content": {
                    templateUrl: "pages/leaveform/leaveFormDetail.html",
                    controller: "leaveFormDetailController"
                }
            }
        })
        .state("editproject", {
            parent: 'layout2',
            url: "/editproject/:ID",
            views: {
                "content": {
                    templateUrl: "pages/project/project/projectEditViews.html",
                    controller: "loadProjectDetail"
                }
            }
        })
        .state("groupProjectByProjectId", {
            parent: 'layout2',
            url: "/groupProjectByProjectId/:ID",
            views: {
                "content": {
                    templateUrl: "pages/project/groupproject/groupProjectView.html",
                    controller: "loadGroupProjectByProjectId"
                }
            }
        })
        .state("addEmployeeProject", {
            parent: 'layout2',
            url: "/addEmployeeProject",
            views: {
                "content": {
                    templateUrl: "pages/project/groupproject/groupProjectAddView.html",
                    controller: "insertEmployeeProject"
                }
            }
        })
});