Commit 5e142f88 authored by Evren Kutar's avatar Evren Kutar

version 0.4.0

parent 249c92e4
0.1.2
\ No newline at end of file
0.4.0
\ No newline at end of file
......@@ -5,4 +5,4 @@ angular.module('ulakbus.version', [
'ulakbus.version.version-directive'
])
.value('version', '0.1.0');
.value('version', '0.4.0');
/*! ulakbus-ui 2015-11-04 */
"use strict";var app=angular.module("ulakbus",["ui.bootstrap","angular-loading-bar","ngRoute","ngSanitize","ngCookies","general","formService","ulakbus.dashboard","ulakbus.auth","ulakbus.error_pages","ulakbus.crud","ulakbus.wf","ulakbus.version","gettext","templates-prod"]).constant("RESTURL",function(){var backendurl="http://api.ulakbus.net/";if(document.cookie.indexOf("backendurl")>-1){var cookiearray=document.cookie.split(";");angular.forEach(cookiearray,function(item){item.indexOf("backendurl")>-1&&(backendurl=item.split("=")[1])})}if(location.href.indexOf("backendurl")>-1){var urlfromqstr=location.href.split("?")[1].split("=")[1];backendurl=decodeURIComponent(urlfromqstr.replace(/\+/g," ")),document.cookie="backendurl="+backendurl,window.location.href=window.location.href.split("?")[0]}return{url:backendurl}}()).constant("USER_ROLES",{all:"*",admin:"admin",student:"student",staff:"staff",dean:"dean"}).constant("AUTH_EVENTS",{loginSuccess:"auth-login-success",loginFailed:"auth-login-failed",logoutSuccess:"auth-logout-success",sessionTimeout:"auth-session-timeout",notAuthenticated:"auth-not-authenticated",notAuthorized:"auth-not-authorized"});app.config(["$routeProvider",function($routeProvider,$route){$routeProvider.when("/login",{templateUrl:"components/auth/login.html",controller:"LoginCtrl"}).when("/dashboard",{templateUrl:"components/dashboard/dashboard.html",controller:"DashCtrl"}).when("/crud/add/:model/:param/:id",{templateUrl:"components/crud/templates/add.html",controller:"CRUDAddEditCtrl"}).when("/crud/edit/:model/:param/:id/:key",{templateUrl:"components/crud/templates/add.html",controller:"CRUDAddEditCtrl"}).when("/crud/:model/:param/:id",{templateUrl:"components/crud/templates/list.html",controller:"CRUDListCtrl"}).when("/crud/detail/:model/:param/:id/:key",{templateUrl:"components/crud/templates/show.html",controller:"CRUDShowCtrl"}).when("/:model/",{templateUrl:"components/wf/templates/add.html",controller:"WFAddEditCtrl"}).otherwise({redirectTo:"/dashboard"})}]).run(function($rootScope){$rootScope.loggedInUser=!0,$rootScope.$on("$routeChangeStart",function(event,next,current){})}).config(["$httpProvider",function($httpProvider){$httpProvider.defaults.withCredentials=!0}]).run(function(gettextCatalog){gettextCatalog.setCurrentLanguage("tr"),gettextCatalog.debug=!0}).config(["cfpLoadingBarProvider",function(cfpLoadingBarProvider){cfpLoadingBarProvider.includeBar=!1,cfpLoadingBarProvider.parentSelector="loaderdiv",cfpLoadingBarProvider.spinnerTemplate='<div class="loader">Loading...</div>'}]),app.config(["$httpProvider",function($httpProvider){$httpProvider.interceptors.push(function($q,$rootScope,$location,$timeout){return{request:function(config){return"POST"===config.method&&(config.headers["Content-Type"]="text/plain"),config},response:function(response){return response.data.is_login===!1&&($rootScope.loggedInUser=response.data.is_login,$location.path("/login")),response.data.is_login===!0&&($rootScope.loggedInUser=!0,"/login"===$location.path()&&$location.path("/dashboard")),response},responseError:function(rejection){return 400===rejection.status&&$location.reload(),401===rejection.status&&($location.path("/login"),"/login"===$location.path()&&console.log("show errors on login form")),403===rejection.status&&rejection.data.is_login===!0&&($rootScope.loggedInUser=!0,"/login"===$location.path()&&$location.path("/dashboard")),404===rejection.status&&(console.log(404),$location.path("/error/404")),500===rejection.status&&($('<div class="modal"><div class="modal-dialog" style="width:1024px;" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" id="exampleModalLabel">500 Server Error</h4></div><div class="modal-body"><p><pre>'+rejection.data.error+'</pre></p></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button></div></div></div></div>').modal(),$location.path("/error/500")),$q.reject(rejection)}}})}]);var general=angular.module("general",[]);general.factory("FormDiff",function(){var formDiff={};return formDiff.get_diff=function(obj1,obj2){var result={};for(key in obj1)obj2[key]!=obj1[key]&&(result[key]=obj1[key]),"array"==typeof obj2[key]&&"array"==typeof obj1[key]&&(result[key]=arguments.callee(obj1[key],obj2[key])),"object"==typeof obj2[key]&&"object"==typeof obj1[key]&&(result[key]=arguments.callee(obj1[key],obj2[key]));return result},formDiff});var form_generator=angular.module("formService",["general"]);form_generator.factory("Generator",function($http,$q,$timeout,RESTURL,FormDiff,$rootScope){var generator={};return generator.makeUrl=function(scope){var getparams=scope.form_params.param?"?"+scope.form_params.param+"="+scope.form_params.id:"";return RESTURL.url+scope.url+(scope.form_params.model||"")+getparams},generator.generate=function(scope,data){return data.forms?(angular.forEach(data.forms,function(value,key){scope[key]=data.forms[key]}),scope.token=data.token,scope.initialModel=angular.copy(scope.model),generator.prepareFormItems(scope),scope.object_id=scope.form_params.object_id,$rootScope.showSaveButton=!0,scope):scope},generator.group=function(formObject){return formObject},generator.prepareFormItems=function(scope){return angular.forEach(scope.schema.properties,function(v,k){if(k==scope.form_params.param)return scope.model[k]=scope.form_params.id,void scope.form.splice(scope.form.indexOf(k),1);if(("submit"===v.type||"button"===v.type)&&(scope.form[scope.form.indexOf(k)]={type:v.type,title:v.title,onClick:function(){scope.model[v]=1,generator.submit(scope)}}),"date"===v.type&&(v.type="string",scope.model[k]=generator.dateformatter(scope.model[k]),$timeout(function(){jQuery("#"+k).datepicker({changeMonth:!0,changeYear:!0,dateFormat:"dd.mm.yy",onSelect:function(date){scope.model[k]=date}})})),("int"===v.type||"float"===v.type)&&(v.type="number",scope.model[k]=parseInt(scope.model[k])),"text_general"===v.type&&(v.type="string",v["x-schema-form"]={type:"textarea"}),"model"===v.type){var formitem=scope.form[scope.form.indexOf(k)],modelscope={url:scope.url,form_params:{model:v.model_name}};formitem={type:"template",templateUrl:"shared/templates/foreignKey.html",title:v.title,name:v.model_name,model_name:v.model_name,titleMap:generator.get_list(modelscope).then(function(res){formitem.titleMap=[],angular.forEach(res.data.nobjects,function(item){item!==res.data.nobjects[0]&&formitem.titleMap.push({value:item[0],name:item[1]+" "+(item[2]?item[2]:"")+"..."})})}),onSelect:function(item){scope.model[k]=item.value},onDropdownSelect:function(item,inputname){scope.model[k]=item.value,jQuery("input[name="+inputname+"]").val(item.name)}},scope.form[scope.form.indexOf(k)]=formitem}("ListNode"===v.type||"Node"===v.type)&&(scope[v.type]=scope[v.type]||{},scope[v.type][k]={title:v.title,form:[],schema:{properties:{},required:[],title:v.title,type:"object",formType:v.type,model_name:k},url:scope.url},null===scope.model[k]?scope[v.type][k].model="Node"===v.type?{}:[]:scope[v.type][k].model=scope.model[k],angular.forEach(v.schema,function(item){scope[v.type][k].schema.properties[item.name]=item,item.required===!0&&"idx"!==item.name&&scope[v.type][k].schema.required.push(item.name),"idx"===item.name?scope[v.type][k].form.push({type:"string",key:item.name,htmlClass:"hidden"}):scope[v.type][k].form.push(item.name)}),scope[v.type][k].lengthModels=scope.model[k]?1:0)}),console.log(scope.form),scope},generator.dateformatter=function(formObject){var ndate=new Date(formObject);if("Invalid Date"==ndate)return"";var newdatearray=[ndate.getDate(),ndate.getMonth(),ndate.getFullYear()];return newdatearray.join(".")},generator.get_form=function(scope){return $http.post(generator.makeUrl(scope),scope.form_params).then(function(res){return generator.generate(scope,res.data)})},generator.get_list=function(scope){return $http.get(generator.makeUrl(scope)).then(function(res){return res})},generator.get_single_item=function(scope){return $http.post(generator.makeUrl(scope),scope.form_params).then(function(res){return res})},generator.isValidEmail=function(email){var re=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return re.test(email)},generator.isValidTCNo=function(tcno){var re=/^([1-9]{1}[0-9]{9}[0,2,4,6,8]{1})$/i;return re.test(tcno)},generator.asyncValidators={emailNotValid:function(value){var deferred=$q.defer();return $timeout(function(){generator.isValidEmail(value)?deferred.resolve():deferred.reject()},500),deferred.promise},tcNoNotValid:function(value){var deferred=$q.defer();return $timeout(function(){generator.isValidTCNo(value)?deferred.resolve():deferred.reject()},500),deferred.promise}},generator.genericSubmit=function($scope,data){return $http.post(generator.makePostUrl($scope),data)},generator.submit=function($scope){angular.forEach($scope.ListNode,function(value,key){$scope.model[key]=value.model}),angular.forEach($scope.Node,function(value,key){$scope.model[key]=value.model});var data={form:$scope.model,cmd:$scope.form_params.cmd,subcmd:"do_list",model:$scope.form_params.model,token:$scope.token};return $scope.object_id&&(data.object_id=$scope.object_id),$http.post(generator.makeUrl($scope),data).success(function(data){data.forms&&(generator.generate($scope,data),$scope.$broadcast("schemaFormRedraw"))})},generator}),form_generator.controller("ModalCtrl",function($scope,$modalInstance,Generator,items){angular.forEach(items,function(value,key){$scope[key]=items[key]}),Generator.prepareFormItems($scope),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),console.log(form.$valid),$modalInstance.close($scope)},$scope.cancel=function(){$modalInstance.dismiss("cancel")}}),form_generator.directive("modalForNodes",function($modal){return{link:function(scope,element,attributes){element.on("click",function(){var modalInstance=$modal.open({animation:!1,templateUrl:"shared/templates/listnodeModalContent.html",controller:"ModalCtrl",size:"lg",resolve:{items:function(){var attribs=attributes.modalForNodes.split(","),node=angular.copy(scope.$parent[attribs[1]][attribs[0]]);return"add"===attribs[2]&&(node.model={}),attribs[3]&&(node.model=node.model[attribs[3]]),node.edit=attribs[3],node}}});modalInstance.result.then(function(childmodel,key){"Node"===childmodel.schema.formType&&(scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].model=childmodel.model),"ListNode"===childmodel.schema.formType&&(childmodel.edit?scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].model[childmodel.edit]=childmodel.model:scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].model.push(childmodel.model)),scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].lengthModels+=1})})}}}),form_generator.directive("addModalForLinkedModel",function($modal,$route,Generator){return{link:function(scope,element){element.on("click",function(){var modalInstance=$modal.open({animation:!1,templateUrl:"shared/templates/linkedModelModalContent.html",controller:"ModalCtrl",size:"lg",resolve:{items:function(){return Generator.get_form({url:"crud/",form_params:{model:scope.form.model_name,cmd:"add"}})}}});modalInstance.result.then(function(childmodel,key){Generator.submit(childmodel),$route.reload()})})}}}),form_generator.directive("editModalForLinkedModel",function($modal,Generator){return{link:function(scope,element){element.on("click",function(){var modalInstance=$modal.open({animation:!1,templateUrl:"shared/templates/linkedModelModalContent.html",controller:"ModalCtrl",size:"lg",resolve:{items:function(){return Generator.get_form({url:"crud/",form_params:{model:scope.form.title,cmd:"add"}})}}});modalInstance.result.then(function(childmodel,key){Generator.submit(childmodel)})})}}}),app.directive("logout",function($http,$location,RESTURL){return{link:function($scope,$element,$rootScope){$element.on("click",function(){$http.post(RESTURL.url+"logout",{}).then(function(){$rootScope.loggedInUser=!1,$location.path("/login")})})}}}),app.directive("headerNotification",function($http,$rootScope,$interval,RESTURL){return{templateUrl:"shared/templates/directives/header-notification.html",restrict:"E",replace:!0,link:function($scope){$scope.getNotifications=function(){$http.get(RESTURL.url+"notify",{ignoreLoadingBar:!0}).success(function(data){$scope.notifications={1:[],2:[],3:[],4:[]},angular.forEach(data.notifications,function(value,key){$scope.notifications[value.type].push(value)}),$rootScope.$broadcast("notifications",$scope.notifications)})},$scope.getNotifications(),$interval(function(){$scope.getNotifications()},5e3),$scope.markAsRead=function(items){$http.post(RESTURL.url+"notify",{ignoreLoadingBar:!0,read:[items]}).success(function(data){console.log(data)})},$scope.$on("markasread",function(event,data){$scope.markAsRead(data)})}}}),app.directive("collapseMenu",function($timeout){return{templateUrl:"shared/templates/directives/menuCollapse.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope){$rootScope.collapsed=!1,$rootScope.sidebarPinned=!1,$scope.collapseToggle=function(){$rootScope.collapsed===!1?(jQuery(".sidebar").css("width","62px"),jQuery(".manager-view").css("width","calc(100% - 62px)"),$rootScope.collapsed=!0,$rootScope.sidebarPinned=!1):(jQuery("span.menu-text, span.arrow, .sidebar footer").fadeIn(400),jQuery(".sidebar").css("width","250px"),jQuery(".manager-view").css("width","calc(100% - 250px)"),$rootScope.collapsed=!1,$rootScope.sidebarPinned=!0)},$timeout(function(){$scope.collapseToggle()})}}}),app.directive("headerSubMenu",function(){return{templateUrl:"shared/templates/directives/header-sub-menu.html",restrict:"E",controller:"CRUDAddEditCtrl",replace:!0,link:function($scope){$scope.triggerSubmit=function(){angular.element($("#submitbutton")).triggerHandler("click"),angular.element($("#submitbutton")).triggerHandler("click")}}}}),app.directive("headerBreadcrumb",function(){return{templateUrl:"shared/templates/directives/header-breadcrumb.html",restrict:"E",replace:!0}}),app.directive("selectedUser",function(){return{templateUrl:"shared/templates/directives/selected-user.html",restrict:"E",replace:!1,link:function($scope,$rootScope){$scope.selectedUser=$rootScope.selectedUser}}}),app.directive("sidebar",["$location",function(){return{templateUrl:"shared/templates/directives/sidebar.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope,$cookies,$route,$http,RESTURL,$location,$timeout){var sidebarmenu=$("#side-menu");sidebarmenu.metisMenu(),$http.get(RESTURL.url+"menu/").success(function(data){$scope.allMenuItems=angular.copy(data),$rootScope.$broadcast("authz",data),$scope.menuItems={other:$scope.allMenuItems.other},$timeout(function(){sidebarmenu.metisMenu()})}),$scope.$on("menuitems",function(event,data){$scope.menuItems[data]=$scope.allMenuItems[data],$scope.menuItems.other=$scope.allMenuItems.other,$timeout(function(){sidebarmenu.metisMenu()})}),$scope.openSidebar=function(){$rootScope.sidebarPinned===!1&&(jQuery("span.menu-text, span.arrow, .sidebar footer, #side-menu").fadeIn(400),jQuery(".sidebar").css("width","250px"),jQuery(".manager-view").css("width","calc(100% - 250px)"),$rootScope.collapsed=!1)},$scope.closeSidebar=function(){$rootScope.sidebarPinned===!1&&(jQuery(".sidebar").css("width","62px"),jQuery(".manager-view").css("width","calc(100% - 62px)"),$rootScope.collapsed=!0)},$rootScope.$watch(function($rootScope){return $rootScope.section},function(newindex,oldindex){newindex>-1&&($scope.menuItems=[$scope.allMenuItems[newindex]],$scope.collapseVar=1)}),$scope.selectedMenu=$location.path(),$scope.collapseVar=0,$scope.multiCollapseVar=0,$scope.check=function(x){x===$scope.collapseVar?$scope.collapseVar=0:$scope.collapseVar=x},$scope.breadcrumb=function(itemlist,$event){$rootScope.breadcrumblinks=itemlist,$rootScope.showSaveButton=!1},$scope.multiCheck=function(y){y===$scope.multiCollapseVar?$scope.multiCollapseVar=0:$scope.multiCollapseVar=y}}}}]),app.directive("stats",function(){return{templateUrl:"shared/templates/directives/stats.html",restrict:"E",replace:!0,scope:{model:"=",comments:"@",number:"@",name:"@",colour:"@",details:"@",type:"@","goto":"@"}}}),app.directive("notifications",function(){return{templateUrl:"shared/templates/directives/notifications.html",restrict:"E",replace:!0}}),app.directive("sidebarSearch",function(){return{templateUrl:"shared/templates/directives/sidebar-search.html",restrict:"E",replace:!0,scope:{},controller:function($scope){$scope.selectedMenu="home"}}});var auth=angular.module("ulakbus.auth",["ngRoute","schemaForm","ngCookies","general"]);auth.controller("LoginCtrl",function($scope,$q,$timeout,$routeParams,Generator,LoginService){$scope.url="login",$scope.form_params={},$scope.form_params.clear_wf=1,Generator.get_form($scope).then(function(data){$scope.form=[{key:"username",type:"string",title:"Kullanıcı Adı"},{key:"password",type:"password",title:"Şifre"},{type:"submit",title:"Giriş Yap"}]}),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid?LoginService.login($scope.url,$scope.model).error(function(data){$scope.message=data.title}):console.log("not valid")}}),auth.factory("LoginService",function($http,$rootScope,$location,$log,Session,RESTURL){var loginService={};return loginService.login=function(url,credentials){return credentials.cmd="do",$http.post(RESTURL.url+url,credentials).success(function(data,status,headers,config){$rootScope.loggedInUser=!0}).error(function(data,status,headers,config){return data})},loginService.logout=function(){return $log.info("logout"),$http.post(RESTURL.url+"logout",{}).success(function(data){$rootScope.loggedInUser=!1,$location.path("/login")})},loginService.isAuthenticated=function(){return!!Session.userId},loginService.isAuthorized=function(authorizedRoles){return angular.isArray(authorizedRoles)||(authorizedRoles=[authorizedRoles]),loginService.isAuthenticated()&&-1!==loginService.indexOf(Session.userRole)},loginService.isValidEmail=function(email){var re=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return re.test(email)},loginService}),auth.service("Session",function(){this.create=function(sessionId,userId,userRole){this.id=sessionId,this.userId=userId,this.userRole=userRole},this.destroy=function(){this.id=null,this.userId=null,this.userRole=null}}),angular.module("ulakbus.dashboard",["ngRoute"]).controller("DashCtrl",function($scope,$rootScope,$timeout,$http,$cookies,RESTURL){$scope.section=function(section_index){$rootScope.section=section_index},$scope.$on("authz",function(event,data){$scope.menuitems=data}),$scope.student_kw="",$scope.staff_kw="",$scope.students=[],$scope.staffs=[],$scope.search=function(where){$timeout(function(){"personel"===where&&$scope.staff_kw.length>2&&$scope.getItems(where,$scope.staff_kw).success(function(data){$scope.staffs=data.results}),"ogrenci"===where&&$scope.student_kw.length>2&&$scope.getItems(where,$scope.student_kw).success(function(data){$scope.students=data.results})})},$scope.getItems=function(where,what){return $http.get(RESTURL.url+"ara/"+where+"/"+what)},$scope.select=function(who,type){$rootScope.selectedUser={name:who[0],tcno:who[1],key:who[2]},$rootScope.$broadcast("menuitems",type)},$scope.$on("notifications",function(event,data){$scope.notifications=data}),$scope.markAsRead=function(items){$rootScope.$broadcast("markasread",items)}}).directive("sidebarNotifications",function(){return{templateUrl:"shared/templates/directives/sidebar-notification.html",restrict:"E",replace:!0,link:function($scope){}}});var crud=angular.module("ulakbus.crud",["ui.bootstrap","schemaForm","formService"]);crud.controller("CRUDAddEditCtrl",function($scope,$rootScope,$location,$http,$log,$modal,$timeout,Generator,$routeParams){$scope.url="crud/",$scope.form_params={model:$routeParams.model,param:$routeParams.param,id:$routeParams.id},$routeParams.key?($scope.form_params.object_id=$routeParams.key,$scope.form_params.cmd="edit"):$scope.form_params.cmd="add",$routeParams.model&&Generator.get_form($scope),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid&&Generator.submit($scope).success(function(data){$location.path("/crud/"+$scope.form_params.model+"/"+$scope.form_params.param+"/"+$scope.form_params.id).search(data)}).error(function(data){$scope.message=data.title})}}),crud.controller("CRUDListCtrl",function($scope,$rootScope,Generator,$routeParams){$scope.url="crud/",$scope.form_params=$routeParams,$routeParams.nobjects?($scope.nobjects=$routeParams.nobjects,$scope.model=$routeParams.model):Generator.get_list($scope).then(function(res){$scope.nobjects=res.data.nobjects,$scope.model=$routeParams.model})}),crud.controller("CRUDShowCtrl",function($scope,$rootScope,$location,Generator,$routeParams){$scope.url="crud/",$scope.form_params={id:$routeParams.id,object_id:$routeParams.key,cmd:"show",param:$routeParams.param,model:$routeParams.model},Generator.get_single_item($scope).then(function(res){$scope.listobjects={},$scope.object=res.data.object,angular.forEach($scope.object,function(value,key){"object"==typeof value&&($scope.listobjects[key]=value,delete $scope.object[key])}),$scope.model=$routeParams.model})}),app.config(["$routeProvider",function($routeProvider){$routeProvider.when("/error/500",{templateUrl:"components/error_pages/500.html",controller:"500Ctrl"}).when("/error/404",{templateUrl:"components/error_pages/404.html",controller:"404Ctrl"})}]),angular.module("ulakbus.error_pages",["ngRoute"]).controller("500Ctrl",function($scope,$rootScope,$location){}).controller("404Ctrl",function($scope,$rootScope,$location){});var wf=angular.module("ulakbus.wf",["ui.bootstrap","schemaForm","formService"]);wf.controller("WFAddEditCtrl",function($scope,$rootScope,$location,$http,$log,$modal,$timeout,Generator,$routeParams){$scope.url="",$scope.form_params={model:$routeParams.model},$routeParams.model&&Generator.get_form($scope),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid&&Generator.submit($scope).success(function(data){}).error(function(data){})}}),wf.controller("WFListCtrl",function($scope,$rootScope,Generator,$routeParams){$scope.url="",$scope.form_params=$routeParams,$routeParams.nobjects?($scope.nobjects=$routeParams.nobjects,$scope.model=$routeParams.model):Generator.get_list($scope).then(function(res){$scope.nobjects=res.data.nobjects,$scope.model=$routeParams.model})}),wf.controller("WFShowCtrl",function($scope,$rootScope,Generator,$routeParams){$scope.url="",$scope.form_params={object_id:$routeParams.id,cmd:"show",model:$routeParams.model},Generator.get_single_item($scope).then(function(res){$scope.listobjects={},$scope.object=res.data.object,angular.forEach($scope.object,function(value,key){"object"==typeof value&&($scope.listobjects[key]=value,delete $scope.object[key])}),$scope.model=$routeParams.model})}),angular.module("ulakbus.version",["ulakbus.version.interpolate-filter","ulakbus.version.version-directive"]).value("version","0.1.0"),angular.module("ulakbus.version.interpolate-filter",[]).filter("interpolate",["version",function(version){return function(text){return String(text).replace(/\%VERSION\%/gm,version)}}]),angular.module("ulakbus.version.version-directive",[]).directive("appVersion",["version",function(version){return function(scope,elm,attrs){elm.text(version)}}]);
\ No newline at end of file
/*! ulakbus-ui 2015-11-07 */
"use strict";var app=angular.module("ulakbus",["ui.bootstrap","angular-loading-bar","ngRoute","ngSanitize","ngCookies","general","formService","ulakbus.dashboard","ulakbus.auth","ulakbus.error_pages","ulakbus.crud","ulakbus.debug","ulakbus.devSettings","ulakbus.wf","ulakbus.version","gettext","templates-prod"]).constant("RESTURL",function(){var backendurl="http://api.ulakbus.net/";if(document.cookie.indexOf("backendurl")>-1){var cookiearray=document.cookie.split(";");angular.forEach(cookiearray,function(item){item.indexOf("backendurl")>-1&&(backendurl=item.split("=")[1])})}if(location.href.indexOf("backendurl")>-1){var urlfromqstr=location.href.split("?")[1].split("=")[1];backendurl=decodeURIComponent(urlfromqstr.replace(/\+/g," ")),document.cookie="backendurl="+backendurl,window.location.href=window.location.href.split("?")[0]}return{url:backendurl}}()).constant("USER_ROLES",{all:"*",admin:"admin",student:"student",staff:"staff",dean:"dean"}).constant("AUTH_EVENTS",{loginSuccess:"auth-login-success",loginFailed:"auth-login-failed",logoutSuccess:"auth-logout-success",sessionTimeout:"auth-session-timeout",notAuthenticated:"auth-not-authenticated",notAuthorized:"auth-not-authorized"});app.config(["$routeProvider",function($routeProvider,$route){$routeProvider.when("/login",{templateUrl:"components/auth/login.html",controller:"LoginCtrl"}).when("/dashboard",{templateUrl:"components/dashboard/dashboard.html",controller:"DashCtrl"}).when("/crud/:model/list",{templateUrl:"components/crud/templates/list.html",controller:"CRUDListCtrl"}).when("/crud/:model/add",{templateUrl:"components/crud/templates/add.html",controller:"CRUDAddEditCtrl"}).when("/crud/:model/edit/:key",{templateUrl:"components/crud/templates/add.html",controller:"CRUDAddEditCtrl"}).when("/crud/:model/detail/:key",{templateUrl:"components/crud/templates/show.html",controller:"CRUDShowCtrl"}).when("/:model/",{templateUrl:"components/wf/templates/add.html",controller:"WFAddEditCtrl"}).otherwise({redirectTo:"/dashboard"})}]).run(function($rootScope){$rootScope.loggedInUser=!0,$rootScope.$on("$routeChangeStart",function(event,next,current){})}).config(["$httpProvider",function($httpProvider){$httpProvider.defaults.withCredentials=!0}]).run(function(gettextCatalog){gettextCatalog.setCurrentLanguage("tr"),gettextCatalog.debug=!0}).config(["cfpLoadingBarProvider",function(cfpLoadingBarProvider){cfpLoadingBarProvider.includeBar=!1,cfpLoadingBarProvider.parentSelector="loaderdiv",cfpLoadingBarProvider.spinnerTemplate='<div class="loader">Loading...</div>'}]),app.config(["$httpProvider",function($httpProvider){$httpProvider.interceptors.push(function($q,$rootScope,$location,$timeout){return{request:function(config){return"POST"===config.method&&(config.headers["Content-Type"]="text/plain"),config},response:function(response){return response.data._debug_queries&&response.data._debug_queries.length>0&&($rootScope.debug_queries=$rootScope.debug_queries||[],$rootScope.debug_queries.push({url:response.config.url,queries:response.data._debug_queries})),response.data.is_login===!1&&($rootScope.loggedInUser=response.data.is_login,$location.path("/login")),response.data.is_login===!0&&($rootScope.loggedInUser=!0,"/login"===$location.path()&&$location.path("/dashboard")),response},responseError:function(rejection){return 400===rejection.status&&$location.reload(),401===rejection.status&&($location.path("/login"),"/login"===$location.path()&&console.log("show errors on login form")),403===rejection.status&&rejection.data.is_login===!0&&($rootScope.loggedInUser=!0,"/login"===$location.path()&&$location.path("/dashboard")),404===rejection.status&&(console.log(404),$location.path("/error/404")),500===rejection.status&&($('<div class="modal"><div class="modal-dialog" style="width:1024px;" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title" id="exampleModalLabel">500 Server Error</h4></div><div class="modal-body"><p><pre>'+rejection.data.error+'</pre></p></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button></div></div></div></div>').modal(),$location.path("/error/500")),$q.reject(rejection)}}})}]);var general=angular.module("general",[]);general.factory("FormDiff",function(){var formDiff={};return formDiff.get_diff=function(obj1,obj2){var result={};for(key in obj1)obj2[key]!=obj1[key]&&(result[key]=obj1[key]),"array"==typeof obj2[key]&&"array"==typeof obj1[key]&&(result[key]=arguments.callee(obj1[key],obj2[key])),"object"==typeof obj2[key]&&"object"==typeof obj1[key]&&(result[key]=arguments.callee(obj1[key],obj2[key]));return result},formDiff});var form_generator=angular.module("formService",["general"]);form_generator.factory("Generator",function($http,$q,$timeout,RESTURL,FormDiff,$rootScope){var generator={};return generator.makeUrl=function(scope){var getparams=scope.form_params.param?"?"+scope.form_params.param+"="+scope.form_params.id:"";return RESTURL.url+scope.url+(scope.form_params.model||"")+getparams},generator.generate=function(scope,data){return data.forms?(angular.forEach(data.forms,function(value,key){scope[key]=data.forms[key]}),scope.token=data.token,scope.initialModel=angular.copy(scope.model),generator.prepareFormItems(scope),scope.object_id=scope.form_params.object_id,$rootScope.showSaveButton=!0,scope):scope},generator.group=function(formObject){return formObject},generator.prepareFormItems=function(scope){return angular.forEach(scope.schema.properties,function(v,k){if(k==scope.form_params.param)return scope.model[k]=scope.form_params.id,void scope.form.splice(scope.form.indexOf(k),1);if(("submit"===v.type||"button"===v.type)&&(scope.form[scope.form.indexOf(k)]={type:v.type,title:v.title,onClick:function(){v.cmd?scope.model.cmd=v.cmd:scope.model[k]=1,generator.submit(scope)}}),"date"===v.type&&(v.type="string",scope.model[k]=generator.dateformatter(scope.model[k]),$timeout(function(){jQuery("#"+k).datepicker({changeMonth:!0,changeYear:!0,dateFormat:"dd.mm.yy",onSelect:function(date){scope.model[k]=date}})})),("int"===v.type||"float"===v.type)&&(v.type="number",scope.model[k]=parseInt(scope.model[k])),"text_general"===v.type&&(v.type="string",v["x-schema-form"]={type:"textarea"}),"model"===v.type){var formitem=scope.form[scope.form.indexOf(k)],modelscope={url:scope.url,form_params:{model:v.model_name}};formitem={type:"template",templateUrl:"shared/templates/foreignKey.html",title:v.title,name:v.model_name,model_name:v.model_name,titleMap:generator.get_list(modelscope).then(function(res){formitem.titleMap=[],angular.forEach(res.data.nobjects,function(item){item!==res.data.nobjects[0]&&formitem.titleMap.push({value:item[0],name:item[1]+" "+(item[2]?item[2]:"")+"..."})})}),onSelect:function(item){scope.model[k]=item.value},onDropdownSelect:function(item,inputname){scope.model[k]=item.value,jQuery("input[name="+inputname+"]").val(item.name)}},scope.form[scope.form.indexOf(k)]=formitem}("ListNode"===v.type||"Node"===v.type)&&(scope[v.type]=scope[v.type]||{},scope[v.type][k]={title:v.title,form:[],schema:{properties:{},required:[],title:v.title,type:"object",formType:v.type,model_name:k},url:scope.url},null===scope.model[k]?scope[v.type][k].model="Node"===v.type?{}:[]:scope[v.type][k].model=scope.model[k],angular.forEach(v.schema,function(item){scope[v.type][k].schema.properties[item.name]=item,item.required===!0&&"idx"!==item.name&&scope[v.type][k].schema.required.push(item.name),"idx"===item.name?scope[v.type][k].form.push({type:"string",key:item.name,htmlClass:"hidden"}):scope[v.type][k].form.push(item.name)}),scope[v.type][k].lengthModels=scope.model[k]?1:0)}),console.log(scope.form),scope},generator.dateformatter=function(formObject){var ndate=new Date(formObject);if("Invalid Date"==ndate)return"";var newdatearray=[ndate.getDate(),ndate.getMonth(),ndate.getFullYear()];return newdatearray.join(".")},generator.itemLinksGenerator=function(scope,itemlist){angular.forEach(itemlist.data.nobjects,function(value,key){function makelink(page){if("-1"!==value){var link="#"+scope.url+scope.form_params.model;return("edit/"===page||"detail/"===page)&&(link+="/"+page+value[0]),"add/"===page&&(link+="/add"),scope.form_params.param&&(link+="?"+scope.form_params.param+"="+scope.form_params.id),link}}itemlist.data.nobjects.addLink=makelink("add/"),value[2]={detailLink:makelink("detail/"),editLink:makelink("edit/")}})},generator.get_form=function(scope){return $http.post(generator.makeUrl(scope),scope.form_params).then(function(res){return generator.generate(scope,res.data)})},generator.get_list=function(scope){return $http.get(generator.makeUrl(scope)).then(function(res){return generator.itemLinksGenerator(scope,res),res})},generator.get_single_item=function(scope){return $http.post(generator.makeUrl(scope),scope.form_params).then(function(res){return res})},generator.isValidEmail=function(email){var re=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return re.test(email)},generator.isValidTCNo=function(tcno){var re=/^([1-9]{1}[0-9]{9}[0,2,4,6,8]{1})$/i;return re.test(tcno)},generator.asyncValidators={emailNotValid:function(value){var deferred=$q.defer();return $timeout(function(){generator.isValidEmail(value)?deferred.resolve():deferred.reject()},500),deferred.promise},tcNoNotValid:function(value){var deferred=$q.defer();return $timeout(function(){generator.isValidTCNo(value)?deferred.resolve():deferred.reject()},500),deferred.promise}},generator.genericSubmit=function($scope,data){return $http.post(generator.makePostUrl($scope),data)},generator.submit=function($scope){angular.forEach($scope.ListNode,function(value,key){$scope.model[key]=value.model}),angular.forEach($scope.Node,function(value,key){$scope.model[key]=value.model});var data={form:$scope.model,cmd:$scope.form_params.cmd,subcmd:"do_list",model:$scope.form_params.model,token:$scope.token};return $scope.object_id&&(data.object_id=$scope.object_id),$http.post(generator.makeUrl($scope),data).success(function(data){data.forms&&(generator.generate($scope,data),$scope.$broadcast("schemaFormRedraw"))})},generator}),form_generator.controller("ModalCtrl",function($scope,$modalInstance,Generator,items){angular.forEach(items,function(value,key){$scope[key]=items[key]}),Generator.prepareFormItems($scope),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),console.log(form.$valid),$modalInstance.close($scope)},$scope.cancel=function(){$modalInstance.dismiss("cancel")}}),form_generator.directive("modalForNodes",function($modal){return{link:function(scope,element,attributes){element.on("click",function(){var modalInstance=$modal.open({animation:!1,templateUrl:"shared/templates/listnodeModalContent.html",controller:"ModalCtrl",size:"lg",resolve:{items:function(){var attribs=attributes.modalForNodes.split(","),node=angular.copy(scope.$parent[attribs[1]][attribs[0]]);return"add"===attribs[2]&&(node.model={}),attribs[3]&&(node.model=node.model[attribs[3]]),node.edit=attribs[3],node}}});modalInstance.result.then(function(childmodel,key){"Node"===childmodel.schema.formType&&(scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].model=childmodel.model),"ListNode"===childmodel.schema.formType&&(childmodel.edit?scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].model[childmodel.edit]=childmodel.model:scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].model.push(childmodel.model)),scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].lengthModels+=1})})}}}),form_generator.directive("addModalForLinkedModel",function($modal,$route,Generator){return{link:function(scope,element){element.on("click",function(){var modalInstance=$modal.open({animation:!1,templateUrl:"shared/templates/linkedModelModalContent.html",controller:"ModalCtrl",size:"lg",resolve:{items:function(){return Generator.get_form({url:"crud/",form_params:{model:scope.form.model_name,cmd:"add"}})}}});modalInstance.result.then(function(childmodel,key){Generator.submit(childmodel),$route.reload()})})}}}),form_generator.directive("editModalForLinkedModel",function($modal,Generator){return{link:function(scope,element){element.on("click",function(){var modalInstance=$modal.open({animation:!1,templateUrl:"shared/templates/linkedModelModalContent.html",controller:"ModalCtrl",size:"lg",resolve:{items:function(){return Generator.get_form({url:"crud/",form_params:{model:scope.form.title,cmd:"add"}})}}});modalInstance.result.then(function(childmodel,key){Generator.submit(childmodel)})})}}}),app.directive("logout",function($http,$location,RESTURL){return{link:function($scope,$element,$rootScope){$element.on("click",function(){$http.post(RESTURL.url+"logout",{}).then(function(){$rootScope.loggedInUser=!1,$location.path("/login")})})}}}),app.directive("headerNotification",function($http,$rootScope,$cookies,$interval,RESTURL){return{templateUrl:"shared/templates/directives/header-notification.html",restrict:"E",replace:!0,link:function($scope){$scope.groupNotifications=function(notifications){$scope.notifications={1:[],2:[],3:[],4:[]},angular.forEach(notifications,function(value,key){$scope.notifications[value.type].push(value)})},$scope.getNotifications=function(){$http.get(RESTURL.url+"notify",{ignoreLoadingBar:!0}).success(function(data){$scope.groupNotifications(data.notifications),$rootScope.$broadcast("notifications",$scope.notifications)})},$scope.getNotifications(),$interval(function(){"on"==$cookies.get("notificate")&&(console.log("get notification call - interval"),$scope.getNotifications())},5e3),$scope.markAsRead=function(items){$http.post(RESTURL.url+"notify",{ignoreLoadingBar:!0,read:[items]}).success(function(data){$scope.groupNotifications(data.notifications),$rootScope.$broadcast("notifications",$scope.notifications)})},$scope.$on("markasread",function(event,data){$scope.markAsRead(data)})}}}),app.directive("collapseMenu",function($timeout){return{templateUrl:"shared/templates/directives/menuCollapse.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope){$rootScope.collapsed=!1,$rootScope.sidebarPinned=!1,$scope.collapseToggle=function(){$rootScope.collapsed===!1?(jQuery(".sidebar").css("width","62px"),jQuery(".manager-view").css("width","calc(100% - 62px)"),$rootScope.collapsed=!0,$rootScope.sidebarPinned=!1):(jQuery("span.menu-text, span.arrow, .sidebar footer").fadeIn(400),jQuery(".sidebar").css("width","250px"),jQuery(".manager-view").css("width","calc(100% - 250px)"),$rootScope.collapsed=!1,$rootScope.sidebarPinned=!0)},$timeout(function(){$scope.collapseToggle()})}}}),app.directive("headerSubMenu",function(){return{templateUrl:"shared/templates/directives/header-sub-menu.html",restrict:"E",controller:"CRUDAddEditCtrl",replace:!0,link:function($scope){$scope.triggerSubmit=function(){angular.element($("#submitbutton")).triggerHandler("click"),angular.element($("#submitbutton")).triggerHandler("click")}}}}),app.directive("headerBreadcrumb",function(){return{templateUrl:"shared/templates/directives/header-breadcrumb.html",restrict:"E",replace:!0}}),app.directive("selectedUser",function(){return{templateUrl:"shared/templates/directives/selected-user.html",restrict:"E",replace:!1,link:function($scope,$rootScope){$scope.selectedUser=$rootScope.selectedUser}}}),app.directive("sidebar",["$location",function(){return{templateUrl:"shared/templates/directives/sidebar.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope,$cookies,$route,$http,RESTURL,$location,$timeout){var sidebarmenu=$("#side-menu");sidebarmenu.metisMenu(),$http.get(RESTURL.url+"menu/").success(function(data){function reGroupMenuItems(items){var newItems={};return angular.forEach(items,function(value,key){newItems[value.kategori]=newItems[value.kategori]||[],newItems[value.kategori].push(value)}),newItems}$scope.allMenuItems=angular.copy(data),angular.forEach($scope.allMenuItems,function(value,key){$scope.allMenuItems[key]=reGroupMenuItems(value)}),console.log($scope.allMenuItems),$rootScope.$broadcast("authz",data),$scope.menuItems={other:$scope.allMenuItems.other},$timeout(function(){sidebarmenu.metisMenu()})}),$scope.$on("menuitems",function(event,data){$scope.menuItems[data]=$scope.allMenuItems[data],$scope.menuItems.other=$scope.allMenuItems.other,$timeout(function(){sidebarmenu.metisMenu()})}),$scope.openSidebar=function(){$rootScope.sidebarPinned===!1&&(jQuery("span.menu-text, span.arrow, .sidebar footer, #side-menu").fadeIn(400),jQuery(".sidebar").css("width","250px"),jQuery(".manager-view").css("width","calc(100% - 250px)"),$rootScope.collapsed=!1)},$scope.closeSidebar=function(){$rootScope.sidebarPinned===!1&&(jQuery(".sidebar").css("width","62px"),jQuery(".manager-view").css("width","calc(100% - 62px)"),$rootScope.collapsed=!0)},$rootScope.$watch(function($rootScope){return $rootScope.section},function(newindex,oldindex){newindex>-1&&($scope.menuItems=[$scope.allMenuItems[newindex]],$scope.collapseVar=1)}),$scope.selectedMenu=$location.path(),$scope.collapseVar=0,$scope.multiCollapseVar=0,$scope.check=function(x){x===$scope.collapseVar?$scope.collapseVar=0:$scope.collapseVar=x},$scope.breadcrumb=function(itemlist,$event){$rootScope.breadcrumblinks=itemlist,$rootScope.showSaveButton=!1},$scope.multiCheck=function(y){y===$scope.multiCollapseVar?$scope.multiCollapseVar=0:$scope.multiCollapseVar=y}}}}]),app.directive("stats",function(){return{templateUrl:"shared/templates/directives/stats.html",restrict:"E",replace:!0,scope:{model:"=",comments:"@",number:"@",name:"@",colour:"@",details:"@",type:"@","goto":"@"}}}),app.directive("notifications",function(){return{templateUrl:"shared/templates/directives/notifications.html",restrict:"E",replace:!0}}),app.directive("sidebarSearch",function(){return{templateUrl:"shared/templates/directives/sidebar-search.html",restrict:"E",replace:!0,scope:{},controller:function($scope){$scope.selectedMenu="home"}}});var auth=angular.module("ulakbus.auth",["ngRoute","schemaForm","ngCookies","general"]);auth.controller("LoginCtrl",function($scope,$q,$timeout,$routeParams,Generator,LoginService){$scope.url="login",$scope.form_params={},$scope.form_params.clear_wf=1,Generator.get_form($scope).then(function(data){$scope.form=[{key:"username",type:"string",title:"Kullanıcı Adı"},{key:"password",type:"password",title:"Şifre"},{type:"submit",title:"Giriş Yap"}]}),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid?LoginService.login($scope.url,$scope.model).error(function(data){$scope.message=data.title}):console.log("not valid")}}),auth.factory("LoginService",function($http,$rootScope,$location,$log,Session,RESTURL){var loginService={};return loginService.login=function(url,credentials){return credentials.cmd="do",$http.post(RESTURL.url+url,credentials).success(function(data,status,headers,config){$rootScope.loggedInUser=!0}).error(function(data,status,headers,config){return data})},loginService.logout=function(){return $log.info("logout"),$http.post(RESTURL.url+"logout",{}).success(function(data){$rootScope.loggedInUser=!1,$location.path("/login")})},loginService.isAuthenticated=function(){return!!Session.userId},loginService.isAuthorized=function(authorizedRoles){return angular.isArray(authorizedRoles)||(authorizedRoles=[authorizedRoles]),loginService.isAuthenticated()&&-1!==loginService.indexOf(Session.userRole)},loginService.isValidEmail=function(email){var re=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;return re.test(email)},loginService}),auth.service("Session",function(){this.create=function(sessionId,userId,userRole){this.id=sessionId,this.userId=userId,this.userRole=userRole},this.destroy=function(){this.id=null,this.userId=null,this.userRole=null}}),angular.module("ulakbus.dashboard",["ngRoute"]).controller("DashCtrl",function($scope,$rootScope,$timeout,$http,$cookies,RESTURL){$scope.section=function(section_index){$rootScope.section=section_index},$scope.$on("authz",function(event,data){$scope.menuitems=data}),$scope.student_kw="",$scope.staff_kw="",$scope.students=[],$scope.staffs=[],$scope.search=function(where){$timeout(function(){"personel"===where&&$scope.staff_kw.length>2&&$scope.getItems(where,$scope.staff_kw).success(function(data){$scope.staffs=data.results}),"ogrenci"===where&&$scope.student_kw.length>2&&$scope.getItems(where,$scope.student_kw).success(function(data){$scope.students=data.results})})},$scope.getItems=function(where,what){return $http.get(RESTURL.url+"ara/"+where+"/"+what)},$scope.select=function(who,type){$rootScope.selectedUser={name:who[0],tcno:who[1],key:who[2]},$rootScope.$broadcast("menuitems",type)},$scope.$on("notifications",function(event,data){$scope.notifications=data}),$scope.markAsRead=function(items){$rootScope.$broadcast("markasread",items)}}).directive("sidebarNotifications",function(){return{templateUrl:"shared/templates/directives/sidebar-notification.html",restrict:"E",replace:!0,link:function($scope){}}});var crud=angular.module("ulakbus.crud",["ui.bootstrap","schemaForm","formService"]);crud.controller("CRUDAddEditCtrl",function($scope,$rootScope,$location,$http,$log,$modal,$timeout,Generator,$routeParams){$scope.url="crud/",angular.forEach($routeParams,function(value,key){key.indexOf("_id")>-1&&($scope.param=key,$scope.param_id=value)}),$scope.form_params={model:$routeParams.model,param:$scope.param,id:$scope.param_id},$routeParams.key?($scope.form_params.object_id=$routeParams.key,$scope.form_params.cmd="edit"):$scope.form_params.cmd="add",$routeParams.model&&Generator.get_form($scope),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid&&Generator.submit($scope).success(function(data){$location.path("/crud/"+$scope.form_params.model+"/"+$scope.form_params.param+"/"+$scope.form_params.id).search(data)}).error(function(data){$scope.message=data.title})}}),crud.controller("CRUDListCtrl",function($scope,$rootScope,Generator,$routeParams){$scope.url="crud/",angular.forEach($routeParams,function(value,key){key.indexOf("_id")>-1&&($scope.param=key,$scope.param_id=value)}),$scope.form_params={model:$routeParams.model,param:$scope.param,id:$scope.param_id},$routeParams.nobjects?($scope.nobjects=$routeParams.nobjects,$scope.model=$routeParams.model):Generator.get_list($scope).then(function(res){$scope.nobjects=res.data.nobjects,$scope.model=$routeParams.model})}),crud.controller("CRUDShowCtrl",function($scope,$rootScope,$location,Generator,$routeParams){$scope.url="crud/",angular.forEach($routeParams,function(value,key){key.indexOf("_id")>-1&&($scope.param=key,$scope.param_id=value)}),$scope.form_params={id:$scope.param_id,object_id:$routeParams.key,cmd:"show",param:$scope.param,model:$routeParams.model},Generator.get_single_item($scope).then(function(res){$scope.listobjects={},$scope.object=res.data.object,angular.forEach($scope.object,function(value,key){"object"==typeof value&&($scope.listobjects[key]=value,delete $scope.object[key])}),$scope.model=$routeParams.model})}),app.config(["$routeProvider",function($routeProvider){$routeProvider.when("/debug/list",{templateUrl:"components/debug/debug.html",controller:"DebugCtrl"})}]),angular.module("ulakbus.debug",["ngRoute"]).controller("DebugCtrl",function($scope,$rootScope,$location){$scope.debug_queries=$rootScope.debug_queries}),app.config(["$routeProvider",function($routeProvider){$routeProvider.when("/dev/settings",{templateUrl:"components/devSettings/devSettings.html",controller:"DevSettingsCtrl"})}]),angular.module("ulakbus.devSettings",["ngRoute"]).controller("DevSettingsCtrl",function($scope,$cookies,$rootScope,RESTURL){$scope.backendurl=$cookies.get("backendurl"),$scope.notificate=$cookies.get("notificate")||"on",$scope.changeSettings=function(what,set){document.cookie=what+"="+set,$scope[what]=set,$rootScope.$broadcast(what,set)},$scope.switchOnOff=function(pinn){return"on"==pinn?"off":"on"},$scope.setbackendurl=function(){$scope.changeSettings("backendurl",$scope.backendurl),RESTURL.url=$scope.backendurl},$scope.setnotification=function(){$scope.changeSettings("notificate",$scope.switchOnOff($scope.notificate))}}),app.config(["$routeProvider",function($routeProvider){$routeProvider.when("/error/500",{templateUrl:"components/error_pages/500.html",controller:"500Ctrl"}).when("/error/404",{templateUrl:"components/error_pages/404.html",controller:"404Ctrl"})}]),angular.module("ulakbus.error_pages",["ngRoute"]).controller("500Ctrl",function($scope,$rootScope,$location){}).controller("404Ctrl",function($scope,$rootScope,$location){});var wf=angular.module("ulakbus.wf",["ui.bootstrap","schemaForm","formService"]);wf.controller("WFAddEditCtrl",function($scope,$rootScope,$location,$http,$log,$modal,$timeout,Generator,$routeParams){$scope.url="",$scope.form_params={model:$routeParams.model},$routeParams.model&&Generator.get_form($scope),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid&&Generator.submit($scope).success(function(data){}).error(function(data){})}}),wf.controller("WFListCtrl",function($scope,$rootScope,Generator,$routeParams){$scope.url="",$scope.form_params=$routeParams,$routeParams.nobjects?($scope.nobjects=$routeParams.nobjects,$scope.model=$routeParams.model):Generator.get_list($scope).then(function(res){$scope.nobjects=res.data.nobjects,$scope.model=$routeParams.model})}),wf.controller("WFShowCtrl",function($scope,$rootScope,Generator,$routeParams){$scope.url="",$scope.form_params={object_id:$routeParams.id,cmd:"show",model:$routeParams.model},Generator.get_single_item($scope).then(function(res){$scope.listobjects={},$scope.object=res.data.object,angular.forEach($scope.object,function(value,key){"object"==typeof value&&($scope.listobjects[key]=value,delete $scope.object[key])}),$scope.model=$routeParams.model})}),angular.module("ulakbus.version",["ulakbus.version.interpolate-filter","ulakbus.version.version-directive"]).value("version","0.1.0"),angular.module("ulakbus.version.interpolate-filter",[]).filter("interpolate",["version",function(version){return function(text){return String(text).replace(/\%VERSION\%/gm,version)}}]),angular.module("ulakbus.version.version-directive",[]).directive("appVersion",["version",function(version){return function(scope,elm,attrs){elm.text(version)}}]);
\ No newline at end of file
/*! ulakbus-ui 2015-11-04 */
/*! ulakbus-ui 2015-11-07 */
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function($){"use strict";var version=$.fn.jquery.split(" ")[0].split(".");if(version[0]<2&&version[1]<9||1==version[0]&&9==version[1]&&version[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function($){"use strict";function transitionEnd(){var el=document.createElement("bootstrap"),transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var name in transEndEventNames)if(void 0!==el.style[name])return{end:transEndEventNames[name]};return!1}$.fn.emulateTransitionEnd=function(duration){var called=!1,$el=this;$(this).one("bsTransitionEnd",function(){called=!0});var callback=function(){called||$($el).trigger($.support.transition.end)};return setTimeout(callback,duration),this},$(function(){$.support.transition=transitionEnd(),$.support.transition&&($.event.special.bsTransitionEnd={bindType:$.support.transition.end,delegateType:$.support.transition.end,handle:function(e){return $(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function($){"use strict";function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.alert");data||$this.data("bs.alert",data=new Alert(this)),"string"==typeof option&&data[option].call($this)})}var dismiss='[data-dismiss="alert"]',Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.VERSION="3.3.5",Alert.TRANSITION_DURATION=150,Alert.prototype.close=function(e){function removeElement(){$parent.detach().trigger("closed.bs.alert").remove()}var $this=$(this),selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,""));var $parent=$(selector);e&&e.preventDefault(),$parent.length||($parent=$this.closest(".alert")),$parent.trigger(e=$.Event("close.bs.alert")),e.isDefaultPrevented()||($parent.removeClass("in"),$.support.transition&&$parent.hasClass("fade")?$parent.one("bsTransitionEnd",removeElement).emulateTransitionEnd(Alert.TRANSITION_DURATION):removeElement())};var old=$.fn.alert;$.fn.alert=Plugin,$.fn.alert.Constructor=Alert,$.fn.alert.noConflict=function(){return $.fn.alert=old,this},$(document).on("click.bs.alert.data-api",dismiss,Alert.prototype.close)}(jQuery),+function($){"use strict";function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.button"),options="object"==typeof option&&option;data||$this.data("bs.button",data=new Button(this,options)),"toggle"==option?data.toggle():option&&data.setState(option)})}var Button=function(element,options){this.$element=$(element),this.options=$.extend({},Button.DEFAULTS,options),this.isLoading=!1};Button.VERSION="3.3.5",Button.DEFAULTS={loadingText:"loading..."},Button.prototype.setState=function(state){var d="disabled",$el=this.$element,val=$el.is("input")?"val":"html",data=$el.data();state+="Text",null==data.resetText&&$el.data("resetText",$el[val]()),setTimeout($.proxy(function(){$el[val](null==data[state]?this.options[state]:data[state]),"loadingText"==state?(this.isLoading=!0,$el.addClass(d).attr(d,d)):this.isLoading&&(this.isLoading=!1,$el.removeClass(d).removeAttr(d))},this),0)},Button.prototype.toggle=function(){var changed=!0,$parent=this.$element.closest('[data-toggle="buttons"]');if($parent.length){var $input=this.$element.find("input");"radio"==$input.prop("type")?($input.prop("checked")&&(changed=!1),$parent.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==$input.prop("type")&&($input.prop("checked")!==this.$element.hasClass("active")&&(changed=!1),this.$element.toggleClass("active")),$input.prop("checked",this.$element.hasClass("active")),changed&&$input.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=Plugin,$.fn.button.Constructor=Button,$.fn.button.noConflict=function(){return $.fn.button=old,this},$(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(e){var $btn=$(e.target);$btn.hasClass("btn")||($btn=$btn.closest(".btn")),Plugin.call($btn,"toggle"),$(e.target).is('input[type="radio"]')||$(e.target).is('input[type="checkbox"]')||e.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){$(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery),+function($){"use strict";function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.carousel"),options=$.extend({},Carousel.DEFAULTS,$this.data(),"object"==typeof option&&option),action="string"==typeof option?option:options.slide;data||$this.data("bs.carousel",data=new Carousel(this,options)),"number"==typeof option?data.to(option):action?data[action]():options.interval&&data.pause().cycle()})}var Carousel=function(element,options){this.$element=$(element),this.$indicators=this.$element.find(".carousel-indicators"),this.options=options,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",$.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",$.proxy(this.pause,this)).on("mouseleave.bs.carousel",$.proxy(this.cycle,this))};Carousel.VERSION="3.3.5",Carousel.TRANSITION_DURATION=600,Carousel.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},Carousel.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},Carousel.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval)),this},Carousel.prototype.getItemIndex=function(item){return this.$items=item.parent().children(".item"),this.$items.index(item||this.$active)},Carousel.prototype.getItemForDirection=function(direction,active){var activeIndex=this.getItemIndex(active),willWrap="prev"==direction&&0===activeIndex||"next"==direction&&activeIndex==this.$items.length-1;if(willWrap&&!this.options.wrap)return active;var delta="prev"==direction?-1:1,itemIndex=(activeIndex+delta)%this.$items.length;return this.$items.eq(itemIndex)},Carousel.prototype.to=function(pos){var that=this,activeIndex=this.getItemIndex(this.$active=this.$element.find(".item.active"));return pos>this.$items.length-1||0>pos?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){that.to(pos)}):activeIndex==pos?this.pause().cycle():this.slide(pos>activeIndex?"next":"prev",this.$items.eq(pos))},Carousel.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&$.support.transition&&(this.$element.trigger($.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},Carousel.prototype.next=function(){return this.sliding?void 0:this.slide("next")},Carousel.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},Carousel.prototype.slide=function(type,next){var $active=this.$element.find(".item.active"),$next=next||this.getItemForDirection(type,$active),isCycling=this.interval,direction="next"==type?"left":"right",that=this;if($next.hasClass("active"))return this.sliding=!1;var relatedTarget=$next[0],slideEvent=$.Event("slide.bs.carousel",{relatedTarget:relatedTarget,direction:direction});if(this.$element.trigger(slideEvent),!slideEvent.isDefaultPrevented()){if(this.sliding=!0,isCycling&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var $nextIndicator=$(this.$indicators.children()[this.getItemIndex($next)]);$nextIndicator&&$nextIndicator.addClass("active")}var slidEvent=$.Event("slid.bs.carousel",{relatedTarget:relatedTarget,direction:direction});return $.support.transition&&this.$element.hasClass("slide")?($next.addClass(type),$next[0].offsetWidth,$active.addClass(direction),$next.addClass(direction),$active.one("bsTransitionEnd",function(){$next.removeClass([type,direction].join(" ")).addClass("active"),$active.removeClass(["active",direction].join(" ")),that.sliding=!1,setTimeout(function(){that.$element.trigger(slidEvent)},0)}).emulateTransitionEnd(Carousel.TRANSITION_DURATION)):($active.removeClass("active"),$next.addClass("active"),this.sliding=!1,this.$element.trigger(slidEvent)),isCycling&&this.cycle(),this}};var old=$.fn.carousel;$.fn.carousel=Plugin,$.fn.carousel.Constructor=Carousel,$.fn.carousel.noConflict=function(){return $.fn.carousel=old,this};var clickHandler=function(e){var href,$this=$(this),$target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""));if($target.hasClass("carousel")){var options=$.extend({},$target.data(),$this.data()),slideIndex=$this.attr("data-slide-to");slideIndex&&(options.interval=!1),Plugin.call($target,options),slideIndex&&$target.data("bs.carousel").to(slideIndex),e.preventDefault()}};$(document).on("click.bs.carousel.data-api","[data-slide]",clickHandler).on("click.bs.carousel.data-api","[data-slide-to]",clickHandler),$(window).on("load",function(){$('[data-ride="carousel"]').each(function(){var $carousel=$(this);Plugin.call($carousel,$carousel.data())})})}(jQuery),+function($){"use strict";function getTargetFromTrigger($trigger){var href,target=$trigger.attr("data-target")||(href=$trigger.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"");return $(target)}function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.collapse"),options=$.extend({},Collapse.DEFAULTS,$this.data(),"object"==typeof option&&option);!data&&options.toggle&&/show|hide/.test(option)&&(options.toggle=!1),data||$this.data("bs.collapse",data=new Collapse(this,options)),"string"==typeof option&&data[option]()})}var Collapse=function(element,options){this.$element=$(element),this.options=$.extend({},Collapse.DEFAULTS,options),this.$trigger=$('[data-toggle="collapse"][href="#'+element.id+'"],[data-toggle="collapse"][data-target="#'+element.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};Collapse.VERSION="3.3.5",Collapse.TRANSITION_DURATION=350,Collapse.DEFAULTS={toggle:!0},Collapse.prototype.dimension=function(){var hasWidth=this.$element.hasClass("width");return hasWidth?"width":"height"},Collapse.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var activesData,actives=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(actives&&actives.length&&(activesData=actives.data("bs.collapse"),activesData&&activesData.transitioning))){var startEvent=$.Event("show.bs.collapse");if(this.$element.trigger(startEvent),!startEvent.isDefaultPrevented()){actives&&actives.length&&(Plugin.call(actives,"hide"),activesData||actives.data("bs.collapse",null));var dimension=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[dimension](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var complete=function(){this.$element.removeClass("collapsing").addClass("collapse in")[dimension](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!$.support.transition)return complete.call(this);var scrollSize=$.camelCase(["scroll",dimension].join("-"));this.$element.one("bsTransitionEnd",$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])}}}},Collapse.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var startEvent=$.Event("hide.bs.collapse");if(this.$element.trigger(startEvent),!startEvent.isDefaultPrevented()){var dimension=this.dimension();this.$element[dimension](this.$element[dimension]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var complete=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return $.support.transition?void this.$element[dimension](0).one("bsTransitionEnd",$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION):complete.call(this)}}},Collapse.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},Collapse.prototype.getParent=function(){return $(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each($.proxy(function(i,element){var $element=$(element);this.addAriaAndCollapsedClass(getTargetFromTrigger($element),$element)},this)).end()},Collapse.prototype.addAriaAndCollapsedClass=function($element,$trigger){var isOpen=$element.hasClass("in");$element.attr("aria-expanded",isOpen),$trigger.toggleClass("collapsed",!isOpen).attr("aria-expanded",isOpen)};var old=$.fn.collapse;$.fn.collapse=Plugin,$.fn.collapse.Constructor=Collapse,$.fn.collapse.noConflict=function(){return $.fn.collapse=old,this},$(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(e){var $this=$(this);$this.attr("data-target")||e.preventDefault();var $target=getTargetFromTrigger($this),data=$target.data("bs.collapse"),option=data?"toggle":$this.data();Plugin.call($target,option)})}(jQuery),+function($){"use strict";function getParent($this){var selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&/#[A-Za-z]/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,""));var $parent=selector&&$(selector);return $parent&&$parent.length?$parent:$this.parent()}function clearMenus(e){e&&3===e.which||($(backdrop).remove(),$(toggle).each(function(){var $this=$(this),$parent=getParent($this),relatedTarget={relatedTarget:this};$parent.hasClass("open")&&(e&&"click"==e.type&&/input|textarea/i.test(e.target.tagName)&&$.contains($parent[0],e.target)||($parent.trigger(e=$.Event("hide.bs.dropdown",relatedTarget)),e.isDefaultPrevented()||($this.attr("aria-expanded","false"),$parent.removeClass("open").trigger("hidden.bs.dropdown",relatedTarget))))}))}function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.dropdown");data||$this.data("bs.dropdown",data=new Dropdown(this)),"string"==typeof option&&data[option].call($this)})}var backdrop=".dropdown-backdrop",toggle='[data-toggle="dropdown"]',Dropdown=function(element){$(element).on("click.bs.dropdown",this.toggle)};Dropdown.VERSION="3.3.5",Dropdown.prototype.toggle=function(e){var $this=$(this);if(!$this.is(".disabled, :disabled")){var $parent=getParent($this),isActive=$parent.hasClass("open");if(clearMenus(),!isActive){"ontouchstart"in document.documentElement&&!$parent.closest(".navbar-nav").length&&$(document.createElement("div")).addClass("dropdown-backdrop").insertAfter($(this)).on("click",clearMenus);var relatedTarget={relatedTarget:this};if($parent.trigger(e=$.Event("show.bs.dropdown",relatedTarget)),e.isDefaultPrevented())return;$this.trigger("focus").attr("aria-expanded","true"),$parent.toggleClass("open").trigger("shown.bs.dropdown",relatedTarget)}return!1}},Dropdown.prototype.keydown=function(e){if(/(38|40|27|32)/.test(e.which)&&!/input|textarea/i.test(e.target.tagName)){var $this=$(this);if(e.preventDefault(),e.stopPropagation(),!$this.is(".disabled, :disabled")){var $parent=getParent($this),isActive=$parent.hasClass("open");if(!isActive&&27!=e.which||isActive&&27==e.which)return 27==e.which&&$parent.find(toggle).trigger("focus"),$this.trigger("click");var desc=" li:not(.disabled):visible a",$items=$parent.find(".dropdown-menu"+desc);if($items.length){var index=$items.index(e.target);38==e.which&&index>0&&index--,40==e.which&&index<$items.length-1&&index++,~index||(index=0),$items.eq(index).trigger("focus")}}}};var old=$.fn.dropdown;$.fn.dropdown=Plugin,$.fn.dropdown.Constructor=Dropdown,$.fn.dropdown.noConflict=function(){return $.fn.dropdown=old,this},$(document).on("click.bs.dropdown.data-api",clearMenus).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",toggle,Dropdown.prototype.toggle).on("keydown.bs.dropdown.data-api",toggle,Dropdown.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",Dropdown.prototype.keydown)}(jQuery),+function($){"use strict";function Plugin(option,_relatedTarget){return this.each(function(){var $this=$(this),data=$this.data("bs.modal"),options=$.extend({},Modal.DEFAULTS,$this.data(),"object"==typeof option&&option);data||$this.data("bs.modal",data=new Modal(this,options)),"string"==typeof option?data[option](_relatedTarget):options.show&&data.show(_relatedTarget)})}var Modal=function(element,options){this.options=options,this.$body=$(document.body),this.$element=$(element),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,$.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};Modal.VERSION="3.3.5",Modal.TRANSITION_DURATION=300,Modal.BACKDROP_TRANSITION_DURATION=150,Modal.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},Modal.prototype.toggle=function(_relatedTarget){return this.isShown?this.hide():this.show(_relatedTarget)},Modal.prototype.show=function(_relatedTarget){var that=this,e=$.Event("show.bs.modal",{relatedTarget:_relatedTarget});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',$.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){that.$element.one("mouseup.dismiss.bs.modal",function(e){$(e.target).is(that.$element)&&(that.ignoreBackdropClick=!0)})}),this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass("fade");that.$element.parent().length||that.$element.appendTo(that.$body),that.$element.show().scrollTop(0),that.adjustDialog(),transition&&that.$element[0].offsetWidth,that.$element.addClass("in"),that.enforceFocus();var e=$.Event("shown.bs.modal",{relatedTarget:_relatedTarget});transition?that.$dialog.one("bsTransitionEnd",function(){that.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(Modal.TRANSITION_DURATION):that.$element.trigger("focus").trigger(e)}))},Modal.prototype.hide=function(e){e&&e.preventDefault(),e=$.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),$(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),$.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",$.proxy(this.hideModal,this)).emulateTransitionEnd(Modal.TRANSITION_DURATION):this.hideModal())},Modal.prototype.enforceFocus=function(){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(e){this.$element[0]===e.target||this.$element.has(e.target).length||this.$element.trigger("focus")},this))},Modal.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",$.proxy(function(e){27==e.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},Modal.prototype.resize=function(){this.isShown?$(window).on("resize.bs.modal",$.proxy(this.handleUpdate,this)):$(window).off("resize.bs.modal")},Modal.prototype.hideModal=function(){var that=this;this.$element.hide(),this.backdrop(function(){that.$body.removeClass("modal-open"),that.resetAdjustments(),that.resetScrollbar(),that.$element.trigger("hidden.bs.modal")})},Modal.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},Modal.prototype.backdrop=function(callback){var that=this,animate=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate;if(this.$backdrop=$(document.createElement("div")).addClass("modal-backdrop "+animate).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",$.proxy(function(e){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),doAnimate&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!callback)return;doAnimate?this.$backdrop.one("bsTransitionEnd",callback).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callback()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var callbackRemove=function(){that.removeBackdrop(),callback&&callback()};$.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",callbackRemove).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callbackRemove()}else callback&&callback()},Modal.prototype.handleUpdate=function(){this.adjustDialog()},Modal.prototype.adjustDialog=function(){var modalIsOverflowing=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&modalIsOverflowing?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!modalIsOverflowing?this.scrollbarWidth:""})},Modal.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},Modal.prototype.checkScrollbar=function(){var fullWindowWidth=window.innerWidth;if(!fullWindowWidth){var documentElementRect=document.documentElement.getBoundingClientRect();fullWindowWidth=documentElementRect.right-Math.abs(documentElementRect.left)}this.bodyIsOverflowing=document.body.clientWidth<fullWindowWidth,this.scrollbarWidth=this.measureScrollbar()},Modal.prototype.setScrollbar=function(){var bodyPad=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",bodyPad+this.scrollbarWidth)},Modal.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},Modal.prototype.measureScrollbar=function(){var scrollDiv=document.createElement("div");scrollDiv.className="modal-scrollbar-measure",this.$body.append(scrollDiv);var scrollbarWidth=scrollDiv.offsetWidth-scrollDiv.clientWidth;return this.$body[0].removeChild(scrollDiv),scrollbarWidth};var old=$.fn.modal;$.fn.modal=Plugin,$.fn.modal.Constructor=Modal,$.fn.modal.noConflict=function(){return $.fn.modal=old,this},$(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(e){var $this=$(this),href=$this.attr("href"),$target=$($this.attr("data-target")||href&&href.replace(/.*(?=#[^\s]+$)/,"")),option=$target.data("bs.modal")?"toggle":$.extend({remote:!/#/.test(href)&&href},$target.data(),$this.data());$this.is("a")&&e.preventDefault(),$target.one("show.bs.modal",function(showEvent){showEvent.isDefaultPrevented()||$target.one("hidden.bs.modal",function(){$this.is(":visible")&&$this.trigger("focus")})}),Plugin.call($target,option,this)})}(jQuery),+function($){"use strict";function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.tooltip"),options="object"==typeof option&&option;(data||!/destroy|hide/.test(option))&&(data||$this.data("bs.tooltip",data=new Tooltip(this,options)),"string"==typeof option&&data[option]())})}var Tooltip=function(element,options){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",element,options)};Tooltip.VERSION="3.3.5",Tooltip.TRANSITION_DURATION=150,Tooltip.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},Tooltip.prototype.init=function(type,element,options){if(this.enabled=!0,this.type=type,this.$element=$(element),this.options=this.getOptions(options),this.$viewport=this.options.viewport&&$($.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var triggers=this.options.trigger.split(" "),i=triggers.length;i--;){var trigger=triggers[i];if("click"==trigger)this.$element.on("click."+this.type,this.options.selector,$.proxy(this.toggle,this));else if("manual"!=trigger){var eventIn="hover"==trigger?"mouseenter":"focusin",eventOut="hover"==trigger?"mouseleave":"focusout";this.$element.on(eventIn+"."+this.type,this.options.selector,$.proxy(this.enter,this)),this.$element.on(eventOut+"."+this.type,this.options.selector,$.proxy(this.leave,this))}}this.options.selector?this._options=$.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},Tooltip.prototype.getDefaults=function(){return Tooltip.DEFAULTS},Tooltip.prototype.getOptions=function(options){return options=$.extend({},this.getDefaults(),this.$element.data(),options),options.delay&&"number"==typeof options.delay&&(options.delay={show:options.delay,hide:options.delay}),options},Tooltip.prototype.getDelegateOptions=function(){var options={},defaults=this.getDefaults();return this._options&&$.each(this._options,function(key,value){defaults[key]!=value&&(options[key]=value)}),options},Tooltip.prototype.enter=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data("bs."+this.type);return self||(self=new this.constructor(obj.currentTarget,this.getDelegateOptions()),$(obj.currentTarget).data("bs."+this.type,self)),obj instanceof $.Event&&(self.inState["focusin"==obj.type?"focus":"hover"]=!0),self.tip().hasClass("in")||"in"==self.hoverState?void(self.hoverState="in"):(clearTimeout(self.timeout),self.hoverState="in",self.options.delay&&self.options.delay.show?void(self.timeout=setTimeout(function(){"in"==self.hoverState&&self.show()},self.options.delay.show)):self.show())},Tooltip.prototype.isInStateTrue=function(){for(var key in this.inState)if(this.inState[key])return!0;return!1},Tooltip.prototype.leave=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data("bs."+this.type);return self||(self=new this.constructor(obj.currentTarget,this.getDelegateOptions()),$(obj.currentTarget).data("bs."+this.type,self)),obj instanceof $.Event&&(self.inState["focusout"==obj.type?"focus":"hover"]=!1),self.isInStateTrue()?void 0:(clearTimeout(self.timeout),self.hoverState="out",self.options.delay&&self.options.delay.hide?void(self.timeout=setTimeout(function(){"out"==self.hoverState&&self.hide()},self.options.delay.hide)):self.hide())},Tooltip.prototype.show=function(){var e=$.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var inDom=$.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!inDom)return;var that=this,$tip=this.tip(),tipId=this.getUID(this.type);this.setContent(),$tip.attr("id",tipId),this.$element.attr("aria-describedby",tipId),this.options.animation&&$tip.addClass("fade");var placement="function"==typeof this.options.placement?this.options.placement.call(this,$tip[0],this.$element[0]):this.options.placement,autoToken=/\s?auto?\s?/i,autoPlace=autoToken.test(placement);autoPlace&&(placement=placement.replace(autoToken,"")||"top"),$tip.detach().css({top:0,left:0,display:"block"}).addClass(placement).data("bs."+this.type,this),this.options.container?$tip.appendTo(this.options.container):$tip.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var pos=this.getPosition(),actualWidth=$tip[0].offsetWidth,actualHeight=$tip[0].offsetHeight;if(autoPlace){var orgPlacement=placement,viewportDim=this.getPosition(this.$viewport);placement="bottom"==placement&&pos.bottom+actualHeight>viewportDim.bottom?"top":"top"==placement&&pos.top-actualHeight<viewportDim.top?"bottom":"right"==placement&&pos.right+actualWidth>viewportDim.width?"left":"left"==placement&&pos.left-actualWidth<viewportDim.left?"right":placement,$tip.removeClass(orgPlacement).addClass(placement)}var calculatedOffset=this.getCalculatedOffset(placement,pos,actualWidth,actualHeight);this.applyPlacement(calculatedOffset,placement);var complete=function(){var prevHoverState=that.hoverState;that.$element.trigger("shown.bs."+that.type),that.hoverState=null,"out"==prevHoverState&&that.leave(that)};$.support.transition&&this.$tip.hasClass("fade")?$tip.one("bsTransitionEnd",complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete()}},Tooltip.prototype.applyPlacement=function(offset,placement){var $tip=this.tip(),width=$tip[0].offsetWidth,height=$tip[0].offsetHeight,marginTop=parseInt($tip.css("margin-top"),10),marginLeft=parseInt($tip.css("margin-left"),10);isNaN(marginTop)&&(marginTop=0),isNaN(marginLeft)&&(marginLeft=0),offset.top+=marginTop,offset.left+=marginLeft,$.offset.setOffset($tip[0],$.extend({using:function(props){$tip.css({top:Math.round(props.top),left:Math.round(props.left)})}},offset),0),$tip.addClass("in");var actualWidth=$tip[0].offsetWidth,actualHeight=$tip[0].offsetHeight;"top"==placement&&actualHeight!=height&&(offset.top=offset.top+height-actualHeight);var delta=this.getViewportAdjustedDelta(placement,offset,actualWidth,actualHeight);delta.left?offset.left+=delta.left:offset.top+=delta.top;var isVertical=/top|bottom/.test(placement),arrowDelta=isVertical?2*delta.left-width+actualWidth:2*delta.top-height+actualHeight,arrowOffsetPosition=isVertical?"offsetWidth":"offsetHeight";$tip.offset(offset),this.replaceArrow(arrowDelta,$tip[0][arrowOffsetPosition],isVertical)},Tooltip.prototype.replaceArrow=function(delta,dimension,isVertical){this.arrow().css(isVertical?"left":"top",50*(1-delta/dimension)+"%").css(isVertical?"top":"left","")},Tooltip.prototype.setContent=function(){var $tip=this.tip(),title=this.getTitle();$tip.find(".tooltip-inner")[this.options.html?"html":"text"](title),$tip.removeClass("fade in top bottom left right")},Tooltip.prototype.hide=function(callback){function complete(){"in"!=that.hoverState&&$tip.detach(),that.$element.removeAttr("aria-describedby").trigger("hidden.bs."+that.type),callback&&callback()}var that=this,$tip=$(this.$tip),e=$.Event("hide.bs."+this.type);return this.$element.trigger(e),e.isDefaultPrevented()?void 0:($tip.removeClass("in"),$.support.transition&&$tip.hasClass("fade")?$tip.one("bsTransitionEnd",complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete(),this.hoverState=null,this)},Tooltip.prototype.fixTitle=function(){var $e=this.$element;($e.attr("title")||"string"!=typeof $e.attr("data-original-title"))&&$e.attr("data-original-title",$e.attr("title")||"").attr("title","")},Tooltip.prototype.hasContent=function(){return this.getTitle()},Tooltip.prototype.getPosition=function($element){$element=$element||this.$element;var el=$element[0],isBody="BODY"==el.tagName,elRect=el.getBoundingClientRect();null==elRect.width&&(elRect=$.extend({},elRect,{width:elRect.right-elRect.left,height:elRect.bottom-elRect.top}));var elOffset=isBody?{top:0,left:0}:$element.offset(),scroll={scroll:isBody?document.documentElement.scrollTop||document.body.scrollTop:$element.scrollTop()
},outerDims=isBody?{width:$(window).width(),height:$(window).height()}:null;return $.extend({},elRect,scroll,outerDims,elOffset)},Tooltip.prototype.getCalculatedOffset=function(placement,pos,actualWidth,actualHeight){return"bottom"==placement?{top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}:"top"==placement?{top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2}:"left"==placement?{top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth}:{top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width}},Tooltip.prototype.getViewportAdjustedDelta=function(placement,pos,actualWidth,actualHeight){var delta={top:0,left:0};if(!this.$viewport)return delta;var viewportPadding=this.options.viewport&&this.options.viewport.padding||0,viewportDimensions=this.getPosition(this.$viewport);if(/right|left/.test(placement)){var topEdgeOffset=pos.top-viewportPadding-viewportDimensions.scroll,bottomEdgeOffset=pos.top+viewportPadding-viewportDimensions.scroll+actualHeight;topEdgeOffset<viewportDimensions.top?delta.top=viewportDimensions.top-topEdgeOffset:bottomEdgeOffset>viewportDimensions.top+viewportDimensions.height&&(delta.top=viewportDimensions.top+viewportDimensions.height-bottomEdgeOffset)}else{var leftEdgeOffset=pos.left-viewportPadding,rightEdgeOffset=pos.left+viewportPadding+actualWidth;leftEdgeOffset<viewportDimensions.left?delta.left=viewportDimensions.left-leftEdgeOffset:rightEdgeOffset>viewportDimensions.right&&(delta.left=viewportDimensions.left+viewportDimensions.width-rightEdgeOffset)}return delta},Tooltip.prototype.getTitle=function(){var title,$e=this.$element,o=this.options;return title=$e.attr("data-original-title")||("function"==typeof o.title?o.title.call($e[0]):o.title)},Tooltip.prototype.getUID=function(prefix){do prefix+=~~(1e6*Math.random());while(document.getElementById(prefix));return prefix},Tooltip.prototype.tip=function(){if(!this.$tip&&(this.$tip=$(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},Tooltip.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},Tooltip.prototype.enable=function(){this.enabled=!0},Tooltip.prototype.disable=function(){this.enabled=!1},Tooltip.prototype.toggleEnabled=function(){this.enabled=!this.enabled},Tooltip.prototype.toggle=function(e){var self=this;e&&(self=$(e.currentTarget).data("bs."+this.type),self||(self=new this.constructor(e.currentTarget,this.getDelegateOptions()),$(e.currentTarget).data("bs."+this.type,self))),e?(self.inState.click=!self.inState.click,self.isInStateTrue()?self.enter(self):self.leave(self)):self.tip().hasClass("in")?self.leave(self):self.enter(self)},Tooltip.prototype.destroy=function(){var that=this;clearTimeout(this.timeout),this.hide(function(){that.$element.off("."+that.type).removeData("bs."+that.type),that.$tip&&that.$tip.detach(),that.$tip=null,that.$arrow=null,that.$viewport=null})};var old=$.fn.tooltip;$.fn.tooltip=Plugin,$.fn.tooltip.Constructor=Tooltip,$.fn.tooltip.noConflict=function(){return $.fn.tooltip=old,this}}(jQuery),+function($){"use strict";function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.popover"),options="object"==typeof option&&option;(data||!/destroy|hide/.test(option))&&(data||$this.data("bs.popover",data=new Popover(this,options)),"string"==typeof option&&data[option]())})}var Popover=function(element,options){this.init("popover",element,options)};if(!$.fn.tooltip)throw new Error("Popover requires tooltip.js");Popover.VERSION="3.3.5",Popover.DEFAULTS=$.extend({},$.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),Popover.prototype=$.extend({},$.fn.tooltip.Constructor.prototype),Popover.prototype.constructor=Popover,Popover.prototype.getDefaults=function(){return Popover.DEFAULTS},Popover.prototype.setContent=function(){var $tip=this.tip(),title=this.getTitle(),content=this.getContent();$tip.find(".popover-title")[this.options.html?"html":"text"](title),$tip.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof content?"html":"append":"text"](content),$tip.removeClass("fade top bottom left right in"),$tip.find(".popover-title").html()||$tip.find(".popover-title").hide()},Popover.prototype.hasContent=function(){return this.getTitle()||this.getContent()},Popover.prototype.getContent=function(){var $e=this.$element,o=this.options;return $e.attr("data-content")||("function"==typeof o.content?o.content.call($e[0]):o.content)},Popover.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var old=$.fn.popover;$.fn.popover=Plugin,$.fn.popover.Constructor=Popover,$.fn.popover.noConflict=function(){return $.fn.popover=old,this}}(jQuery),+function($){"use strict";function ScrollSpy(element,options){this.$body=$(document.body),this.$scrollElement=$($(element).is(document.body)?window:element),this.options=$.extend({},ScrollSpy.DEFAULTS,options),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",$.proxy(this.process,this)),this.refresh(),this.process()}function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.scrollspy"),options="object"==typeof option&&option;data||$this.data("bs.scrollspy",data=new ScrollSpy(this,options)),"string"==typeof option&&data[option]()})}ScrollSpy.VERSION="3.3.5",ScrollSpy.DEFAULTS={offset:10},ScrollSpy.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},ScrollSpy.prototype.refresh=function(){var that=this,offsetMethod="offset",offsetBase=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),$.isWindow(this.$scrollElement[0])||(offsetMethod="position",offsetBase=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var $el=$(this),href=$el.data("target")||$el.attr("href"),$href=/^#./.test(href)&&$(href);return $href&&$href.length&&$href.is(":visible")&&[[$href[offsetMethod]().top+offsetBase,href]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){that.offsets.push(this[0]),that.targets.push(this[1])})},ScrollSpy.prototype.process=function(){var i,scrollTop=this.$scrollElement.scrollTop()+this.options.offset,scrollHeight=this.getScrollHeight(),maxScroll=this.options.offset+scrollHeight-this.$scrollElement.height(),offsets=this.offsets,targets=this.targets,activeTarget=this.activeTarget;if(this.scrollHeight!=scrollHeight&&this.refresh(),scrollTop>=maxScroll)return activeTarget!=(i=targets[targets.length-1])&&this.activate(i);if(activeTarget&&scrollTop<offsets[0])return this.activeTarget=null,this.clear();for(i=offsets.length;i--;)activeTarget!=targets[i]&&scrollTop>=offsets[i]&&(void 0===offsets[i+1]||scrollTop<offsets[i+1])&&this.activate(targets[i])},ScrollSpy.prototype.activate=function(target){this.activeTarget=target,this.clear();var selector=this.selector+'[data-target="'+target+'"],'+this.selector+'[href="'+target+'"]',active=$(selector).parents("li").addClass("active");active.parent(".dropdown-menu").length&&(active=active.closest("li.dropdown").addClass("active")),active.trigger("activate.bs.scrollspy")},ScrollSpy.prototype.clear=function(){$(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var old=$.fn.scrollspy;$.fn.scrollspy=Plugin,$.fn.scrollspy.Constructor=ScrollSpy,$.fn.scrollspy.noConflict=function(){return $.fn.scrollspy=old,this},$(window).on("load.bs.scrollspy.data-api",function(){$('[data-spy="scroll"]').each(function(){var $spy=$(this);Plugin.call($spy,$spy.data())})})}(jQuery),+function($){"use strict";function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.tab");data||$this.data("bs.tab",data=new Tab(this)),"string"==typeof option&&data[option]()})}var Tab=function(element){this.element=$(element)};Tab.VERSION="3.3.5",Tab.TRANSITION_DURATION=150,Tab.prototype.show=function(){var $this=this.element,$ul=$this.closest("ul:not(.dropdown-menu)"),selector=$this.data("target");if(selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")),!$this.parent("li").hasClass("active")){var $previous=$ul.find(".active:last a"),hideEvent=$.Event("hide.bs.tab",{relatedTarget:$this[0]}),showEvent=$.Event("show.bs.tab",{relatedTarget:$previous[0]});if($previous.trigger(hideEvent),$this.trigger(showEvent),!showEvent.isDefaultPrevented()&&!hideEvent.isDefaultPrevented()){var $target=$(selector);this.activate($this.closest("li"),$ul),this.activate($target,$target.parent(),function(){$previous.trigger({type:"hidden.bs.tab",relatedTarget:$this[0]}),$this.trigger({type:"shown.bs.tab",relatedTarget:$previous[0]})})}}},Tab.prototype.activate=function(element,container,callback){function next(){$active.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),element.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),transition?(element[0].offsetWidth,element.addClass("in")):element.removeClass("fade"),element.parent(".dropdown-menu").length&&element.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),callback&&callback()}var $active=container.find("> .active"),transition=callback&&$.support.transition&&($active.length&&$active.hasClass("fade")||!!container.find("> .fade").length);$active.length&&transition?$active.one("bsTransitionEnd",next).emulateTransitionEnd(Tab.TRANSITION_DURATION):next(),$active.removeClass("in")};var old=$.fn.tab;$.fn.tab=Plugin,$.fn.tab.Constructor=Tab,$.fn.tab.noConflict=function(){return $.fn.tab=old,this};var clickHandler=function(e){e.preventDefault(),Plugin.call($(this),"show")};$(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',clickHandler).on("click.bs.tab.data-api",'[data-toggle="pill"]',clickHandler)}(jQuery),+function($){"use strict";function Plugin(option){return this.each(function(){var $this=$(this),data=$this.data("bs.affix"),options="object"==typeof option&&option;data||$this.data("bs.affix",data=new Affix(this,options)),"string"==typeof option&&data[option]()})}var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options),this.$target=$(this.options.target).on("scroll.bs.affix.data-api",$.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",$.proxy(this.checkPositionWithEventLoop,this)),this.$element=$(element),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};Affix.VERSION="3.3.5",Affix.RESET="affix affix-top affix-bottom",Affix.DEFAULTS={offset:0,target:window},Affix.prototype.getState=function(scrollHeight,height,offsetTop,offsetBottom){var scrollTop=this.$target.scrollTop(),position=this.$element.offset(),targetHeight=this.$target.height();if(null!=offsetTop&&"top"==this.affixed)return offsetTop>scrollTop?"top":!1;if("bottom"==this.affixed)return null!=offsetTop?scrollTop+this.unpin<=position.top?!1:"bottom":scrollHeight-offsetBottom>=scrollTop+targetHeight?!1:"bottom";var initializing=null==this.affixed,colliderTop=initializing?scrollTop:position.top,colliderHeight=initializing?targetHeight:height;return null!=offsetTop&&offsetTop>=scrollTop?"top":null!=offsetBottom&&colliderTop+colliderHeight>=scrollHeight-offsetBottom?"bottom":!1},Affix.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(Affix.RESET).addClass("affix");var scrollTop=this.$target.scrollTop(),position=this.$element.offset();return this.pinnedOffset=position.top-scrollTop},Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)},Affix.prototype.checkPosition=function(){if(this.$element.is(":visible")){var height=this.$element.height(),offset=this.options.offset,offsetTop=offset.top,offsetBottom=offset.bottom,scrollHeight=Math.max($(document).height(),$(document.body).height());"object"!=typeof offset&&(offsetBottom=offsetTop=offset),"function"==typeof offsetTop&&(offsetTop=offset.top(this.$element)),"function"==typeof offsetBottom&&(offsetBottom=offset.bottom(this.$element));var affix=this.getState(scrollHeight,height,offsetTop,offsetBottom);if(this.affixed!=affix){null!=this.unpin&&this.$element.css("top","");var affixType="affix"+(affix?"-"+affix:""),e=$.Event(affixType+".bs.affix");if(this.$element.trigger(e),e.isDefaultPrevented())return;this.affixed=affix,this.unpin="bottom"==affix?this.getPinnedOffset():null,this.$element.removeClass(Affix.RESET).addClass(affixType).trigger(affixType.replace("affix","affixed")+".bs.affix")}"bottom"==affix&&this.$element.offset({top:scrollHeight-height-offsetBottom})}};var old=$.fn.affix;$.fn.affix=Plugin,$.fn.affix.Constructor=Affix,$.fn.affix.noConflict=function(){return $.fn.affix=old,this},$(window).on("load",function(){$('[data-spy="affix"]').each(function(){var $spy=$(this),data=$spy.data();data.offset=data.offset||{},null!=data.offsetBottom&&(data.offset.bottom=data.offsetBottom),null!=data.offsetTop&&(data.offset.top=data.offsetTop),Plugin.call($spy,data)})})}(jQuery),function(window,angular,undefined){"use strict";function $RouteProvider(){function inherit(parent,extra){return angular.extend(Object.create(parent),extra)}function pathRegExp(path,opts){var insensitive=opts.caseInsensitiveMatch,ret={originalPath:path,regexp:path},keys=ret.keys=[];return path=path.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(_,slash,key,option){var optional="?"===option?option:null,star="*"===option?option:null;return keys.push({name:key,optional:!!optional}),slash=slash||"",""+(optional?"":slash)+"(?:"+(optional?slash:"")+(star&&"(.+?)"||"([^/]+)")+(optional||"")+")"+(optional||"")}).replace(/([\/$\*])/g,"\\$1"),ret.regexp=new RegExp("^"+path+"$",insensitive?"i":""),ret}var routes={};this.when=function(path,route){var routeCopy=angular.copy(route);if(angular.isUndefined(routeCopy.reloadOnSearch)&&(routeCopy.reloadOnSearch=!0),angular.isUndefined(routeCopy.caseInsensitiveMatch)&&(routeCopy.caseInsensitiveMatch=this.caseInsensitiveMatch),routes[path]=angular.extend(routeCopy,path&&pathRegExp(path,routeCopy)),path){var redirectPath="/"==path[path.length-1]?path.substr(0,path.length-1):path+"/";routes[redirectPath]=angular.extend({redirectTo:path},pathRegExp(redirectPath,routeCopy))}return this},this.caseInsensitiveMatch=!1,this.otherwise=function(params){return"string"==typeof params&&(params={redirectTo:params}),this.when(null,params),this},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce",function($rootScope,$location,$routeParams,$q,$injector,$templateRequest,$sce){function switchRouteMatcher(on,route){var keys=route.keys,params={};if(!route.regexp)return null;var m=route.regexp.exec(on);if(!m)return null;for(var i=1,len=m.length;len>i;++i){var key=keys[i-1],val=m[i];key&&val&&(params[key.name]=val)}return params}function prepareRoute($locationEvent){var lastRoute=$route.current;preparedRoute=parseRoute(),preparedRouteIsUpdateOnly=preparedRoute&&lastRoute&&preparedRoute.$$route===lastRoute.$$route&&angular.equals(preparedRoute.pathParams,lastRoute.pathParams)&&!preparedRoute.reloadOnSearch&&!forceReload,preparedRouteIsUpdateOnly||!lastRoute&&!preparedRoute||$rootScope.$broadcast("$routeChangeStart",preparedRoute,lastRoute).defaultPrevented&&$locationEvent&&$locationEvent.preventDefault()}function commitRoute(){var lastRoute=$route.current,nextRoute=preparedRoute;preparedRouteIsUpdateOnly?(lastRoute.params=nextRoute.params,angular.copy(lastRoute.params,$routeParams),$rootScope.$broadcast("$routeUpdate",lastRoute)):(nextRoute||lastRoute)&&(forceReload=!1,$route.current=nextRoute,nextRoute&&nextRoute.redirectTo&&(angular.isString(nextRoute.redirectTo)?$location.path(interpolate(nextRoute.redirectTo,nextRoute.params)).search(nextRoute.params).replace():$location.url(nextRoute.redirectTo(nextRoute.pathParams,$location.path(),$location.search())).replace()),$q.when(nextRoute).then(function(){if(nextRoute){var template,templateUrl,locals=angular.extend({},nextRoute.resolve);return angular.forEach(locals,function(value,key){locals[key]=angular.isString(value)?$injector.get(value):$injector.invoke(value,null,null,key)}),angular.isDefined(template=nextRoute.template)?angular.isFunction(template)&&(template=template(nextRoute.params)):angular.isDefined(templateUrl=nextRoute.templateUrl)&&(angular.isFunction(templateUrl)&&(templateUrl=templateUrl(nextRoute.params)),angular.isDefined(templateUrl)&&(nextRoute.loadedTemplateUrl=$sce.valueOf(templateUrl),template=$templateRequest(templateUrl))),angular.isDefined(template)&&(locals.$template=template),$q.all(locals)}}).then(function(locals){nextRoute==$route.current&&(nextRoute&&(nextRoute.locals=locals,angular.copy(nextRoute.params,$routeParams)),$rootScope.$broadcast("$routeChangeSuccess",nextRoute,lastRoute))},function(error){nextRoute==$route.current&&$rootScope.$broadcast("$routeChangeError",nextRoute,lastRoute,error)}))}function parseRoute(){var params,match;return angular.forEach(routes,function(route,path){!match&&(params=switchRouteMatcher($location.path(),route))&&(match=inherit(route,{params:angular.extend({},$location.search(),params),pathParams:params}),match.$$route=route)}),match||routes[null]&&inherit(routes[null],{params:{},pathParams:{}})}function interpolate(string,params){var result=[];return angular.forEach((string||"").split(":"),function(segment,i){if(0===i)result.push(segment);else{var segmentMatch=segment.match(/(\w+)(?:[?*])?(.*)/),key=segmentMatch[1];result.push(params[key]),result.push(segmentMatch[2]||""),delete params[key]}}),result.join("")}var preparedRoute,preparedRouteIsUpdateOnly,forceReload=!1,$route={routes:routes,reload:function(){forceReload=!0,$rootScope.$evalAsync(function(){prepareRoute(),commitRoute()})},updateParams:function(newParams){if(!this.current||!this.current.$$route)throw $routeMinErr("norout","Tried updating route when with no current route");newParams=angular.extend({},this.current.params,newParams),$location.path(interpolate(this.current.$$route.originalPath,newParams)),$location.search(newParams)}};return $rootScope.$on("$locationChangeStart",prepareRoute),$rootScope.$on("$locationChangeSuccess",commitRoute),$route}]}function $RouteParamsProvider(){this.$get=function(){return{}}}function ngViewFactory($route,$anchorScroll,$animate){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(scope,$element,attr,ctrl,$transclude){function cleanupLastView(){previousLeaveAnimation&&($animate.cancel(previousLeaveAnimation),previousLeaveAnimation=null),currentScope&&(currentScope.$destroy(),currentScope=null),currentElement&&(previousLeaveAnimation=$animate.leave(currentElement),previousLeaveAnimation.then(function(){previousLeaveAnimation=null}),currentElement=null)}function update(){var locals=$route.current&&$route.current.locals,template=locals&&locals.$template;if(angular.isDefined(template)){var newScope=scope.$new(),current=$route.current,clone=$transclude(newScope,function(clone){$animate.enter(clone,null,currentElement||$element).then(function(){!angular.isDefined(autoScrollExp)||autoScrollExp&&!scope.$eval(autoScrollExp)||$anchorScroll()}),cleanupLastView()});currentElement=clone,currentScope=current.scope=newScope,currentScope.$emit("$viewContentLoaded"),currentScope.$eval(onloadExp)}else cleanupLastView()}var currentScope,currentElement,previousLeaveAnimation,autoScrollExp=attr.autoscroll,onloadExp=attr.onload||"";scope.$on("$routeChangeSuccess",update),update()}}}function ngViewFillContentFactory($compile,$controller,$route){return{restrict:"ECA",priority:-400,link:function(scope,$element){var current=$route.current,locals=current.locals;$element.html(locals.$template);var link=$compile($element.contents());if(current.controller){locals.$scope=scope;var controller=$controller(current.controller,locals);current.controllerAs&&(scope[current.controllerAs]=controller),$element.data("$ngControllerController",controller),$element.children().data("$ngControllerController",controller)}link(scope)}}}var ngRouteModule=angular.module("ngRoute",["ng"]).provider("$route",$RouteProvider),$routeMinErr=angular.$$minErr("ngRoute");ngRouteModule.provider("$routeParams",$RouteParamsProvider),ngRouteModule.directive("ngView",ngViewFactory),ngRouteModule.directive("ngView",ngViewFillContentFactory),ngViewFactory.$inject=["$route","$anchorScroll","$animate"],ngViewFillContentFactory.$inject=["$compile","$controller","$route"]}(window,window.angular),function(window,angular,undefined){"use strict";function $$CookieWriter($document,$log,$browser){function buildCookieString(name,value,options){var path,expires;options=options||{},expires=options.expires,path=angular.isDefined(options.path)?options.path:cookiePath,angular.isUndefined(value)&&(expires="Thu, 01 Jan 1970 00:00:00 GMT",value=""),angular.isString(expires)&&(expires=new Date(expires));var str=encodeURIComponent(name)+"="+encodeURIComponent(value);str+=path?";path="+path:"",str+=options.domain?";domain="+options.domain:"",str+=expires?";expires="+expires.toUTCString():"",str+=options.secure?";secure":"";var cookieLength=str.length+1;return cookieLength>4096&&$log.warn("Cookie '"+name+"' possibly not set or overflowed because it was too large ("+cookieLength+" > 4096 bytes)!"),str}var cookiePath=$browser.baseHref(),rawDocument=$document[0];return function(name,value,options){rawDocument.cookie=buildCookieString(name,value,options)}}angular.module("ngCookies",["ng"]).provider("$cookies",[function(){function calcOptions(options){return options?angular.extend({},defaults,options):defaults}var defaults=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function($$cookieReader,$$cookieWriter){return{get:function(key){return $$cookieReader()[key]},getObject:function(key){var value=this.get(key);return value?angular.fromJson(value):value},getAll:function(){return $$cookieReader()},put:function(key,value,options){$$cookieWriter(key,value,calcOptions(options))},putObject:function(key,value,options){this.put(key,angular.toJson(value),options)},remove:function(key,options){$$cookieWriter(key,undefined,calcOptions(options))}}}]}]),angular.module("ngCookies").factory("$cookieStore",["$cookies",function($cookies){return{get:function(key){return $cookies.getObject(key)},put:function(key,value){$cookies.putObject(key,value)},remove:function(key){$cookies.remove(key)}}}]),$$CookieWriter.$inject=["$document","$log","$browser"],angular.module("ngCookies").provider("$$cookieWriter",function(){this.$get=$$CookieWriter})}(window,window.angular),function(window,angular,undefined){"use strict";function isValidDottedPath(path){return null!=path&&""!==path&&"hasOwnProperty"!==path&&MEMBER_NAME_REGEX.test("."+path)}function lookupDottedPath(obj,path){if(!isValidDottedPath(path))throw $resourceMinErr("badmember",'Dotted member path "@{0}" is invalid.',path);for(var keys=path.split("."),i=0,ii=keys.length;ii>i&&angular.isDefined(obj);i++){var key=keys[i];obj=null!==obj?obj[key]:undefined}return obj}function shallowClearAndCopy(src,dst){dst=dst||{},angular.forEach(dst,function(value,key){delete dst[key]});for(var key in src)!src.hasOwnProperty(key)||"$"===key.charAt(0)&&"$"===key.charAt(1)||(dst[key]=src[key]);return dst}var $resourceMinErr=angular.$$minErr("$resource"),MEMBER_NAME_REGEX=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;angular.module("ngResource",["ng"]).provider("$resource",function(){var PROTOCOL_AND_DOMAIN_REGEX=/^https?:\/\/[^\/]*/,provider=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}},this.$get=["$http","$q",function($http,$q){function encodeUriSegment(val){return encodeUriQuery(val,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function encodeUriQuery(val,pctEncodeSpaces){return encodeURIComponent(val).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,pctEncodeSpaces?"%20":"+")}function Route(template,defaults){this.template=template,this.defaults=extend({},provider.defaults,defaults),this.urlParams={}}function resourceFactory(url,paramDefaults,actions,options){function extractParams(data,actionParams){var ids={};return actionParams=extend({},paramDefaults,actionParams),forEach(actionParams,function(value,key){isFunction(value)&&(value=value()),ids[key]=value&&value.charAt&&"@"==value.charAt(0)?lookupDottedPath(data,value.substr(1)):value}),ids}function defaultResponseInterceptor(response){return response.resource}function Resource(value){shallowClearAndCopy(value||{},this)}var route=new Route(url,options);return actions=extend({},provider.defaults.actions,actions),Resource.prototype.toJSON=function(){var data=extend({},this);return delete data.$promise,delete data.$resolved,data},forEach(actions,function(action,name){var hasBody=/^(POST|PUT|PATCH)$/i.test(action.method);Resource[name]=function(a1,a2,a3,a4){var data,success,error,params={};switch(arguments.length){case 4:error=a4,success=a3;case 3:case 2:if(!isFunction(a2)){params=a1,data=a2,success=a3;break}if(isFunction(a1)){success=a1,error=a2;break}success=a2,error=a3;case 1:isFunction(a1)?success=a1:hasBody?data=a1:params=a1;break;case 0:break;default:throw $resourceMinErr("badargs","Expected up to 4 arguments [params, data, success, error], got {0} arguments",arguments.length)}var isInstanceCall=this instanceof Resource,value=isInstanceCall?data:action.isArray?[]:new Resource(data),httpConfig={},responseInterceptor=action.interceptor&&action.interceptor.response||defaultResponseInterceptor,responseErrorInterceptor=action.interceptor&&action.interceptor.responseError||undefined;forEach(action,function(value,key){"params"!=key&&"isArray"!=key&&"interceptor"!=key&&(httpConfig[key]=copy(value))}),hasBody&&(httpConfig.data=data),route.setUrlParams(httpConfig,extend({},extractParams(data,action.params||{}),params),action.url);var promise=$http(httpConfig).then(function(response){var data=response.data,promise=value.$promise;if(data){if(angular.isArray(data)!==!!action.isArray)throw $resourceMinErr("badcfg","Error in resource configuration for action `{0}`. Expected response to contain an {1} but got an {2} (Request: {3} {4})",name,action.isArray?"array":"object",angular.isArray(data)?"array":"object",httpConfig.method,httpConfig.url);action.isArray?(value.length=0,forEach(data,function(item){"object"==typeof item?value.push(new Resource(item)):value.push(item)})):(shallowClearAndCopy(data,value),value.$promise=promise)}return value.$resolved=!0,response.resource=value,response},function(response){return value.$resolved=!0,(error||noop)(response),$q.reject(response)});return promise=promise.then(function(response){var value=responseInterceptor(response);return(success||noop)(value,response.headers),value},responseErrorInterceptor),isInstanceCall?promise:(value.$promise=promise,value.$resolved=!1,value)},Resource.prototype["$"+name]=function(params,success,error){isFunction(params)&&(error=success,success=params,params={});var result=Resource[name].call(this,params,this,success,error);return result.$promise||result}}),Resource.bind=function(additionalParamDefaults){return resourceFactory(url,extend({},paramDefaults,additionalParamDefaults),actions)},Resource}var noop=angular.noop,forEach=angular.forEach,extend=angular.extend,copy=angular.copy,isFunction=angular.isFunction;return Route.prototype={setUrlParams:function(config,params,actionUrl){var val,encodedVal,self=this,url=actionUrl||self.template,protocolAndDomain="",urlParams=self.urlParams={};forEach(url.split(/\W/),function(param){if("hasOwnProperty"===param)throw $resourceMinErr("badname","hasOwnProperty is not a valid parameter name.");!new RegExp("^\\d+$").test(param)&&param&&new RegExp("(^|[^\\\\]):"+param+"(\\W|$)").test(url)&&(urlParams[param]=!0)}),url=url.replace(/\\:/g,":"),url=url.replace(PROTOCOL_AND_DOMAIN_REGEX,function(match){return protocolAndDomain=match,""}),params=params||{},forEach(self.urlParams,function(_,urlParam){val=params.hasOwnProperty(urlParam)?params[urlParam]:self.defaults[urlParam],angular.isDefined(val)&&null!==val?(encodedVal=encodeUriSegment(val),url=url.replace(new RegExp(":"+urlParam+"(\\W|$)","g"),function(match,p1){return encodedVal+p1})):url=url.replace(new RegExp("(/?):"+urlParam+"(\\W|$)","g"),function(match,leadingSlashes,tail){return"/"==tail.charAt(0)?tail:leadingSlashes+tail})}),self.defaults.stripTrailingSlashes&&(url=url.replace(/\/+$/,"")||"/"),url=url.replace(/\/\.(?=\w+($|\?))/,"."),config.url=protocolAndDomain+url.replace(/\/\\\./,"/."),forEach(params,function(value,key){self.urlParams[key]||(config.params=config.params||{},config.params[key]=value)})}},resourceFactory}]})}(window,window.angular),angular.module("ui.bootstrap",["ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.transition","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.collapse",[]).directive("collapse",["$animate",function($animate){return{link:function(scope,element,attrs){function expand(){element.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),$animate.addClass(element,"in",{to:{height:element[0].scrollHeight+"px"}}).then(expandDone)}function expandDone(){element.removeClass("collapsing"),element.css({height:"auto"})}function collapse(){return element.hasClass("collapse")||element.hasClass("in")?(element.css({height:element[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),void $animate.removeClass(element,"in",{to:{height:"0"}}).then(collapseDone)):collapseDone()}function collapseDone(){element.css({height:"0"}),element.removeClass("collapsing"),element.addClass("collapse")}scope.$watch(attrs.collapse,function(shouldCollapse){shouldCollapse?collapse():expand()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function($scope,$attrs,accordionConfig){this.groups=[],this.closeOthers=function(openGroup){var closeOthers=angular.isDefined($attrs.closeOthers)?$scope.$eval($attrs.closeOthers):accordionConfig.closeOthers;closeOthers&&angular.forEach(this.groups,function(group){group!==openGroup&&(group.isOpen=!1)})},this.addGroup=function(groupScope){var that=this;this.groups.push(groupScope),groupScope.$on("$destroy",function(event){that.removeGroup(groupScope)})},this.removeGroup=function(group){var index=this.groups.indexOf(group);-1!==index&&this.groups.splice(index,1)}}]).directive("accordion",function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}}).directive("accordionGroup",function(){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(element){this.heading=element}},link:function(scope,element,attrs,accordionCtrl){accordionCtrl.addGroup(scope),
scope.$watch("isOpen",function(value){value&&accordionCtrl.closeOthers(scope)}),scope.toggleOpen=function(){scope.isDisabled||(scope.isOpen=!scope.isOpen)}}}}).directive("accordionHeading",function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(scope,element,attr,accordionGroupCtrl,transclude){accordionGroupCtrl.setHeading(transclude(scope,angular.noop))}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(scope,element,attr,controller){scope.$watch(function(){return controller[attr.accordionTransclude]},function(heading){heading&&(element.html(""),element.append(heading))})}}}),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function($scope,$attrs){$scope.closeable=!!$attrs.close,this.close=$scope.close}]).directive("alert",function(){return{restrict:"EA",controller:"AlertController",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}).directive("dismissOnTimeout",["$timeout",function($timeout){return{require:"alert",link:function(scope,element,attrs,alertCtrl){$timeout(function(){alertCtrl.close()},parseInt(attrs.dismissOnTimeout,10))}}}]),angular.module("ui.bootstrap.bindHtml",[]).value("$bindHtmlUnsafeSuppressDeprecated",!1).directive("bindHtmlUnsafe",["$log","$bindHtmlUnsafeSuppressDeprecated",function($log,$bindHtmlUnsafeSuppressDeprecated){return function(scope,element,attr){$bindHtmlUnsafeSuppressDeprecated||$log.warn("bindHtmlUnsafe is now deprecated. Use ngBindHtml instead"),element.addClass("ng-binding").data("$binding",attr.bindHtmlUnsafe),scope.$watch(attr.bindHtmlUnsafe,function(value){element.html(value||"")})}}]),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(buttonConfig){this.activeClass=buttonConfig.activeClass||"active",this.toggleEvent=buttonConfig.toggleEvent||"click"}]).directive("btnRadio",function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(scope,element,attrs,ctrls){var buttonsCtrl=ctrls[0],ngModelCtrl=ctrls[1];ngModelCtrl.$render=function(){element.toggleClass(buttonsCtrl.activeClass,angular.equals(ngModelCtrl.$modelValue,scope.$eval(attrs.btnRadio)))},element.bind(buttonsCtrl.toggleEvent,function(){var isActive=element.hasClass(buttonsCtrl.activeClass);(!isActive||angular.isDefined(attrs.uncheckable))&&scope.$apply(function(){ngModelCtrl.$setViewValue(isActive?null:scope.$eval(attrs.btnRadio)),ngModelCtrl.$render()})})}}}).directive("btnCheckbox",function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(scope,element,attrs,ctrls){function getTrueValue(){return getCheckboxValue(attrs.btnCheckboxTrue,!0)}function getFalseValue(){return getCheckboxValue(attrs.btnCheckboxFalse,!1)}function getCheckboxValue(attributeValue,defaultValue){var val=scope.$eval(attributeValue);return angular.isDefined(val)?val:defaultValue}var buttonsCtrl=ctrls[0],ngModelCtrl=ctrls[1];ngModelCtrl.$render=function(){element.toggleClass(buttonsCtrl.activeClass,angular.equals(ngModelCtrl.$modelValue,getTrueValue()))},element.bind(buttonsCtrl.toggleEvent,function(){scope.$apply(function(){ngModelCtrl.$setViewValue(element.hasClass(buttonsCtrl.activeClass)?getFalseValue():getTrueValue()),ngModelCtrl.$render()})})}}}),angular.module("ui.bootstrap.carousel",[]).controller("CarouselController",["$scope","$element","$interval","$animate",function($scope,$element,$interval,$animate){function goNext(slide,index,direction){destroyed||(angular.extend(slide,{direction:direction,active:!0}),angular.extend(self.currentSlide||{},{direction:direction,active:!1}),$animate.enabled()&&!$scope.noTransition&&!$scope.$currentTransition&&slide.$element&&(slide.$element.data(SLIDE_DIRECTION,slide.direction),$scope.$currentTransition=!0,slide.$element.one("$animate:close",function(){$scope.$currentTransition=null})),self.currentSlide=slide,currentIndex=index,restartTimer())}function getSlideByIndex(index){if(angular.isUndefined(slides[index].index))return slides[index];var i;slides.length;for(i=0;i<slides.length;++i)if(slides[i].index==index)return slides[i]}function restartTimer(){resetTimer();var interval=+$scope.interval;!isNaN(interval)&&interval>0&&(currentInterval=$interval(timerFn,interval))}function resetTimer(){currentInterval&&($interval.cancel(currentInterval),currentInterval=null)}function timerFn(){var interval=+$scope.interval;isPlaying&&!isNaN(interval)&&interval>0&&slides.length?$scope.next():$scope.pause()}var currentInterval,isPlaying,self=this,slides=self.slides=$scope.slides=[],NO_TRANSITION="uib-noTransition",SLIDE_DIRECTION="uib-slideDirection",currentIndex=-1;self.currentSlide=null;var destroyed=!1;self.select=$scope.select=function(nextSlide,direction){var nextIndex=self.indexOfSlide(nextSlide);void 0===direction&&(direction=nextIndex>self.getCurrentIndex()?"next":"prev"),nextSlide&&nextSlide!==self.currentSlide&&!$scope.$currentTransition&&goNext(nextSlide,nextIndex,direction)},$scope.$on("$destroy",function(){destroyed=!0}),self.getCurrentIndex=function(){return self.currentSlide&&angular.isDefined(self.currentSlide.index)?+self.currentSlide.index:currentIndex},self.indexOfSlide=function(slide){return angular.isDefined(slide.index)?+slide.index:slides.indexOf(slide)},$scope.next=function(){var newIndex=(self.getCurrentIndex()+1)%slides.length;return 0===newIndex&&$scope.noWrap()?void $scope.pause():self.select(getSlideByIndex(newIndex),"next")},$scope.prev=function(){var newIndex=self.getCurrentIndex()-1<0?slides.length-1:self.getCurrentIndex()-1;return $scope.noWrap()&&newIndex===slides.length-1?void $scope.pause():self.select(getSlideByIndex(newIndex),"prev")},$scope.isActive=function(slide){return self.currentSlide===slide},$scope.$watch("interval",restartTimer),$scope.$on("$destroy",resetTimer),$scope.play=function(){isPlaying||(isPlaying=!0,restartTimer())},$scope.pause=function(){$scope.noPause||(isPlaying=!1,resetTimer())},self.addSlide=function(slide,element){slide.$element=element,slides.push(slide),1===slides.length||slide.active?(self.select(slides[slides.length-1]),1==slides.length&&$scope.play()):slide.active=!1},self.removeSlide=function(slide){angular.isDefined(slide.index)&&slides.sort(function(a,b){return+a.index>+b.index});var index=slides.indexOf(slide);slides.splice(index,1),slides.length>0&&slide.active?index>=slides.length?self.select(slides[index-1]):self.select(slides[index]):currentIndex>index&&currentIndex--},$scope.$watch("noTransition",function(noTransition){$element.data(NO_TRANSITION,noTransition)})}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",require:"carousel",templateUrl:"template/carousel/carousel.html",scope:{interval:"=",noTransition:"=",noPause:"=",noWrap:"&"}}}]).directive("slide",function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{active:"=?",index:"=?"},link:function(scope,element,attrs,carouselCtrl){carouselCtrl.addSlide(scope,element),scope.$on("$destroy",function(){carouselCtrl.removeSlide(scope)}),scope.$watch("active",function(active){active&&carouselCtrl.select(scope)})}}}).animation(".item",["$animate",function($animate){var NO_TRANSITION="uib-noTransition",SLIDE_DIRECTION="uib-slideDirection";return{beforeAddClass:function(element,className,done){if("active"==className&&element.parent()&&!element.parent().data(NO_TRANSITION)){var stopped=!1,direction=element.data(SLIDE_DIRECTION),directionClass="next"==direction?"left":"right";return element.addClass(direction),$animate.addClass(element,directionClass).then(function(){stopped||element.removeClass(directionClass+" "+direction),done()}),function(){stopped=!0}}done()},beforeRemoveClass:function(element,className,done){if("active"==className&&element.parent()&&!element.parent().data(NO_TRANSITION)){var stopped=!1,direction=element.data(SLIDE_DIRECTION),directionClass="next"==direction?"left":"right";return $animate.addClass(element,directionClass).then(function(){stopped||element.removeClass(directionClass),done()}),function(){stopped=!0}}done()}}}]),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$locale","orderByFilter",function($locale,orderByFilter){function createParser(format){var map=[],regex=format.split("");return angular.forEach(formatCodeToRegex,function(data,code){var index=format.indexOf(code);if(index>-1){format=format.split(""),regex[index]="("+data.regex+")",format[index]="$";for(var i=index+1,n=index+code.length;n>i;i++)regex[i]="",format[i]="$";format=format.join(""),map.push({index:index,apply:data.apply})}}),{regex:new RegExp("^"+regex.join("")+"$"),map:orderByFilter(map,"index")}}function isValid(year,month,date){return 1>date?!1:1===month&&date>28?29===date&&(year%4===0&&year%100!==0||year%400===0):3===month||5===month||8===month||10===month?31>date:!0}var SPECIAL_CHARACTERS_REGEXP=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.parsers={};var formatCodeToRegex={yyyy:{regex:"\\d{4}",apply:function(value){this.year=+value}},yy:{regex:"\\d{2}",apply:function(value){this.year=+value+2e3}},y:{regex:"\\d{1,4}",apply:function(value){this.year=+value}},MMMM:{regex:$locale.DATETIME_FORMATS.MONTH.join("|"),apply:function(value){this.month=$locale.DATETIME_FORMATS.MONTH.indexOf(value)}},MMM:{regex:$locale.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(value){this.month=$locale.DATETIME_FORMATS.SHORTMONTH.indexOf(value)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(value){this.month=value-1}},M:{regex:"[1-9]|1[0-2]",apply:function(value){this.month=value-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(value){this.date=+value}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(value){this.date=+value}},EEEE:{regex:$locale.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:$locale.DATETIME_FORMATS.SHORTDAY.join("|")},HH:{regex:"(?:0|1)[0-9]|2[0-3]",apply:function(value){this.hours=+value}},H:{regex:"1?[0-9]|2[0-3]",apply:function(value){this.hours=+value}},mm:{regex:"[0-5][0-9]",apply:function(value){this.minutes=+value}},m:{regex:"[0-9]|[1-5][0-9]",apply:function(value){this.minutes=+value}},sss:{regex:"[0-9][0-9][0-9]",apply:function(value){this.milliseconds=+value}},ss:{regex:"[0-5][0-9]",apply:function(value){this.seconds=+value}},s:{regex:"[0-9]|[1-5][0-9]",apply:function(value){this.seconds=+value}}};this.parse=function(input,format,baseDate){if(!angular.isString(input)||!format)return input;format=$locale.DATETIME_FORMATS[format]||format,format=format.replace(SPECIAL_CHARACTERS_REGEXP,"\\$&"),this.parsers[format]||(this.parsers[format]=createParser(format));var parser=this.parsers[format],regex=parser.regex,map=parser.map,results=input.match(regex);if(results&&results.length){var fields,dt;fields=baseDate?{year:baseDate.getFullYear(),month:baseDate.getMonth(),date:baseDate.getDate(),hours:baseDate.getHours(),minutes:baseDate.getMinutes(),seconds:baseDate.getSeconds(),milliseconds:baseDate.getMilliseconds()}:{year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0};for(var i=1,n=results.length;n>i;i++){var mapper=map[i-1];mapper.apply&&mapper.apply.call(fields,results[i])}return isValid(fields.year,fields.month,fields.date)&&(dt=new Date(fields.year,fields.month,fields.date,fields.hours,fields.minutes,fields.seconds,fields.milliseconds||0)),dt}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function($document,$window){function getStyle(el,cssprop){return el.currentStyle?el.currentStyle[cssprop]:$window.getComputedStyle?$window.getComputedStyle(el)[cssprop]:el.style[cssprop]}function isStaticPositioned(element){return"static"===(getStyle(element,"position")||"static")}var parentOffsetEl=function(element){for(var docDomEl=$document[0],offsetParent=element.offsetParent||docDomEl;offsetParent&&offsetParent!==docDomEl&&isStaticPositioned(offsetParent);)offsetParent=offsetParent.offsetParent;return offsetParent||docDomEl};return{position:function(element){var elBCR=this.offset(element),offsetParentBCR={top:0,left:0},offsetParentEl=parentOffsetEl(element[0]);offsetParentEl!=$document[0]&&(offsetParentBCR=this.offset(angular.element(offsetParentEl)),offsetParentBCR.top+=offsetParentEl.clientTop-offsetParentEl.scrollTop,offsetParentBCR.left+=offsetParentEl.clientLeft-offsetParentEl.scrollLeft);var boundingClientRect=element[0].getBoundingClientRect();return{width:boundingClientRect.width||element.prop("offsetWidth"),height:boundingClientRect.height||element.prop("offsetHeight"),top:elBCR.top-offsetParentBCR.top,left:elBCR.left-offsetParentBCR.left}},offset:function(element){var boundingClientRect=element[0].getBoundingClientRect();return{width:boundingClientRect.width||element.prop("offsetWidth"),height:boundingClientRect.height||element.prop("offsetHeight"),top:boundingClientRect.top+($window.pageYOffset||$document[0].documentElement.scrollTop),left:boundingClientRect.left+($window.pageXOffset||$document[0].documentElement.scrollLeft)}},positionElements:function(hostEl,targetEl,positionStr,appendToBody){var hostElPos,targetElWidth,targetElHeight,targetElPos,positionStrParts=positionStr.split("-"),pos0=positionStrParts[0],pos1=positionStrParts[1]||"center";hostElPos=appendToBody?this.offset(hostEl):this.position(hostEl),targetElWidth=targetEl.prop("offsetWidth"),targetElHeight=targetEl.prop("offsetHeight");var shiftWidth={center:function(){return hostElPos.left+hostElPos.width/2-targetElWidth/2},left:function(){return hostElPos.left},right:function(){return hostElPos.left+hostElPos.width}},shiftHeight={center:function(){return hostElPos.top+hostElPos.height/2-targetElHeight/2},top:function(){return hostElPos.top},bottom:function(){return hostElPos.top+hostElPos.height}};switch(pos0){case"right":targetElPos={top:shiftHeight[pos1](),left:shiftWidth[pos0]()};break;case"left":targetElPos={top:shiftHeight[pos1](),left:hostElPos.left-targetElWidth};break;case"bottom":targetElPos={top:shiftHeight[pos0](),left:shiftWidth[pos1]()};break;default:targetElPos={top:hostElPos.top-targetElHeight,left:shiftWidth[pos1]()}}return targetElPos}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null,shortcutPropagation:!1}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$log","dateFilter","datepickerConfig",function($scope,$attrs,$parse,$interpolate,$log,dateFilter,datepickerConfig){var self=this,ngModelCtrl={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","minMode","maxMode","showWeeks","startingDay","yearRange","shortcutPropagation"],function(key,index){self[key]=angular.isDefined($attrs[key])?8>index?$interpolate($attrs[key])($scope.$parent):$scope.$parent.$eval($attrs[key]):datepickerConfig[key]}),angular.forEach(["minDate","maxDate"],function(key){$attrs[key]?$scope.$parent.$watch($parse($attrs[key]),function(value){self[key]=value?new Date(value):null,self.refreshView()}):self[key]=datepickerConfig[key]?new Date(datepickerConfig[key]):null}),$scope.datepickerMode=$scope.datepickerMode||datepickerConfig.datepickerMode,$scope.maxMode=self.maxMode,$scope.uniqueId="datepicker-"+$scope.$id+"-"+Math.floor(1e4*Math.random()),angular.isDefined($attrs.initDate)?(this.activeDate=$scope.$parent.$eval($attrs.initDate)||new Date,$scope.$parent.$watch($attrs.initDate,function(initDate){initDate&&(ngModelCtrl.$isEmpty(ngModelCtrl.$modelValue)||ngModelCtrl.$invalid)&&(self.activeDate=initDate,self.refreshView())})):this.activeDate=new Date,$scope.isActive=function(dateObject){return 0===self.compare(dateObject.date,self.activeDate)?($scope.activeDateId=dateObject.uid,!0):!1},this.init=function(ngModelCtrl_){ngModelCtrl=ngModelCtrl_,ngModelCtrl.$render=function(){self.render()}},this.render=function(){if(ngModelCtrl.$viewValue){var date=new Date(ngModelCtrl.$viewValue),isValid=!isNaN(date);isValid?this.activeDate=date:$log.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'),ngModelCtrl.$setValidity("date",isValid)}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var date=ngModelCtrl.$viewValue?new Date(ngModelCtrl.$viewValue):null;ngModelCtrl.$setValidity("date-disabled",!date||this.element&&!this.isDisabled(date))}},this.createDateObject=function(date,format){var model=ngModelCtrl.$viewValue?new Date(ngModelCtrl.$viewValue):null;return{date:date,label:dateFilter(date,format),selected:model&&0===this.compare(date,model),disabled:this.isDisabled(date),current:0===this.compare(date,new Date),customClass:this.customClass(date)}},this.isDisabled=function(date){return this.minDate&&this.compare(date,this.minDate)<0||this.maxDate&&this.compare(date,this.maxDate)>0||$attrs.dateDisabled&&$scope.dateDisabled({date:date,mode:$scope.datepickerMode})},this.customClass=function(date){return $scope.customClass({date:date,mode:$scope.datepickerMode})},this.split=function(arr,size){for(var arrays=[];arr.length>0;)arrays.push(arr.splice(0,size));return arrays},this.fixTimeZone=function(date){var hours=date.getHours();date.setHours(23===hours?hours+2:0)},$scope.select=function(date){if($scope.datepickerMode===self.minMode){var dt=ngModelCtrl.$viewValue?new Date(ngModelCtrl.$viewValue):new Date(0,0,0,0,0,0,0);dt.setFullYear(date.getFullYear(),date.getMonth(),date.getDate()),ngModelCtrl.$setViewValue(dt),ngModelCtrl.$render()}else self.activeDate=date,$scope.datepickerMode=self.modes[self.modes.indexOf($scope.datepickerMode)-1]},$scope.move=function(direction){var year=self.activeDate.getFullYear()+direction*(self.step.years||0),month=self.activeDate.getMonth()+direction*(self.step.months||0);self.activeDate.setFullYear(year,month,1),self.refreshView()},$scope.toggleMode=function(direction){direction=direction||1,$scope.datepickerMode===self.maxMode&&1===direction||$scope.datepickerMode===self.minMode&&-1===direction||($scope.datepickerMode=self.modes[self.modes.indexOf($scope.datepickerMode)+direction])},$scope.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var focusElement=function(){self.element[0].focus()};$scope.$on("datepicker.focus",focusElement),$scope.keydown=function(evt){var key=$scope.keys[evt.which];if(key&&!evt.shiftKey&&!evt.altKey)if(evt.preventDefault(),self.shortcutPropagation||evt.stopPropagation(),"enter"===key||"space"===key){if(self.isDisabled(self.activeDate))return;$scope.select(self.activeDate),focusElement()}else!evt.ctrlKey||"up"!==key&&"down"!==key?(self.handleKeyDown(key,evt),self.refreshView()):($scope.toggleMode("up"===key?1:-1),focusElement())}}]).directive("datepicker",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{datepickerMode:"=?",dateDisabled:"&",customClass:"&",shortcutPropagation:"&?"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(scope,element,attrs,ctrls){var datepickerCtrl=ctrls[0],ngModelCtrl=ctrls[1];ngModelCtrl&&datepickerCtrl.init(ngModelCtrl)}}}).directive("daypicker",["dateFilter",function(dateFilter){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/day.html",require:"^datepicker",link:function(scope,element,attrs,ctrl){function getDaysInMonth(year,month){return 1!==month||year%4!==0||year%100===0&&year%400!==0?DAYS_IN_MONTH[month]:29}function getDates(startDate,n){for(var date,dates=new Array(n),current=new Date(startDate),i=0;n>i;)date=new Date(current),ctrl.fixTimeZone(date),dates[i++]=date,current.setDate(current.getDate()+1);return dates}function getISO8601WeekNumber(date){var checkDate=new Date(date);checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));var time=checkDate.getTime();return checkDate.setMonth(0),checkDate.setDate(1),Math.floor(Math.round((time-checkDate)/864e5)/7)+1}scope.showWeeks=ctrl.showWeeks,ctrl.step={months:1},ctrl.element=element;var DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31];ctrl._refreshView=function(){var year=ctrl.activeDate.getFullYear(),month=ctrl.activeDate.getMonth(),firstDayOfMonth=new Date(year,month,1),difference=ctrl.startingDay-firstDayOfMonth.getDay(),numDisplayedFromPreviousMonth=difference>0?7-difference:-difference,firstDate=new Date(firstDayOfMonth);numDisplayedFromPreviousMonth>0&&firstDate.setDate(-numDisplayedFromPreviousMonth+1);for(var days=getDates(firstDate,42),i=0;42>i;i++)days[i]=angular.extend(ctrl.createDateObject(days[i],ctrl.formatDay),{secondary:days[i].getMonth()!==month,uid:scope.uniqueId+"-"+i});scope.labels=new Array(7);for(var j=0;7>j;j++)scope.labels[j]={abbr:dateFilter(days[j].date,ctrl.formatDayHeader),full:dateFilter(days[j].date,"EEEE")};if(scope.title=dateFilter(ctrl.activeDate,ctrl.formatDayTitle),scope.rows=ctrl.split(days,7),scope.showWeeks){scope.weekNumbers=[];for(var thursdayIndex=(11-ctrl.startingDay)%7,numWeeks=scope.rows.length,curWeek=0;numWeeks>curWeek;curWeek++)scope.weekNumbers.push(getISO8601WeekNumber(scope.rows[curWeek][thursdayIndex].date))}},ctrl.compare=function(date1,date2){return new Date(date1.getFullYear(),date1.getMonth(),date1.getDate())-new Date(date2.getFullYear(),date2.getMonth(),date2.getDate())},ctrl.handleKeyDown=function(key,evt){var date=ctrl.activeDate.getDate();if("left"===key)date-=1;else if("up"===key)date-=7;else if("right"===key)date+=1;else if("down"===key)date+=7;else if("pageup"===key||"pagedown"===key){var month=ctrl.activeDate.getMonth()+("pageup"===key?-1:1);ctrl.activeDate.setMonth(month,1),date=Math.min(getDaysInMonth(ctrl.activeDate.getFullYear(),ctrl.activeDate.getMonth()),date)}else"home"===key?date=1:"end"===key&&(date=getDaysInMonth(ctrl.activeDate.getFullYear(),ctrl.activeDate.getMonth()));ctrl.activeDate.setDate(date)},ctrl.refreshView()}}}]).directive("monthpicker",["dateFilter",function(dateFilter){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/month.html",require:"^datepicker",link:function(scope,element,attrs,ctrl){ctrl.step={years:1},ctrl.element=element,ctrl._refreshView=function(){for(var date,months=new Array(12),year=ctrl.activeDate.getFullYear(),i=0;12>i;i++)date=new Date(year,i,1),ctrl.fixTimeZone(date),months[i]=angular.extend(ctrl.createDateObject(date,ctrl.formatMonth),{uid:scope.uniqueId+"-"+i});scope.title=dateFilter(ctrl.activeDate,ctrl.formatMonthTitle),scope.rows=ctrl.split(months,3)},ctrl.compare=function(date1,date2){return new Date(date1.getFullYear(),date1.getMonth())-new Date(date2.getFullYear(),date2.getMonth())},ctrl.handleKeyDown=function(key,evt){var date=ctrl.activeDate.getMonth();if("left"===key)date-=1;else if("up"===key)date-=3;else if("right"===key)date+=1;else if("down"===key)date+=3;else if("pageup"===key||"pagedown"===key){var year=ctrl.activeDate.getFullYear()+("pageup"===key?-1:1);ctrl.activeDate.setFullYear(year)}else"home"===key?date=0:"end"===key&&(date=11);ctrl.activeDate.setMonth(date)},ctrl.refreshView()}}}]).directive("yearpicker",["dateFilter",function(dateFilter){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/year.html",require:"^datepicker",link:function(scope,element,attrs,ctrl){function getStartingYear(year){return parseInt((year-1)/range,10)*range+1}var range=ctrl.yearRange;ctrl.step={years:range},ctrl.element=element,ctrl._refreshView=function(){for(var date,years=new Array(range),i=0,start=getStartingYear(ctrl.activeDate.getFullYear());range>i;i++)date=new Date(start+i,0,1),ctrl.fixTimeZone(date),years[i]=angular.extend(ctrl.createDateObject(date,ctrl.formatYear),{uid:scope.uniqueId+"-"+i});scope.title=[years[0].label,years[range-1].label].join(" - "),scope.rows=ctrl.split(years,5)},ctrl.compare=function(date1,date2){return date1.getFullYear()-date2.getFullYear()},ctrl.handleKeyDown=function(key,evt){var date=ctrl.activeDate.getFullYear();"left"===key?date-=1:"up"===key?date-=5:"right"===key?date+=1:"down"===key?date+=5:"pageup"===key||"pagedown"===key?date+=("pageup"===key?-1:1)*ctrl.step.years:"home"===key?date=getStartingYear(ctrl.activeDate.getFullYear()):"end"===key&&(date=getStartingYear(ctrl.activeDate.getFullYear())+range-1),ctrl.activeDate.setFullYear(date)},ctrl.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","dateParser","datepickerPopupConfig","$timeout",function($compile,$parse,$document,$position,dateFilter,dateParser,datepickerPopupConfig,$timeout){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&",customClass:"&"},link:function(scope,element,attrs,ngModel){function cameltoDash(string){return string.replace(/([A-Z])/g,function($1){return"-"+$1.toLowerCase()})}function parseDate(viewValue){if(angular.isNumber(viewValue)&&(viewValue=new Date(viewValue)),viewValue){if(angular.isDate(viewValue)&&!isNaN(viewValue))return viewValue;if(angular.isString(viewValue)){var date=dateParser.parse(viewValue,dateFormat,scope.date)||new Date(viewValue);return isNaN(date)?void 0:date}return void 0}return null}function validator(modelValue,viewValue){var value=modelValue||viewValue;if(angular.isNumber(value)&&(value=new Date(value)),value){if(angular.isDate(value)&&!isNaN(value))return!0;if(angular.isString(value)){var date=dateParser.parse(value,dateFormat)||new Date(value);return!isNaN(date)}return!1}return!0}var dateFormat,closeOnDateSelection=angular.isDefined(attrs.closeOnDateSelection)?scope.$parent.$eval(attrs.closeOnDateSelection):datepickerPopupConfig.closeOnDateSelection,appendToBody=angular.isDefined(attrs.datepickerAppendToBody)?scope.$parent.$eval(attrs.datepickerAppendToBody):datepickerPopupConfig.appendToBody;scope.showButtonBar=angular.isDefined(attrs.showButtonBar)?scope.$parent.$eval(attrs.showButtonBar):datepickerPopupConfig.showButtonBar,scope.getText=function(key){return scope[key+"Text"]||datepickerPopupConfig[key+"Text"]};var isHtml5DateInput=!1;if(datepickerPopupConfig.html5Types[attrs.type]?(dateFormat=datepickerPopupConfig.html5Types[attrs.type],isHtml5DateInput=!0):(dateFormat=attrs.datepickerPopup||datepickerPopupConfig.datepickerPopup,attrs.$observe("datepickerPopup",function(value,oldValue){var newDateFormat=value||datepickerPopupConfig.datepickerPopup;if(newDateFormat!==dateFormat&&(dateFormat=newDateFormat,ngModel.$modelValue=null,!dateFormat))throw new Error("datepickerPopup must have a date format specified.")})),!dateFormat)throw new Error("datepickerPopup must have a date format specified.");if(isHtml5DateInput&&attrs.datepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");var popupEl=angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");popupEl.attr({"ng-model":"date","ng-change":"dateSelection(date)"});var datepickerEl=angular.element(popupEl.children()[0]);if(isHtml5DateInput&&"month"==attrs.type&&(datepickerEl.attr("datepicker-mode",'"month"'),datepickerEl.attr("min-mode","month")),attrs.datepickerOptions){var options=scope.$parent.$eval(attrs.datepickerOptions);options.initDate&&(scope.initDate=options.initDate,datepickerEl.attr("init-date","initDate"),delete options.initDate),angular.forEach(options,function(value,option){datepickerEl.attr(cameltoDash(option),value)})}scope.watchData={},angular.forEach(["minDate","maxDate","datepickerMode","initDate","shortcutPropagation"],function(key){if(attrs[key]){var getAttribute=$parse(attrs[key]);if(scope.$parent.$watch(getAttribute,function(value){scope.watchData[key]=value}),datepickerEl.attr(cameltoDash(key),"watchData."+key),"datepickerMode"===key){var setAttribute=getAttribute.assign;scope.$watch("watchData."+key,function(value,oldvalue){angular.isFunction(setAttribute)&&value!==oldvalue&&setAttribute(scope.$parent,value)})}}}),attrs.dateDisabled&&datepickerEl.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),attrs.showWeeks&&datepickerEl.attr("show-weeks",attrs.showWeeks),attrs.customClass&&datepickerEl.attr("custom-class","customClass({ date: date, mode: mode })"),isHtml5DateInput?ngModel.$formatters.push(function(value){return scope.date=value,value}):(ngModel.$$parserName="date",ngModel.$validators.date=validator,ngModel.$parsers.unshift(parseDate),ngModel.$formatters.push(function(value){return scope.date=value,ngModel.$isEmpty(value)?value:dateFilter(value,dateFormat)})),scope.dateSelection=function(dt){angular.isDefined(dt)&&(scope.date=dt);var date=scope.date?dateFilter(scope.date,dateFormat):"";element.val(date),ngModel.$setViewValue(date),closeOnDateSelection&&(scope.isOpen=!1,element[0].focus())},ngModel.$viewChangeListeners.push(function(){scope.date=dateParser.parse(ngModel.$viewValue,dateFormat,scope.date)||new Date(ngModel.$viewValue)});var documentClickBind=function(event){scope.isOpen&&event.target!==element[0]&&scope.$apply(function(){scope.isOpen=!1})},inputKeydownBind=function(evt){27===evt.which&&scope.isOpen?(evt.preventDefault(),evt.stopPropagation(),scope.$apply(function(){scope.isOpen=!1}),element[0].focus()):40!==evt.which||scope.isOpen||(evt.preventDefault(),evt.stopPropagation(),scope.$apply(function(){scope.isOpen=!0}))};element.bind("keydown",inputKeydownBind),scope.keydown=function(evt){27===evt.which&&(scope.isOpen=!1,element[0].focus())},scope.$watch("isOpen",function(value){value?(scope.position=appendToBody?$position.offset(element):$position.position(element),scope.position.top=scope.position.top+element.prop("offsetHeight"),$document.bind("click",documentClickBind),$timeout(function(){scope.$broadcast("datepicker.focus")},0,!1)):$document.unbind("click",documentClickBind)}),scope.select=function(date){if("today"===date){var today=new Date;angular.isDate(scope.date)?(date=new Date(scope.date),date.setFullYear(today.getFullYear(),today.getMonth(),today.getDate())):date=new Date(today.setHours(0,0,0,0))}scope.dateSelection(date)},scope.close=function(){scope.isOpen=!1,element[0].focus()};var $popup=$compile(popupEl)(scope);popupEl.remove(),appendToBody?$document.find("body").append($popup):element.after($popup),scope.$on("$destroy",function(){scope.isOpen===!0&&scope.$apply(function(){scope.isOpen=!1}),$popup.remove(),element.unbind("keydown",inputKeydownBind),$document.unbind("click",documentClickBind)})}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html"}}),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("dropdownConfig",{openClass:"open"}).service("dropdownService",["$document","$rootScope",function($document,$rootScope){var openScope=null;this.open=function(dropdownScope){openScope||($document.bind("click",closeDropdown),$document.bind("keydown",keybindFilter)),openScope&&openScope!==dropdownScope&&(openScope.isOpen=!1),openScope=dropdownScope},this.close=function(dropdownScope){openScope===dropdownScope&&(openScope=null,$document.unbind("click",closeDropdown),$document.unbind("keydown",keybindFilter))};var closeDropdown=function(evt){if(openScope&&(!evt||"disabled"!==openScope.getAutoClose())){var toggleElement=openScope.getToggleElement();if(!(evt&&toggleElement&&toggleElement[0].contains(evt.target))){var dropdownElement=openScope.getDropdownElement();
......
......@@ -505,6 +505,7 @@ select {
.sidebar .nav-third-level li a {
padding-left: 52px;
font-size: 12px;
}
.sidebar-person-info {
......
angular.module('templates-prod', ['components/auth/login.html', 'components/crud/templates/add.html', 'components/crud/templates/edit.html', 'components/crud/templates/list.html', 'components/crud/templates/show.html', 'components/dashboard/dashboard.html', 'components/error_pages/404.html', 'components/error_pages/500.html', 'components/uitemplates/404.html', 'components/uitemplates/500.html', 'components/wf/templates/add.html', 'components/wf/templates/edit.html', 'components/wf/templates/list.html', 'components/wf/templates/show.html', 'shared/templates/add.html', 'shared/templates/datefield.html', 'shared/templates/directives/chat.html', 'shared/templates/directives/header-breadcrumb.html', 'shared/templates/directives/header-notification.html', 'shared/templates/directives/header-sub-menu.html', 'shared/templates/directives/menuCollapse.html', 'shared/templates/directives/notifications.html', 'shared/templates/directives/selected-user.html', 'shared/templates/directives/sidebar-notification.html', 'shared/templates/directives/sidebar-search.html', 'shared/templates/directives/sidebar.html', 'shared/templates/directives/stats.html', 'shared/templates/directives/timeline.html', 'shared/templates/fieldset.html', 'shared/templates/foreignKey.html', 'shared/templates/linkedModelModalContent.html', 'shared/templates/listnodeModalContent.html', 'shared/templates/modalContent.html', 'shared/templates/nodeTable.html']);
angular.module('templates-prod', ['components/auth/login.html', 'components/crud/templates/add.html', 'components/crud/templates/edit.html', 'components/crud/templates/list.html', 'components/crud/templates/show.html', 'components/dashboard/dashboard.html', 'components/debug/debug.html', 'components/devSettings/devSettings.html', 'components/error_pages/404.html', 'components/error_pages/500.html', 'components/uitemplates/404.html', 'components/uitemplates/500.html', 'components/wf/templates/add.html', 'components/wf/templates/edit.html', 'components/wf/templates/list.html', 'components/wf/templates/show.html', 'shared/templates/add.html', 'shared/templates/datefield.html', 'shared/templates/directives/chat.html', 'shared/templates/directives/header-breadcrumb.html', 'shared/templates/directives/header-notification.html', 'shared/templates/directives/header-sub-menu.html', 'shared/templates/directives/menuCollapse.html', 'shared/templates/directives/notifications.html', 'shared/templates/directives/selected-user.html', 'shared/templates/directives/sidebar-notification.html', 'shared/templates/directives/sidebar-search.html', 'shared/templates/directives/sidebar.html', 'shared/templates/directives/stats.html', 'shared/templates/directives/timeline.html', 'shared/templates/fieldset.html', 'shared/templates/foreignKey.html', 'shared/templates/linkedModelModalContent.html', 'shared/templates/listnodeModalContent.html', 'shared/templates/modalContent.html', 'shared/templates/nodeTable.html']);
angular.module("components/auth/login.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("components/auth/login.html",
......@@ -70,7 +70,7 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache",
$templateCache.put("components/crud/templates/list.html",
"<div class=\"starter-template\">\n" +
" <h1>{{model}}\n" +
" <a href=\"#/crud/add/{{model}}/{{form_params.param}}/{{form_params.id}}\">\n" +
" <a href=\"{{nobjects.addLink}}\">\n" +
" <button type=\"button\" class=\"btn btn-primary\">Ekle</button>\n" +
" </a>\n" +
" </h1>\n" +
......@@ -102,17 +102,17 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache",
" </label>\n" +
" </td>\n" +
" <th scope=\"row\" style=\"text-align:center\">{{$index}}</th>\n" +
" <td ng-repeat=\"k in object track by $index\" ng-if=\"nobjects[0]=='-1' && $index>0\">\n" +
" <a ng-href=\"#/crud/detail/{{model}}/{{form_params.param}}/{{form_params.id}}/{{object[0]}}\">{{object[1]}}</a>\n" +
" <!-- below 2 of object will not be listed there for ng repeat loops 2 less -->\n" +
" <td ng-repeat=\"k in object track by $index\" ng-if=\"nobjects[0]=='-1' && $index>1\">\n" +
" <a ng-href=\"{{object[2].detailLink}}\">{{object[1]}}</a>\n" +
" </td>\n" +
"\n" +
" <td ng-repeat=\"(key,value) in object track by $index\" ng-if=\"nobjects[0]!='-1' && $index>0\">\n" +
" <a ng-href=\"#/crud/detail/{{model}}/{{form_params.param}}/{{form_params.id}}/{{object[0]}}\"\n" +
" ng-if=\"$index==1\">{{object[key]}}</a>\n" +
" <td ng-repeat=\"(key,value) in object track by $index\" ng-if=\"nobjects[0]!='-1' && $index>1\">\n" +
" <a ng-href=\"{{object[2].detailLink}}\" ng-if=\"$index==1\">{{object[key]}}</a>\n" +
" <span ng-if=\"$index!=1\">{{object[key]}}</span>\n" +
" </td>\n" +
" <td>\n" +
" <a ng-href=\"#/crud/edit/{{model}}/{{form_params.param}}/{{form_params.id}}/{{object[0]}}\">Edit</a>\n" +
" <a ng-href=\"{{object[2].editLink}}\">Edit</a>\n" +
" <br>\n" +
" </td>\n" +
" </tr>\n" +
......@@ -379,6 +379,71 @@ angular.module("components/dashboard/dashboard.html", []).run(["$templateCache",
"</div>");
}]);
angular.module("components/debug/debug.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("components/debug/debug.html",
"<div class=\"panel-group\" id=\"accordion\" role=\"tablist\" aria-multiselectable=\"true\">\n" +
" <div class=\"panel panel-default\" ng-repeat=\"query in debug_queries\">\n" +
" <div class=\"panel-heading\" role=\"tab\" id=\"headingOne\" data-toggle=\"collapse\" data-parent=\"#accordion\"\n" +
" data-target=\"#collapse{{$index}}\"\n" +
" aria-expanded=\"true\" aria-controls=\"collapseOne\">\n" +
" <h4 class=\"panel-title\">{{query.url}}\n" +
" </h4>\n" +
" </div>\n" +
" <div id=\"collapse{{$index}}\" class=\"panel-collapse collapse in\" role=\"tabpanel\" aria-labelledby=\"headingOne\">\n" +
" <div class=\"panel-body\">\n" +
" <div class=\"table-responsive\">\n" +
" <ol>\n" +
" <li ng-repeat=\"query in query.queries\">\n" +
" <table class=\"table\">\n" +
" <tbody>\n" +
" <tr ng-repeat=\"(key, value) in query\">\n" +
" <td>{{key}}</td>\n" +
" <td>{{value}}</td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
" </li>\n" +
" </ol>\n" +
"\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
" </div>\n" +
"</div>");
}]);
angular.module("components/devSettings/devSettings.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("components/devSettings/devSettings.html",
"<div class=\"table-responsive\">\n" +
" <table class=\"table\">\n" +
" <tbody>\n" +
" <tr>\n" +
" <td class=\"col-md-2\">Backend Url:</td>\n" +
" <td class=\"col-md-8\">\n" +
" <input class=\"form-control\" type=\"text\" placeholder=\"Backend Url Tanımla\"\n" +
" value=\"{{backendurl}}\"\n" +
" ng-model=\"backendurl\">\n" +
" <button class=\"btn btn-primary\" ng-click=\"setbackendurl()\">Kaydet</button>\n" +
" </td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td>Notifications:</td>\n" +
" <td>\n" +
" <button class=\"btn\"\n" +
" ng-class=\"{'btn-success':notificate=='on', 'btn-danger':notificate=='off'}\" ng-click=\"setnotification()\">{{notificate}}</button>\n" +
" </td>\n" +
" </tr>\n" +
" <tr>\n" +
" <td>Query Debug:</td>\n" +
" <td>\n" +
" <a href=\"#/debug/list\">Goster</a>\n" +
" </td>\n" +
" </tr>\n" +
" </tbody>\n" +
" </table>\n" +
"</div>");
}]);
angular.module("components/error_pages/404.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("components/error_pages/404.html",
"<div ng-app=\"ulakbus.error_pages\" class=\"error-page\">\n" +
......@@ -966,13 +1031,12 @@ angular.module("shared/templates/directives/header-notification.html", []).run([
" <i class=\"fa fa-user fa-fw\"></i> <i class=\"fa fa-caret-down\"></i>\n" +
" </a>\n" +
" <ul class=\"dropdown-menu dropdown-user\">\n" +
" <li><a href=\"javascript:void(0)\"><i class=\"fa fa-user fa-fw\"></i> Profil</a>\n" +
" </li>\n" +
" <li><a href=\"javascript:void(0)\"><i class=\"fa fa-gear fa-fw\"></i> Ayarlar</a>\n" +
" </li>\n" +
" <li><a href=\"javascript:void(0)\"><i class=\"fa fa-user fa-fw\"></i> Profil</a></li>\n" +
" <li class=\"divider\"></li>\n" +
" <li><a ui-sref=\"login\" href=\"javascript:void(0);\" logout><i class=\"fa fa-sign-out fa-fw\"></i> Çıkış</a>\n" +
" </li>\n" +
" <li><a href=\"javascript:void(0)\"><i class=\"fa fa-gear fa-fw\"></i> Ayarlar</a></li>\n" +
" <li><a href=\"#/dev/settings\"><i class=\"fa fa-gear fa-fw\"></i> Ayarlar (Dev)</a></li>\n" +
" <li class=\"divider\"></li>\n" +
" <li><a ui-sref=\"login\" href=\"javascript:void(0);\" logout><i class=\"fa fa-sign-out fa-fw\"></i> Çıkış</a></li>\n" +
" </ul>\n" +
" <!-- /.dropdown-user -->\n" +
" </li>\n" +
......@@ -1253,14 +1317,20 @@ angular.module("shared/templates/directives/sidebar.html", []).run(["$templateCa
" <span class=\"fa arrow\" ng-class=\"{hidden: $root.collapsed}\"></span>\n" +
" </a>\n" +
" <ul class=\"nav nav-second-level\" ng-class=\"{hidden: $root.collapsed}\">\n" +
" <li ng-repeat=\"v in item\">\n" +
" <a ng-if=\"key == 'other'\" ng-href=\"#{{v.url}}/{{$root.selectedUser.key}}\"\n" +
" <li ng-repeat=\"(key2, item2) in item\">\n" +
" <a href=\"#\">{{key2}} <span class=\"fa arrow\"></span></a>\n" +
" <ul class=\"nav nav-third-level collapse in\" aria-expanded=\"true\">\n" +
" <li ng-repeat=\"(k,v) in item2\">\n" +
" <a ng-if=\"key == 'other'\" ng-href=\"#{{v.url}}\"\n" +
" ng-click=\"breadcrumb([key, v.text], $event)\">{{v.text}}</a>\n" +
" <a ng-if=\"key == 'ogrenci' || key == 'personel'\"\n" +
" ng-href=\"#{{v.url}}/{{v.param}}/{{$root.selectedUser.key}}\"\n" +
" ng-href=\"#{{v.url}}/list?{{v.param}}={{$root.selectedUser.key}}\"\n" +
" ng-click=\"breadcrumb([key, v.text], $event)\">{{v.text}}</a>\n" +
" </li>\n" +
" </ul>\n" +
" <!-- /.nav-third-level -->\n" +
" </li>\n" +
" </ul>\n" +
" <!-- /.nav-second-level -->\n" +
" </li>\n" +
" </ul>\n" +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment