(function(){
    var tempVersion = new Date().getTime();

    angular.module("app.manage")
        .config(['$stateProvider',"$urlRouterProvider",function ($stateProvider,$urlRouterProvider) {
        var menu = "manage",html = ["app","auth","event","activityevent","profile","userinfo","usergroup","nopower"];

        var nodetail = ["systemparam","event","profile","downloadurl"];
        $stateProvider.state(menu,{
            url:"",
            templateUrl: '/template/menu/collect.html?r='+tempVersion,
            controller: "collectCtrl"
        });
        html.forEach(function(h){
            $stateProvider.state('collect.' + h,{
                url:"/" + menu + "/" + h,
                params:{
                    aid:null
                },
                views:{
                    "content@":{
                        templateUrl: "/template/" + menu + "/" + h + '.html?r='+tempVersion,
                        controller: h +"Ctrl"
                    }
                }
            });
            if(nodetail.indexOf(h)==-1){
                var v = h+"Detail";
                $stateProvider.state('collect.' + v,{
                    url:"/" + menu + "/" + v,
                    params:{
                        aid:null
                    },
                    views:{
                        "content@":{
                            templateUrl: "/template/" + menu + "/" + v + '.html?r='+tempVersion,
                            controller: v +"Ctrl"
                        }
                    }
                });
            }
        });
    }]);
})();
