/**
 *
 */
angular.module("myApp", ["ui.router","ui.bootstrap"]).config(function ($stateProvider, $urlRouterProvider, $locationProvider) {

    $locationProvider.hashPrefix('');
    //trở về trang mặc định
    $urlRouterProvider.otherwise("/admin-home");

    $stateProvider
        .state("layout3", {
            abstract: true,
            views: {
                "layout": {
                    templateUrl: "layout/layout3.html"
                }
            }
        })
        .state("layout4", {
            abstract: true,
            views: {
                "layout": {
                    templateUrl: "layout/layout4.html"
                }
            }
        })
        .state("admin-home", {
            parent: 'layout3',
            url: "/admin-home",
            views: {
                "content": {
                    templateUrl: "pages/adminhome/admin-home.html",
                }
            }
        })
        .state("login", {
            parent: 'layout4',
            url: "/login",
            views: {
                "content": {
                    templateUrl: "pages/login/login.html",
                    controller: "loginController"
                }
            }
        })
        .state("register", {
            parent: 'layout4',
            url: "/register",
            views: {
                "content": {
                    templateUrl: "pages/login/register.html",
                    controller: "loginController"
                }
            }
        })
        .state("forgot-password", {
            parent: 'layout4',
            url: "/forgot-password",
            views: {
                "content": {
                    templateUrl: "pages/login/forgot-password.html",
                    controller: "loginController"
                }
            }
        })
        .state("employees", {
            parent: 'layout3',
            url: "/employees",
            views: {
                "content": {
                    templateUrl: "pages/employee/employee.html",
                    controller: "employeeController"
                }
            }
        })
        //danh sách các dự án
        .state("project", {
            parent: 'layout3',
            url: "/project",
            views: {
                "content": {
                    templateUrl: "pages/project/project/projectListViews.html",
                    controller: "projectViewsController"
                }
            }
        })
        //thêm mới dự án
        .state("addproject", {
            parent: 'layout3',
            url: "/addproject",
            views: {
                "content": {
                    templateUrl: "pages/project/project/projectAddViews.html",
                    controller: "insertProject"
                }
            }
        })
        //sửa thông tin dự án
        .state("editproject", {
            parent: 'layout3',
            url: "/editproject/:ID",
            views: {
                "content": {
                    templateUrl: "pages/project/project/projectEditViews.html",
                    controller: "loadProjectDetail"
                }
            }
        })
        //danh sách thành viên trong nhóm dự án
        .state("groupProjectByProjectId", {
            parent: 'layout3',
            url: "/groupProjectByProjectId/:ID",
            params: {ID: null},
            views: {
                "content": {
                    templateUrl: "pages/project/groupproject/groupProjectView.html",
                    controller: "groupProjectShowController"
                }
            }
        })
        //thêm thành viên vào nhóm dự án
        .state("addEmployeeProject", {
            parent: 'layout3',
            url: "/addEmployeeProject",
            views: {
                "content": {
                    templateUrl: "pages/project/groupproject/groupProjectAddView.html",
                    controller: "insertEmployeeProject"
                }
            }
        })
        //sửa thông tin nhân viên trong nhóm
        .state("editEmployeeProject", {
            parent: 'layout3',
            url: "/editEmployeeProject/:ID",
            views: {
                "content": {
                    templateUrl: "pages/project/groupproject/groupProjectEditView.html",
                    controller: "loadEmployeeProjectDetail"
                }
            }
        })
//    danh sách project vào các issues
        .state("issues", {
            parent: 'layout3',
            url: "/issues",
            views: {
                "content": {
                    templateUrl: "pages/issue/IssueView.html",
                    controller: "IssuesShowController"
                }
            }
        })
//    thêm mới issues
        .state("addIssues", {
            parent: 'layout3',
            url: "/addIssues",
            views: {
                "content": {
                    templateUrl: "pages/issue/IssueAdd.html",
                    controller: "IssuesAddController"
                }
            }
        })
        //    thêm mới issues
        .state("IssuesComment", {
            parent: 'layout3',
            url: "/issuescomment/:IssuesId",
            views: {
                "content": {
                    templateUrl: "pages/issue/IssueDetailViews.html",
                    controller: "loadIssuesDetail"
                }
            }
        })
});
