Commit 2188bae8 authored by Evren Kutar's avatar Evren Kutar

ADD refs GH-6 dgeni configuration for proper links, add missing docstrings

FIX rclose #5044 fixes zetaops/ulakbusGH-153 fixes GH-75
parent f0592803
...@@ -8,7 +8,14 @@ ...@@ -8,7 +8,14 @@
'use strict'; 'use strict';
var app = angular.module( /**
* @ngdoc module
* @name ulakbus
* @description
* Ulakbus module is the main module of ulakbus-ui. All application-wide configurations and definings of constants
* handled in this module.
*/
angular.module(
'ulakbus', [ 'ulakbus', [
'ui.bootstrap', 'ui.bootstrap',
'angular-loading-bar', 'angular-loading-bar',
...@@ -26,43 +33,47 @@ var app = angular.module( ...@@ -26,43 +33,47 @@ var app = angular.module(
//'schemaForm', //'schemaForm',
'gettext', 'gettext',
'ulakbus.uitemplates' 'ulakbus.uitemplates'
]). ])
/** /**
* RESTURL is the url of rest api to talk * @ngdoc object
* Based on the environment it changes from dev to prod * @name RESTURL
*/ * @module ulakbus
constant("RESTURL", (function () { * @description
// todo: below backendurl definition is for development purpose and will be deleted * RESTURL is the url of rest api to talk
var backendurl = location.href.indexOf('nightly') > -1 ? "//nightly.api.ulakbus.net/" : "//api.ulakbus.net/"; * Based on the environment it changes from dev to prod
if (document.cookie.indexOf("backendurl") > -1) { */
var cookiearray = document.cookie.split(';'); .constant("RESTURL", (function () {
angular.forEach(cookiearray, function (item) { // todo: below backendurl definition is for development purpose and will be deleted
if (item.indexOf("backendurl") > -1) { var backendurl = location.href.indexOf('nightly') > -1 ? "//nightly.api.ulakbus.net/" : "//api.ulakbus.net/";
backendurl = item.split('=')[1]; if (document.cookie.indexOf("backendurl") > -1) {
} var cookiearray = document.cookie.split(';');
}); angular.forEach(cookiearray, function (item) {
} if (item.indexOf("backendurl") > -1) {
backendurl = item.split('=')[1];
}
});
}
if (location.href.indexOf("backendurl") > -1) { if (location.href.indexOf("backendurl") > -1) {
var urlfromqstr = location.href.split('?')[1].split('=')[1]; var urlfromqstr = location.href.split('?')[1].split('=')[1];
backendurl = decodeURIComponent(urlfromqstr.replace(/\+/g, " ")); backendurl = decodeURIComponent(urlfromqstr.replace(/\+/g, " "));
document.cookie = "backendurl=" + backendurl; document.cookie = "backendurl=" + backendurl;
window.location.href = window.location.href.split('?')[0]; window.location.href = window.location.href.split('?')[0];
} }
return {url: backendurl}; return {url: backendurl};
})()). })()).
/** /**
* USER_ROLES and AUTH_EVENTS are constant for auth functions * USER_ROLES and AUTH_EVENTS are constant for auth functions
*/ */
constant("USER_ROLES", { constant("USER_ROLES", {
all: "*", all: "*",
admin: "admin", admin: "admin",
student: "student", student: "student",
staff: "staff", staff: "staff",
dean: "dean" dean: "dean"
}). })
constant('AUTH_EVENTS', { .constant('AUTH_EVENTS', {
loginSuccess: 'auth-login-success', loginSuccess: 'auth-login-success',
loginFailed: 'auth-login-failed', loginFailed: 'auth-login-failed',
logoutSuccess: 'auth-logout-success', logoutSuccess: 'auth-logout-success',
...@@ -72,10 +83,4 @@ constant("USER_ROLES", { ...@@ -72,10 +83,4 @@ constant("USER_ROLES", {
}) })
.config(function ($logProvider) { .config(function ($logProvider) {
$logProvider.debugEnabled(true); $logProvider.debugEnabled(true);
}); });
\ No newline at end of file
// test the code with strict di mode to see if it works when minified
//angular.bootstrap(document, ['ulakbus'], {
// strictDi: true
//});
'use strict'; 'use strict';
app.config(['$routeProvider', function ($routeProvider, $route) { angular.module('ulakbus')
$routeProvider .config(['$routeProvider', function ($routeProvider, $route) {
.when('/login', { $routeProvider
templateUrl: 'components/auth/login.html', .when('/login', {
controller: 'LoginCtrl' templateUrl: 'components/auth/login.html',
}) controller: 'LoginCtrl'
.when('/dashboard', { })
templateUrl: 'components/dashboard/dashboard.html', .when('/dashboard', {
controller: 'DashCtrl' templateUrl: 'components/dashboard/dashboard.html',
}) controller: 'DashCtrl'
.when('/dev/settings', { })
templateUrl: 'components/devSettings/devSettings.html', .when('/dev/settings', {
controller: 'DevSettingsCtrl' templateUrl: 'components/devSettings/devSettings.html',
}) controller: 'DevSettingsCtrl'
.when('/debug/list', { })
templateUrl: 'components/debug/debug.html', .when('/debug/list', {
controller: 'DebugCtrl' templateUrl: 'components/debug/debug.html',
}) controller: 'DebugCtrl'
})
// use crud without selected user // use crud without selected user
// important: regex urls must be defined later than static ones // important: regex urls must be defined later than static ones
.when('/:wf/', { .when('/:wf/', {
templateUrl: 'components/crud/templates/crud.html', templateUrl: 'components/crud/templates/crud.html',
controller: 'CRUDCtrl' controller: 'CRUDCtrl'
}) })
.when('/:wf/do/:cmd', { .when('/:wf/do/:cmd', {
templateUrl: 'components/crud/templates/crud.html', templateUrl: 'components/crud/templates/crud.html',
controller: 'CRUDListFormCtrl' controller: 'CRUDListFormCtrl'
}) })
.when('/:wf/do/:cmd/:key', { .when('/:wf/do/:cmd/:key', {
templateUrl: 'components/crud/templates/crud.html', templateUrl: 'components/crud/templates/crud.html',
controller: 'CRUDListFormCtrl' controller: 'CRUDListFormCtrl'
}) })
.when('/:wf/:model', { .when('/:wf/:model', {
templateUrl: 'components/crud/templates/crud.html', templateUrl: 'components/crud/templates/crud.html',
controller: 'CRUDCtrl' controller: 'CRUDCtrl'
}) })
.when('/:wf/:model/do/:cmd', { .when('/:wf/:model/do/:cmd', {
templateUrl: 'components/crud/templates/crud.html', templateUrl: 'components/crud/templates/crud.html',
controller: 'CRUDListFormCtrl' controller: 'CRUDListFormCtrl'
}) })
.when('/:wf/:model/do/:cmd/:key', { .when('/:wf/:model/do/:cmd/:key', {
templateUrl: 'components/crud/templates/crud.html', templateUrl: 'components/crud/templates/crud.html',
controller: 'CRUDListFormCtrl' controller: 'CRUDListFormCtrl'
}) })
.otherwise({redirectTo: '/dashboard'}); .otherwise({redirectTo: '/dashboard'});
}]) }])
.run(function ($rootScope) { .run(function ($rootScope) {
$rootScope.loggedInUser = true; $rootScope.loggedInUser = true;
......
...@@ -8,36 +8,54 @@ ...@@ -8,36 +8,54 @@
'use strict'; 'use strict';
var auth = angular.module('ulakbus.auth', ['ngRoute', 'schemaForm', 'ngCookies']); /**
auth.controller('LoginCtrl', function ($scope, $q, $timeout, $routeParams, $rootScope, $log, Generator, LoginService) { * @ngdoc module
$scope.url = 'login'; * @name ulakbus.auth
$scope.form_params = {}; * @description
$scope.form_params['clear_wf'] = 1; * ulakbus.auth module handles authorization process of ulakbus-ui.
Generator.get_form($scope).then(function(data){ *
$scope.form = [ * @requires ngRoute
{ key: "username", type: "string", title: "Kullanıcı Adı"}, * @requires schemaForm
{ key: "password", type: "password", title: "Şifre"}, * @requires ngCookies
{ type: 'submit', title: 'Giriş Yap' } */
]; angular.module('ulakbus.auth', ['ngRoute', 'schemaForm', 'ngCookies'])
}); /**
$scope.loggingIn = false; * @ngdoc controller
$scope.onSubmit = function (form) { * @name LoginCtrl
$scope.$broadcast('schemaFormValidate'); * @module ulakbus.auth
if (form.$valid) { * @description
$scope.loggingIn = true; * LoginCtrl responsible to handle login process.
$rootScope.loginAttempt = 1; * Using 'formService.get_form' function generates the login form and post it to the API with input datas.
LoginService.login($scope.url, $scope.model) */
.error(function(data){ .controller('LoginCtrl', function ($scope, $q, $timeout, $routeParams, $rootScope, $log, Generator, LoginService) {
$scope.message = data.title; $scope.url = 'login';
}) $scope.form_params = {};
.then(function () { $scope.form_params['clear_wf'] = 1;
$scope.loggingIn = false; Generator.get_form($scope).then(function (data) {
}) $scope.form = [
} {key: "username", type: "string", title: "Kullanıcı Adı"},
else { {key: "password", type: "password", title: "Şifre"},
$log.debug("not valid"); {type: 'submit', title: 'Giriş Yap'}
} ];
}; });
$log.debug('login attempt: ', $rootScope.loginAttempt); $scope.loggingIn = false;
$scope.onSubmit = function (form) {
$scope.$broadcast('schemaFormValidate');
if (form.$valid) {
$scope.loggingIn = true;
$rootScope.loginAttempt = 1;
LoginService.login($scope.url, $scope.model)
.error(function (data) {
$scope.message = data.title;
})
.then(function () {
$scope.loggingIn = false;
})
}
else {
$log.debug("not valid");
}
};
$log.debug('login attempt: ', $rootScope.loginAttempt);
}); });
\ No newline at end of file \ No newline at end of file
...@@ -8,39 +8,44 @@ ...@@ -8,39 +8,44 @@
"use strict"; "use strict";
// TODO: login url change with correct one angular.module('ulakbus.auth')
/**
auth.factory('LoginService', function ($http, $rootScope, $location, $log, RESTURL) { * @ngdoc service
var loginService = {}; * @name LoginService
* @description
loginService.login = function (url, credentials) { * LoginService provides generic functions for authorization process.
credentials['cmd'] = "do"; */
return $http .factory('LoginService', function ($http, $rootScope, $location, $log, RESTURL) {
.post(RESTURL.url + url, credentials) var loginService = {};
.success(function (data, status, headers, config) {
//$window.sessionStorage.token = data.token; loginService.login = function (url, credentials) {
credentials['cmd'] = "do";
$rootScope.loggedInUser = true; return $http
}) .post(RESTURL.url + url, credentials)
.error(function (data, status, headers, config) { .success(function (data, status, headers, config) {
// Handle login errors here //$window.sessionStorage.token = data.token;
return data;
$rootScope.loggedInUser = true;
})
.error(function (data, status, headers, config) {
// Handle login errors here
return data;
});
};
loginService.logout = function () {
$log.debug("logout");
return $http.post(RESTURL.url + 'logout', {}).success(function (data) {
$rootScope.loggedInUser = false;
$log.debug("loggedout");
$location.path("/login");
}); });
}; };
loginService.logout = function () {
$log.debug("logout");
return $http.post(RESTURL.url + 'logout', {}).success(function (data) {
$rootScope.loggedInUser = false;
$log.debug("loggedout");
$location.path("/login");
});
};
loginService.isValidEmail = function (email) { loginService.isValidEmail = function (email) {
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
return re.test(email); return re.test(email);
}; };
return loginService; return loginService;
}); });
\ No newline at end of file \ No newline at end of file
...@@ -258,6 +258,10 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService']) ...@@ -258,6 +258,10 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
CrudUtility.generateParam($scope, $routeParams, $routeParams.cmd); CrudUtility.generateParam($scope, $routeParams, $routeParams.cmd);
Generator.get_wf($scope); Generator.get_wf($scope);
} }
if ($scope.object) {
$scope.createListObjects();
}
}; };
$scope.reloadCmd = function () { $scope.reloadCmd = function () {
$scope.reload({}); $scope.reload({});
...@@ -280,6 +284,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService']) ...@@ -280,6 +284,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
}) })
/**
* @ngdoc directive
* @name crudListDirective
* @module ulakbus.crud
* @description
* directive for listing objects.
* provides template for `scope.objects` object.
*/
.directive('crudListDirective', function () { .directive('crudListDirective', function () {
return { return {
templateUrl: 'components/crud/templates/list.html', templateUrl: 'components/crud/templates/list.html',
...@@ -287,7 +299,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService']) ...@@ -287,7 +299,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
replace: true replace: true
}; };
}) })
/**
* @ngdoc directive
* @name crudFormDirective
* @module ulakbus.crud
* @description
* directive for form generation.
* provides template for `scope.forms` object.
*/
.directive('crudFormDirective', function () { .directive('crudFormDirective', function () {
return { return {
templateUrl: 'components/crud/templates/form.html', templateUrl: 'components/crud/templates/form.html',
...@@ -295,7 +314,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService']) ...@@ -295,7 +314,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
replace: true replace: true
}; };
}) })
/**
* @ngdoc directive
* @name crudShowDirective
* @module ulakbus.crud
* @description
* directive for single object or detail of an object.
* provides template for `scope.object` object.
*/
.directive('crudShowDirective', function () { .directive('crudShowDirective', function () {
return { return {
templateUrl: 'components/crud/templates/show.html', templateUrl: 'components/crud/templates/show.html',
...@@ -303,7 +329,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService']) ...@@ -303,7 +329,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
replace: true replace: true
}; };
}) })
/**
* @ngdoc directive
* @name formLocator
* @module ulakbus.crud
* @description
* directive for finding form element. we use this directive because when form dynamically generated using
* schemaform it belongs to a scope which is hard to reach. This makes it easy to locate form object.
*/
.directive('formLocator', function () { .directive('formLocator', function () {
return { return {
link: function (scope) { link: function (scope) {
...@@ -312,6 +345,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService']) ...@@ -312,6 +345,14 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
} }
}) })
/**
* @ngdoc directive
* @name crudFilters
* @module ulakbus.crud
* @description
* directive for filtering functionality. There are three types of filters; `check`, `select`, and `date`.
* @todo filter items returns unselected in response object
*/
.directive('crudFilters', function(Generator) { .directive('crudFilters', function(Generator) {
return { return {
templateUrl: 'components/crud/templates/filter.html', templateUrl: 'components/crud/templates/filter.html',
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
'use strict'; 'use strict';
app.config(['$routeProvider', function ($routeProvider) { angular.module('ulakbus').config(['$routeProvider', function ($routeProvider) {
$routeProvider $routeProvider
.when('/error/500', { .when('/error/500', {
templateUrl: 'components/error_pages/500.html', templateUrl: 'components/error_pages/500.html',
......
...@@ -8,7 +8,14 @@ ...@@ -8,7 +8,14 @@
'use strict'; 'use strict';
var app = angular.module( /**
* @ngdoc module
* @name ulakbus
* @description
* Ulakbus module is the main module of ulakbus-ui. All application-wide configurations and definings of constants
* handled in this module.
*/
angular.module(
'ulakbus', [ 'ulakbus', [
'ui.bootstrap', 'ui.bootstrap',
'angular-loading-bar', 'angular-loading-bar',
...@@ -31,43 +38,47 @@ var app = angular.module( ...@@ -31,43 +38,47 @@ var app = angular.module(
// @if NODE_ENV='DEVELOPMENT' // @if NODE_ENV='DEVELOPMENT'
'ulakbus.uitemplates' 'ulakbus.uitemplates'
// @endif // @endif
]). ])
/** /**
* RESTURL is the url of rest api to talk * @ngdoc object
* Based on the environment it changes from dev to prod * @name RESTURL
*/ * @module ulakbus
constant("RESTURL", (function () { * @description
// todo: below backendurl definition is for development purpose and will be deleted * RESTURL is the url of rest api to talk
var backendurl = location.href.indexOf('nightly') > -1 ? "//nightly.api.ulakbus.net/" : "//api.ulakbus.net/"; * Based on the environment it changes from dev to prod
if (document.cookie.indexOf("backendurl") > -1) { */
var cookiearray = document.cookie.split(';'); .constant("RESTURL", (function () {
angular.forEach(cookiearray, function (item) { // todo: below backendurl definition is for development purpose and will be deleted
if (item.indexOf("backendurl") > -1) { var backendurl = location.href.indexOf('nightly') > -1 ? "//nightly.api.ulakbus.net/" : "//api.ulakbus.net/";
backendurl = item.split('=')[1]; if (document.cookie.indexOf("backendurl") > -1) {
} var cookiearray = document.cookie.split(';');
}); angular.forEach(cookiearray, function (item) {
} if (item.indexOf("backendurl") > -1) {
backendurl = item.split('=')[1];
}
});
}
if (location.href.indexOf("backendurl") > -1) { if (location.href.indexOf("backendurl") > -1) {
var urlfromqstr = location.href.split('?')[1].split('=')[1]; var urlfromqstr = location.href.split('?')[1].split('=')[1];
backendurl = decodeURIComponent(urlfromqstr.replace(/\+/g, " ")); backendurl = decodeURIComponent(urlfromqstr.replace(/\+/g, " "));
document.cookie = "backendurl=" + backendurl; document.cookie = "backendurl=" + backendurl;
window.location.href = window.location.href.split('?')[0]; window.location.href = window.location.href.split('?')[0];
} }
return {url: backendurl}; return {url: backendurl};
})()). })()).
/** /**
* USER_ROLES and AUTH_EVENTS are constant for auth functions * USER_ROLES and AUTH_EVENTS are constant for auth functions
*/ */
constant("USER_ROLES", { constant("USER_ROLES", {
all: "*", all: "*",
admin: "admin", admin: "admin",
student: "student", student: "student",
staff: "staff", staff: "staff",
dean: "dean" dean: "dean"
}). })
constant('AUTH_EVENTS', { .constant('AUTH_EVENTS', {
loginSuccess: 'auth-login-success', loginSuccess: 'auth-login-success',
loginFailed: 'auth-login-failed', loginFailed: 'auth-login-failed',
logoutSuccess: 'auth-logout-success', logoutSuccess: 'auth-logout-success',
...@@ -82,10 +93,4 @@ constant("USER_ROLES", { ...@@ -82,10 +93,4 @@ constant("USER_ROLES", {
// @if NODE_ENV='DEVELOPMENT' // @if NODE_ENV='DEVELOPMENT'
$logProvider.debugEnabled(true); $logProvider.debugEnabled(true);
// @endif // @endif
}); });
\ No newline at end of file
// test the code with strict di mode to see if it works when minified
//angular.bootstrap(document, ['ulakbus'], {
// strictDi: true
//});
...@@ -6,11 +6,14 @@ ...@@ -6,11 +6,14 @@
* (GPLv3). See LICENSE.txt for details. * (GPLv3). See LICENSE.txt for details.
*/ */
/** angular.module('ulakbus')
* logout directive /**
*/ * @ngdoc directive
* @name logout
app.directive('logout', function ($http, $location, RESTURL) { * @description
* logout directive provides a button with click event. When triggered it post to /logout path of the API.
*/
.directive('logout', function ($http, $location, RESTURL) {
return { return {
link: function ($scope, $element, $rootScope) { link: function ($scope, $element, $rootScope) {
$element.on('click', function () { $element.on('click', function () {
...@@ -22,11 +25,16 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -22,11 +25,16 @@ app.directive('logout', function ($http, $location, RESTURL) {
} }
}; };
}) })
/** /**
* headerNotification directive for header * @ngdoc directive
* @name headerNotification
* @description
* This directive is responsible to get and show notification.
* It calls API's /notify path with given interval and broadcasts `notifications` application-wide.
* There are 4 types of notifications:
* 1: tasks, 2: messages, 3: announcements, 4: recents
* - Notifications can be disabled in /dev/settings page
*/ */
.directive('headerNotification', function ($http, $rootScope, $cookies, $interval, RESTURL) { .directive('headerNotification', function ($http, $rootScope, $cookies, $interval, RESTURL) {
return { return {
templateUrl: 'shared/templates/directives/header-notification.html', templateUrl: 'shared/templates/directives/header-notification.html',
...@@ -61,6 +69,7 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -61,6 +69,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
// when clicked mark as read notification // when clicked mark as read notification
// it can be list of notifications // it can be list of notifications
// todo: do it in detail page of notification
$scope.markAsRead = function (items) { $scope.markAsRead = function (items) {
$http.post(RESTURL.url + "notify", {ignoreLoadingBar: true, read: [items]}) $http.post(RESTURL.url + "notify", {ignoreLoadingBar: true, read: [items]})
.success(function (data) { .success(function (data) {
...@@ -76,9 +85,12 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -76,9 +85,12 @@ app.directive('logout', function ($http, $location, RESTURL) {
} }
}; };
}) })
/** /**
* * @ngdoc directive
* @name searchDirective
* @description
* This directive provides reusable search form application-wide.
* When search form submitted and response returns, it broadcasts the result with key `updateObjects`.
*/ */
.directive('searchDirective', function (Generator, $log, $rootScope) { .directive('searchDirective', function (Generator, $log, $rootScope) {
return { return {
...@@ -130,8 +142,10 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -130,8 +142,10 @@ app.directive('logout', function ($http, $location, RESTURL) {
} }
}; };
}) })
/** /**
* @ngdoc directive
* @name sortDirective
* @description
* *
*/ */
.directive('sortDirective', function (Generator, $log) { .directive('sortDirective', function (Generator, $log) {
...@@ -180,13 +194,12 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -180,13 +194,12 @@ app.directive('logout', function ($http, $location, RESTURL) {
} }
}; };
}) })
/** /**
* collapseMenu directive * @ngdoc directive
* @name collapseMenu
* @description
* toggle collapses sidebar menu when clicked menu button * toggle collapses sidebar menu when clicked menu button
*/ */
.directive('collapseMenu', function ($timeout, $window, $cookies) { .directive('collapseMenu', function ($timeout, $window, $cookies) {
return { return {
templateUrl: 'shared/templates/directives/menuCollapse.html', templateUrl: 'shared/templates/directives/menuCollapse.html',
...@@ -224,11 +237,12 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -224,11 +237,12 @@ app.directive('logout', function ($http, $location, RESTURL) {
} }
}; };
}) })
/** /**
* headerSubmenu directive * @ngdoc directive
* @name headerSubmenu
* @description
*
*/ */
.directive('headerSubMenu', function ($location) { .directive('headerSubMenu', function ($location) {
return { return {
templateUrl: 'shared/templates/directives/header-sub-menu.html', templateUrl: 'shared/templates/directives/header-sub-menu.html',
...@@ -243,12 +257,12 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -243,12 +257,12 @@ app.directive('logout', function ($http, $location, RESTURL) {
} }
}; };
}) })
/** /**
* breadcrumb directive * @ngdoc directive
* @name breadcrumb
* @description
* produces breadcrumb with related links * produces breadcrumb with related links
*/ */
.directive('headerBreadcrumb', function ($location) { .directive('headerBreadcrumb', function ($location) {
return { return {
templateUrl: 'shared/templates/directives/header-breadcrumb.html', templateUrl: 'shared/templates/directives/header-breadcrumb.html',
...@@ -261,12 +275,12 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -261,12 +275,12 @@ app.directive('logout', function ($http, $location, RESTURL) {
} }
}; };
}) })
/** /**
* selected user directive * @ngdoc directive
* todo: unused * @name selectedUser
* @description
*
*/ */
.directive('selectedUser', function ($http, RESTURL) { .directive('selectedUser', function ($http, RESTURL) {
return { return {
templateUrl: 'shared/templates/directives/selected-user.html', templateUrl: 'shared/templates/directives/selected-user.html',
...@@ -295,14 +309,14 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -295,14 +309,14 @@ app.directive('logout', function ($http, $location, RESTURL) {
} }
}; };
}) })
/** /**
* sidebar directive * @ngdoc directive
* @name sidebar
* @description
* changes breadcrumb when an item selected * changes breadcrumb when an item selected
* consists of menu items of related user or transaction * consists of menu items of related user or transaction
* controller communicates with dashboard controller to shape menu items and authz * controller communicates with dashboard controller to shape menu items and authz
*/ */
.directive('sidebar', ['$location', function () { .directive('sidebar', ['$location', function () {
return { return {
templateUrl: 'shared/templates/directives/sidebar.html', templateUrl: 'shared/templates/directives/sidebar.html',
...@@ -459,7 +473,12 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -459,7 +473,12 @@ app.directive('logout', function ($http, $location, RESTURL) {
} }
}; };
}]) }])
/**
* @ngdoc directive
* @name stats
* @description
*
*/
.directive('stats', function () { .directive('stats', function () {
return { return {
templateUrl: 'shared/templates/directives/stats.html', templateUrl: 'shared/templates/directives/stats.html',
...@@ -478,11 +497,12 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -478,11 +497,12 @@ app.directive('logout', function ($http, $location, RESTURL) {
}; };
}) })
/** /**
* header menu notifications directive * @ngdoc directive
* @name notifications
* @description
*
*/ */
.directive('notifications', function () { .directive('notifications', function () {
return { return {
templateUrl: 'shared/templates/directives/notifications.html', templateUrl: 'shared/templates/directives/notifications.html',
...@@ -490,11 +510,12 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -490,11 +510,12 @@ app.directive('logout', function ($http, $location, RESTURL) {
replace: true replace: true
}; };
}) })
/** /**
* msgbox directive * @ngdoc directive
* @name msgbox
* @description
*
*/ */
.directive('msgbox', function () { .directive('msgbox', function () {
return { return {
templateUrl: 'shared/templates/directives/msgbox.html', templateUrl: 'shared/templates/directives/msgbox.html',
...@@ -502,12 +523,12 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -502,12 +523,12 @@ app.directive('logout', function ($http, $location, RESTURL) {
replace: false replace: false
}; };
}) })
/** /**
* alert directive * @ngdoc directive
* @name alertBox
* @description
*
*/ */
.directive('alertBox', function ($timeout) { .directive('alertBox', function ($timeout) {
return { return {
templateUrl: 'shared/templates/directives/alert.html', templateUrl: 'shared/templates/directives/alert.html',
...@@ -523,11 +544,12 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -523,11 +544,12 @@ app.directive('logout', function ($http, $location, RESTURL) {
} }
}; };
}) })
/** /**
* search directive in sidebar * @ngdoc directive
* @name sidebarSearch
* @description
*
*/ */
.directive('sidebarSearch', function () { .directive('sidebarSearch', function () {
return { return {
templateUrl: 'shared/templates/directives/sidebar-search.html', templateUrl: 'shared/templates/directives/sidebar-search.html',
...@@ -539,7 +561,12 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -539,7 +561,12 @@ app.directive('logout', function ($http, $location, RESTURL) {
} }
}; };
}) })
/**
* @ngdoc directive
* @name fileread
* @description
*
*/
.directive("fileread", function ($timeout) { .directive("fileread", function ($timeout) {
return { return {
scope: { scope: {
...@@ -564,20 +591,4 @@ app.directive('logout', function ($http, $location, RESTURL) { ...@@ -564,20 +591,4 @@ app.directive('logout', function ($http, $location, RESTURL) {
}); });
} }
} }
}); });
\ No newline at end of file
//app.directive('timeline', function () {
// return {
// templateUrl: 'shared/templates/directives/timeline.html',
// restrict: 'E',
// replace: true,
// };
//});
//
//app.directive('chat', function () {
// return {
// templateUrl: 'shared/templates/directives/chat.html',
// restrict: 'E',
// replace: true,
// };
//});
\ No newline at end of file
...@@ -576,7 +576,7 @@ angular.module('formService', ['ui.bootstrap']) ...@@ -576,7 +576,7 @@ angular.module('formService', ['ui.bootstrap'])
url: scope.url, url: scope.url,
wf: scope.wf, wf: scope.wf,
nodeModelChange: function (item) { nodeModelChange: function (item) {
debugger; //debugger;
} }
}); });
...@@ -1045,10 +1045,11 @@ angular.module('formService', ['ui.bootstrap']) ...@@ -1045,10 +1045,11 @@ angular.module('formService', ['ui.bootstrap'])
* @description * @description
* controller for listnode, node and linkedmodel modal and save data of it * controller for listnode, node and linkedmodel modal and save data of it
* @param items * @param items
* @requires $scope, $uibModalInstance, $route * @param $scope
* @param $uibModalInstance
* @param $route
* @returns returns value for modal * @returns returns value for modal
*/ */
.controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) { .controller('ModalCtrl', function ($scope, $uibModalInstance, Generator, items) {
angular.forEach(items, function (value, key) { angular.forEach(items, function (value, key) {
$scope[key] = items[key]; $scope[key] = items[key];
...@@ -1091,7 +1092,9 @@ angular.module('formService', ['ui.bootstrap']) ...@@ -1091,7 +1092,9 @@ angular.module('formService', ['ui.bootstrap'])
}) })
/** /**
* @ngdoc directive
* @name modalForNodes * @name modalForNodes
* @module formService
* @description * @description
* add modal directive for nodes * add modal directive for nodes
* @param $uibModal * @param $uibModal
...@@ -1210,13 +1213,15 @@ angular.module('formService', ['ui.bootstrap']) ...@@ -1210,13 +1213,15 @@ angular.module('formService', ['ui.bootstrap'])
/** /**
* @ngdoc directive
* @name addModalForLinkedModel * @name addModalForLinkedModel
* @module formService
* @description * @description
* add modal directive for linked models * add modal directive for linked models
* @param $uibModal, Generator * @param $uibModal
* @param Generator
* @returns openmodal directive * @returns openmodal directive
*/ */
.directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) { .directive('addModalForLinkedModel', function ($uibModal, $rootScope, $route, Generator) {
return { return {
link: function (scope, element, attributes) { link: function (scope, element, attributes) {
...@@ -1292,7 +1297,7 @@ angular.module('formService', ['ui.bootstrap']) ...@@ -1292,7 +1297,7 @@ angular.module('formService', ['ui.bootstrap'])
scope.$emit('modalFormLocator'); scope.$emit('modalFormLocator');
} }
} }
}) });
/** /**
* @name editModalForLinkedModel * @name editModalForLinkedModel
...@@ -1304,29 +1309,29 @@ angular.module('formService', ['ui.bootstrap']) ...@@ -1304,29 +1309,29 @@ angular.module('formService', ['ui.bootstrap'])
// todo: useless modal check if any use cases?? and delete if useless // todo: useless modal check if any use cases?? and delete if useless
.directive('editModalForLinkedModel', function ($uibModal, Generator) { //.directive('editModalForLinkedModel', function ($uibModal, Generator) {
return { // return {
link: function (scope, element) { // link: function (scope, element) {
element.on('click', function () { // element.on('click', function () {
var modalInstance = $uibModal.open({ // var modalInstance = $uibModal.open({
animation: false, // animation: false,
templateUrl: 'shared/templates/linkedModelModalContent.html', // templateUrl: 'shared/templates/linkedModelModalContent.html',
controller: 'ModalCtrl', // controller: 'ModalCtrl',
size: 'lg', // size: 'lg',
resolve: { // resolve: {
items: function () { // items: function () {
return Generator.get_form({ // return Generator.get_form({
url: 'crud', // url: 'crud',
form_params: {'model': scope.form.title, "cmd": "form"} // form_params: {'model': scope.form.title, "cmd": "form"}
}); // });
} // }
} // }
}); // });
//
modalInstance.result.then(function (childmodel, key) { // modalInstance.result.then(function (childmodel, key) {
Generator.submit(childmodel); // Generator.submit(childmodel);
}); // });
}); // });
} // }
}; // };
}); //});
\ No newline at end of file \ No newline at end of file
...@@ -6,133 +6,149 @@ ...@@ -6,133 +6,149 @@
* (GPLv3). See LICENSE.txt for details. * (GPLv3). See LICENSE.txt for details.
*/ */
app.config(['$httpProvider', function ($httpProvider) { angular.module('ulakbus')
/** .config(['$httpProvider', function ($httpProvider) {
* the interceptor for all requests to check response /**
* 4xx - 5xx errors will be handled here * @ngdoc function
*/ * @name http_interceptor
$httpProvider.interceptors.push(function ($q, $rootScope, $location, $timeout, $log) { * @module ulakbus
return { * @description
'request': function (config) { * The http interceptor for all requests and responses to check and config payload and response objects.
if (config.method === "POST") { * - To prevent OPTIONS preflight request change header Content-Type to `text/plain`.
// to prevent OPTIONS preflight request * - 4xx - 5xx errors are handled in response objects.
config.headers["Content-Type"] = "text/plain"; * - `_debug_queries` is helper object for development purposes to see how long the queries lasts.
} * They are shown in /debug/list' page.
return config; * - API returns `is_login` key to check if current user is authenticated. Interceptor checks and if not logged
}, * in redirects to login page.
'response': function (response) { */
//Will only be called for HTTP up to 300 $httpProvider.interceptors.push(function ($q, $rootScope, $location, $timeout, $log) {
return {
if (response.data._debug_queries) { 'request': function (config) {
if (response.data._debug_queries.length > 0) { if (config.method === "POST") {
$rootScope.debug_queries = $rootScope.debug_queries || []; // to prevent OPTIONS preflight request
$rootScope.debug_queries.push({ config.headers["Content-Type"] = "text/plain";
"url": response.config.url,
"queries": response.data._debug_queries
});
} }
} return config;
},
if (response.data.is_login === false) { 'response': function (response) {
$rootScope.loggedInUser = response.data.is_login; //Will only be called for HTTP up to 300
$location.path("/login");
}
if (response.data.is_login === true) {
$rootScope.loggedInUser = true;
$rootScope.loginAttempt = 1; // this needs for popup errors
if ($location.path() === "/login") {
$location.path("/dashboard");
}
}
// if (response.data.client_cmd) { if (response.data._debug_queries) {
//$location.path(response.data.screen); if (response.data._debug_queries.length > 0) {
// } $rootScope.debug_queries = $rootScope.debug_queries || [];
return response; $rootScope.debug_queries.push({
}, "url": response.config.url,
'responseError': function (rejection) { "queries": response.data._debug_queries
});
}
}
var errorModal = function () { if (response.data.is_login === false) {
if ($rootScope.loginAttempt === 0) { $rootScope.loggedInUser = response.data.is_login;
$log.debug('not logged in, no alert message triggered'); $location.path("/login");
return;
} }
var codefield = ""; if (response.data.is_login === true) {
if (rejection.data.error) { $rootScope.loggedInUser = true;
codefield = '<p><pre>' + $rootScope.loginAttempt = 1; // this needs for popup errors
rejection.data.error + if ($location.path() === "/login") {
'</pre></p>'; $location.path("/dashboard");
}
} }
$('<div class="modal">' + // if (response.data.client_cmd) {
'<div class="modal-dialog" style="width:100%;" role="document">' + //$location.path(response.data.screen);
'<div class="modal-content">' + // }
'<div class="modal-header">' + return response;
'<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span' + },
' aria-hidden="true">&times;</span></button>' + 'responseError': function (rejection) {
'<h4 class="modal-title" id="exampleModalLabel">' +
rejection.status+ rejection.data.title + var errorModal = function () {
'</h4>' + if ($rootScope.loginAttempt === 0) {
'</div>' + $log.debug('not logged in, no alert message triggered');
'<div class="modal-body">' + return;
'<div class="alert alert-danger">' + }
'<strong>' + var codefield = "";
rejection.data.description + if (rejection.data.error) {
'</strong>' + codefield = '<p><pre>' +
codefield + rejection.data.error +
'</div>'+ '</pre></p>';
'</div>' + }
'<div class="modal-footer">' +
'<button type="button" class="btn btn-default" data-dismiss="modal">Kapat</button>' + $('<div class="modal">' +
'</div>' + '<div class="modal-dialog" style="width:100%;" role="document">' +
'</div>' + '<div class="modal-content">' +
'</div>' + '<div class="modal-header">' +
'</div>').modal(); '<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span' +
try { ' aria-hidden="true">&times;</span></button>' +
$('pre:not(.hljs)').each(function(i, block) { '<h4 class="modal-title" id="exampleModalLabel">' +
hljs.highlightBlock(block); rejection.status + rejection.data.title +
'</h4>' +
'</div>' +
'<div class="modal-body">' +
'<div class="alert alert-danger">' +
'<strong>' +
rejection.data.description +
'</strong>' +
codefield +
'</div>' +
'</div>' +
'<div class="modal-footer">' +
'<button type="button" class="btn btn-default" data-dismiss="modal">Kapat</button>' +
'</div>' +
'</div>' +
'</div>' +
'</div>').modal();
try {
$('pre:not(.hljs)').each(function (i, block) {
hljs.highlightBlock(block);
});
}
catch (e) {
$log.debug('Exception: ', e.message);
}
};
if (rejection.status === -1) {
rejection.status = 'Sunucu hatası'
rejection.data = {
title: "", description: 'Sunucu bağlantısında bir hata oluştu.' +
'Lütfen yetkili personelle iletişime geçiniz.'
};
$rootScope.$broadcast('alertBox', {
title: rejection.status,
msg: rejection.data.description,
type: 'error'
}); });
} }
catch (e) {
$log.debug('Exception: ', e.message);
}
};
if (rejection.status === -1) { if (rejection.status === 400) {
rejection.status = 'Sunucu hatası' $location.reload();
rejection.data = {title: "", description : 'Sunucu bağlantısında bir hata oluştu.' +
'Lütfen yetkili personelle iletişime geçiniz.'};
$rootScope.$broadcast('alertBox', {title: rejection.status, msg: rejection.data.description, type: 'error'});
}
if (rejection.status === 400) {
$location.reload();
}
if (rejection.status === 401) {
$location.path('/login');
if ($location.path() === "/login") {
$log.debug("show errors on login form");
} }
} if (rejection.status === 401) {
if (rejection.status === 403) { $location.path('/login');
if (rejection.data.is_login === true) {
$rootScope.loggedInUser = true;
if ($location.path() === "/login") { if ($location.path() === "/login") {
$location.path("/dashboard"); $log.debug("show errors on login form");
} }
} }
//errorModal(); if (rejection.status === 403) {
} if (rejection.data.is_login === true) {
$rootScope.$broadcast('show_notifications', rejection.data); $rootScope.loggedInUser = true;
if ($location.path() === "/login") {
$location.path("/dashboard");
}
}
//errorModal();
}
$rootScope.$broadcast('show_notifications', rejection.data);
if (rejection.status === 404) { if (rejection.status === 404) {
errorModal(); errorModal();
} }
if (rejection.status === 500) { if (rejection.status === 500) {
errorModal(); errorModal();
}
return $q.reject(rejection);
} }
return $q.reject(rejection); };
} });
}; }]);
}); \ No newline at end of file
}]);
\ No newline at end of file
/*! ulakbus-ui 2015-12-28 */ /*! ulakbus-ui 2016-01-14 */
"use strict";var app=angular.module("ulakbus",["ui.bootstrap","angular-loading-bar","ngRoute","ngSanitize","ngCookies","formService","ulakbus.dashboard","ulakbus.auth","ulakbus.error_pages","ulakbus.crud","ulakbus.debug","ulakbus.devSettings","ulakbus.version","gettext","templates-prod"]).constant("RESTURL",function(){var backendurl=location.href.indexOf("nightly")>-1?"//nightly.api.ulakbus.net/":"//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"}).config(function($logProvider){$logProvider.debugEnabled(!1)});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("/dev/settings",{templateUrl:"components/devSettings/devSettings.html",controller:"DevSettingsCtrl"}).when("/debug/list",{templateUrl:"components/debug/debug.html",controller:"DebugCtrl"}).when("/:wf/",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDCtrl"}).when("/:wf/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/:model",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDCtrl"}).when("/:wf/:model/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/:model/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).otherwise({redirectTo:"/dashboard"})}]).run(function($rootScope){$rootScope.loggedInUser=!0,$rootScope.loginAttempt=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,$log){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,$rootScope.loginAttempt=1,"/login"===$location.path()&&$location.path("/dashboard")),response},responseError:function(rejection){var errorModal=function(){if(0===$rootScope.loginAttempt)return void $log.debug("not logged in, no alert message triggered");var codefield="";rejection.data.error&&(codefield="<p><pre>"+rejection.data.error+"</pre></p>"),$('<div class="modal"><div class="modal-dialog" style="width:100%;" 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">'+rejection.status+rejection.data.title+'</h4></div><div class="modal-body"><div class="alert alert-danger"><strong>'+rejection.data.description+"</strong>"+codefield+'</div></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Kapat</button></div></div></div></div>').modal();try{$("pre:not(.hljs)").each(function(i,block){hljs.highlightBlock(block)})}catch(e){$log.debug("Exception: ",e.message)}};return-1===rejection.status&&(rejection.status="Sunucu hatası",rejection.data={title:"",description:"Sunucu bağlantısında bir hata oluştu.Lütfen yetkili personelle iletişime geçiniz."},$rootScope.$broadcast("alertBox",{title:rejection.status,msg:rejection.data.description,type:"error"})),400===rejection.status&&$location.reload(),401===rejection.status&&($location.path("/login"),"/login"===$location.path()&&$log.debug("show errors on login form")),403===rejection.status&&rejection.data.is_login===!0&&($rootScope.loggedInUser=!0,"/login"===$location.path()&&$location.path("/dashboard")),$rootScope.$broadcast("show_notifications",rejection.data),404===rejection.status&&errorModal(),500===rejection.status&&errorModal(),$q.reject(rejection)}}})}]),angular.module("formService",["ui.bootstrap"]).service("Moment",function(){return window.moment}).factory("Generator",function($http,$q,$timeout,$sce,$location,$route,$compile,$log,RESTURL,$rootScope,Moment){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+getparams},generator.generate=function(scope,data){return data.forms?(angular.forEach(data.forms,function(value,key){scope[key]=data.forms[key]}),scope.client_cmd=data.client_cmd,scope.token=data.token,scope.initialModel=angular.copy(scope.model),generator.prepareFormItems(scope),scope.object_id=scope.form_params.object_id,$log.debug("scope at after generate",scope),scope):scope},generator.group=function(scope){if(!scope.grouping)return scope;var newForm=[],extractFormItem=function(itemList){var extractedList=[];return angular.forEach(itemList,function(value,key){var item=getFormItem(value);item&&extractedList.push(item)}),$log.debug("extractedList: ",extractedList),extractedList},getFormItem=function(item){var formItem;return scope.form.indexOf(item)>-1?(formItem=scope.form[scope.form.indexOf(item)],scope.form.splice(scope.form.indexOf(item),1),formItem):(angular.forEach(scope.form,function(value,key){return value.key===item?(formItem=value,void scope.form.splice(key,1)):void 0}),formItem)},makeGroup=function(itemsToGroup){var subItems=[];return angular.forEach(itemsToGroup,function(value,key){subItems.push({type:"fieldset",items:extractFormItem(value.items),title:value.group_title})}),subItems};return angular.forEach(scope.grouping,function(value,key){newForm.push({type:"fieldset",items:makeGroup(value.groups),htmlClass:"col-md-"+value.layout,title:value.group_title})}),$log.debug("grouped form: ",newForm),$log.debug("rest of form: ",scope.form),$log.debug("form united: ",newForm.concat(scope.form)),scope.form=newForm.concat(scope.form),scope},generator.prepareFormItems=function(scope){return angular.forEach(scope.form,function(value,key){"select"===value.type&&(scope.schema.properties[value.key].type="select",scope.schema.properties[value.key].titleMap=value.titleMap,scope.form[key]=value.key)}),angular.forEach(scope.schema.properties,function(v,k){if("form_params"in scope&&k==scope.form_params.param)return scope.model[k]=scope.form_params.id,void scope.form.splice(scope.form.indexOf(k),1);if("file"===v.type&&(scope.form[scope.form.indexOf(k)]={type:"template",title:v.title,templateUrl:"shared/templates/filefield.html",name:k,key:k,fileInsert:function(){$scope.$broadcast("schemaForm.error."+k,"tv4-302",!0)},imageSrc:scope.model[k]?$rootScope.settings.static_url+scope.model[k]:"",avatar:"avatar"===k?!0:!1},v.type="string"),"select"===v.type&&(scope.form[scope.form.indexOf(k)]={type:"template",title:v.title,templateUrl:"shared/templates/select.html",name:k,key:k,titleMap:v.titleMap}),"submit"===v.type||"button"===v.type){var buttonPositions=scope.modalElements?scope.modalElements.buttonPositions:{bottom:"move-to-bottom",top:"move-to-top",none:""},workOnForm=scope.modalElements?scope.modalElements.workOnForm:"formgenerated",workOnDiv=scope.modalElements?scope.modalElements.workOnDiv:"",buttonClass=buttonPositions[v.position]||buttonPositions.bottom,redirectTo=scope.modalElements?!1:!0;scope.form[scope.form.indexOf(k)]={type:v.type,title:v.title,style:"btn-danger hide "+buttonClass,onClick:function(){delete scope.form_params.cmd,delete scope.form_params.flow,v.cmd&&(scope.form_params.cmd=v.cmd),v.flow&&(scope.form_params.flow=v.flow),v.wf&&(delete scope.form_params.cmd,scope.form_params.wf=v.wf),scope.model[k]=1,scope.modalElements?scope.submitModalForm():v.validation===!1?generator.submit(scope,redirectTo):(scope.$broadcast("schemaFormValidate"),scope[workOnForm].$valid&&(generator.submit(scope,redirectTo),scope.$broadcast("disposeModal")))}},$timeout(function(){var selectorBottom=".buttons-on-bottom"+workOnDiv,buttonsToBottom=angular.element(document.querySelector("."+buttonClass));angular.element(document.querySelector(selectorBottom)).append(buttonsToBottom),buttonsToBottom.removeClass("hide")},500)}if("date"===v.type&&($log.debug("date:",scope.model[k]),scope.model[k]=generator.dateformatter(scope.model[k]),scope.form[scope.form.indexOf(k)]={key:k,name:k,title:v.title,type:"template",templateUrl:"shared/templates/datefield.html",validationMessage:{dateNotValid:"Girdiğiniz tarih geçerli değildir. <i>orn: '01.01.2015'<i/>",302:"Bu alan zorunludur."},$asyncValidators:{dateNotValid:function(value){var deferred=$q.defer();return $timeout(function(){if(scope.model[k]=angular.copy(generator.dateformatter(value)),scope.schema.required.indexOf(k)>-1&&deferred.resolve(),value.constructor===Date)deferred.resolve();else{var dateValue=d=value.split(".");isNaN(Date.parse(value))||3!==dateValue.length?deferred.reject():deferred.resolve()}}),deferred.promise}},status:{opened:!1},open:function($event){this.status.opened=!0},format:"dd.MM.yyyy",onSelect:function(){scope.model[k]=angular.copy(generator.dateformatter(scope.model[k]))}}),("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:v.wf,wf:v.wf,form_params:{model:v.model_name,cmd:v.list_cmd}};scope.generateTitleMap=function(modelScope){return generator.get_list(modelScope).then(function(res){return formitem.titleMap=[],angular.forEach(res.data.objects,function(item){-1!==item?formitem.titleMap.push({value:item.key,name:item.value}):formitem.focusToInput=!0}),formitem.titleMap})},scope.model[k]&&generator.get_list({url:"crud",form_params:{model:v.model_name,object_id:scope.model[k],cmd:"object_name"}}).then(function(data){try{scope.$watch(document.querySelector("input[name="+v.model_name+"]"),function(){document.querySelector("input[name="+k+"]").value=data.data.object_name})}catch(e){document.querySelector("input[name="+k+"]").value=data.data.object_name,$log.debug("exception",e)}}),formitem={type:"template",templateUrl:"shared/templates/foreignKey.html",formName:k,title:v.title,wf:v.wf,add_cmd:v.add_cmd,name:k,key:k,model_name:v.model_name,selected_item:{},titleMap:[],onSelect:function(item,inputname){scope.model[k]=item.value,$timeout(function(){document.querySelector("input[name="+inputname+"]").value=item.name})},onDropdownSelect:function(item,inputname){scope.model[k]=item.value,$timeout(function(){document.querySelector("input[name="+inputname+"]").value=item.name})},getTitleMap:function(viewValue){return modelScope.form_params.query=viewValue,scope.generateTitleMap(modelScope)},getDropdownTitleMap:function(){delete modelScope.form_params.query,formitem.gettingTitleMap=!0,scope.generateTitleMap(modelScope).then(function(data){formitem.titleMap=data,formitem.gettingTitleMap=!1})}},scope.form[scope.form.indexOf(k)]=formitem}if(("ListNode"===v.type||"Node"===v.type)&&"filter_interface"===v.widget){var formitem=scope.form[scope.form.indexOf(k)],modelScope={url:v.wf||scope.wf,wf:v.wf||scope.wf,form_params:{model:v.model_name||v.schema[0].model_name,cmd:v.list_cmd||"select_list",query:""}};scope.generateTitleMap=function(modelScope){generator.get_list(modelScope).then(function(res){formitem.titleMap=[],angular.forEach(res.data.objects,function(item){"-1"!==item&&formitem.titleMap.push({value:item.key,name:item.value})}),formitem.filteredItems=generator.get_diff_array(angular.copy(formitem.titleMap),angular.copy(formitem.selectedFilteredItems),1)})};var modelItems=[],modelKeys=[];angular.forEach(scope.model[k],function(value,mkey){modelItems.push({value:value[v.schema[0].name].key,name:value[v.schema[0].name].unicode});var modelKey={};modelKey[v.schema[0].name]=value[v.schema[0].name].key,modelKeys.push(modelKey)}),scope.model[k]=angular.copy(modelKeys),formitem={type:"template",templateUrl:"shared/templates/multiselect.html",title:v.title,formName:k,wf:v.wf,add_cmd:v.add_cmd,name:v.model_name,model_name:v.model_name,filterValue:"",selected_item:{},filteredItems:[],selectedFilteredItems:modelItems,titleMap:scope.generateTitleMap(modelScope),appendFiltered:function(filterValue){filterValue.length>2&&(formitem.filteredItems=[],angular.forEach(formitem.titleMap,function(value,key){value.name.indexOf(filterValue)>-1&&formitem.filteredItems.push(formitem.titleMap[key])})),2>=filterValue&&(formitem.filteredItems=formitem.titleMap),formitem.filteredItems=generator.get_diff_array(formitem.filteredItems,formitem.selectedFilteredItems)},select:function(selectedItemsModel){selectedItemsModel&&(formitem.selectedFilteredItems=formitem.selectedFilteredItems.concat(selectedItemsModel),formitem.appendFiltered(formitem.filterValue),scope.model[k]=(scope.model[k]||[]).concat(formitem.dataToModel(selectedItemsModel)))},deselect:function(selectedFilteredItemsModel){selectedFilteredItemsModel&&(formitem.selectedFilteredItems=generator.get_diff_array(angular.copy(formitem.selectedFilteredItems),angular.copy(selectedFilteredItemsModel)),formitem.appendFiltered(formitem.filterValue),formitem.filteredItems=formitem.filteredItems.concat(selectedFilteredItemsModel),scope.model[k]=generator.get_diff_array(scope.model[k]||[],formitem.dataToModel(selectedFilteredItemsModel)))},dataToModel:function(data){var dataValues=[];return angular.forEach(data,function(value,key){var dataKey={};dataKey[v.schema[0].name]=value.value,dataValues.push(dataKey)}),dataValues}},scope.form[scope.form.indexOf(k)]=formitem}"ListNode"!==v.type&&"Node"!==v.type||"filter_interface"===v.widget||(scope[v.type]=scope[v.type]||{},scope[v.type][k]=angular.copy({title:v.title,form:[],schema:{properties:{},required:[],title:v.title,type:"object",formType:v.type,model_name:k,inline_edit:scope.inline_edit},url:scope.url,wf:scope.wf,nodeModelChange:function(item){}}),angular.forEach(v.schema,function(item){scope[v.type][k].schema.properties[item.name]=angular.copy(item),item.required===!0&&"idx"!==item.name&&scope[v.type][k].schema.required.push(angular.copy(item.name)),"idx"!==item.name&&scope[v.type][k].form.push(item.name);try{"date"===item.type&&(scope.model[k][item.name]=generator.dateformatter(scope.model[k][item.name]))}catch(e){$log.debug("Error: ",e.message)}}),$timeout(function(){"ListNode"===v.type&&(scope[v.type][k].items=angular.copy(scope.model[k]||[]),angular.forEach(scope[v.type][k].items,function(value,key){value.constructor===Object&&angular.forEach(value,function(x,y){try{"date"===scope[v.type][k].schema.properties[y].type&&(scope[v.type][k].items[key][y]=generator.dateformatter(x),scope[v.type][k].model[key][y]=generator.dateformatter(x)),"select"===scope[v.type][k].schema.properties[y].type&&(scope[v.type][k].items[key][y]=generator.item_from_array(x.toString(),scope[v.type][k].schema.properties[y].titleMap))}catch(e){$log.debug("Field is not date")}})}))}),scope.model[k]&&angular.forEach(scope.model[k],function(value,key){angular.forEach(value,function(y,x){y.constructor===Object&&(scope.model[k][key][x]=y.key)})}),scope.model[k]=scope.model[k]||[],scope[v.type][k].model=scope.model[k],scope[v.type][k].lengthModels=scope.model[k]?1:0)}),$log.debug("scope at after prepareformitems",scope),generator.group(scope)},generator.dateformatter=function(formObject){var ndate=new Date(formObject);if(isNaN(ndate))return"";var newdatearray=Moment(ndate).format("DD.MM.YYYY");return $log.debug("date formatted: ",newdatearray),newdatearray},generator.doItemAction=function($scope,key,todo,mode){var _do={normal:function(){return $log.debug("normal mode starts"),$scope.form_params.cmd=todo.cmd,todo.wf&&($scope.url=todo.wf,$scope.form_params.wf=todo.wf,delete $scope.token,delete $scope.form_params.model,delete $scope.form_params.cmd),todo.object_key?$scope.form_params[todo.object_key]=key:$scope.form_params.object_id=key,$scope.form_params.param=$scope.param,$scope.form_params.id=$scope.param_id,$scope.form_params.token=$scope.token,generator.get_wf($scope)},modal:function(){$log.debug("modal mode is not not ready")},"new":function(){$log.debug("new mode is not not ready")}};return _do[mode]()},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.post(generator.makeUrl(scope),scope.form_params).then(function(res){return res})},generator.get_wf=function(scope){return $http.post(generator.makeUrl(scope),scope.form_params).then(function(res){if(res.data.client_cmd)return generator.pathDecider(res.data.client_cmd,scope,res.data);if(res.data.msgbox){scope.msgbox=res.data.msgbox;var newElement=$compile("<msgbox></msgbox>")(scope);angular.element(document.querySelector(".main.ng-scope")).children().remove(),angular.element(document.querySelector(".main.ng-scope")).append(newElement)}})},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.isValidDate=function(dateValue){return!isNaN(Date.parse(dateValue))},generator.pageData={},generator.getPageData=function(){return generator.pageData},generator.setPageData=function(value){generator.pageData=value},generator.pathDecider=function(client_cmd,$scope,data){function redirectTo(scope,page){var pathUrl="/"+scope.form_params.wf;return pathUrl+=scope.form_params.model?"/"+scope.form_params.model+"/do/"+page:"/do/"+page,$location.path()===pathUrl?$route.reload():void $location.path(pathUrl)}function dispatchClientCmd(){data[$scope.form_params.param]=$scope.form_params.id,data.model=$scope.form_params.model,data.wf=$scope.form_params.wf,data.param=$scope.form_params.param,data.param_id=$scope.form_params.id,data.pageData=!0,data.second_client_cmd=client_cmd[1],generator.setPageData(data),redirectTo($scope,client_cmd[0])}return"reload"===client_cmd[0]||"reset"===client_cmd[0]?void $rootScope.$broadcast("reload_cmd",$scope.reload_cmd):void dispatchClientCmd()},generator.get_diff=function(obj1,obj2){var result={};return angular.forEach(obj1,function(value,key){obj2[key]!=obj1[key]&&(result[key]=angular.copy(obj1[key])),obj2[key].constructor===Array&&obj1[key].constructor===Array&&(result[key]=arguments.callee(obj1[key],obj2[key])),obj2[key].constructor===Object&&obj1[key].constructor===Object&&(result[key]=arguments.callee(obj1[key],obj2[key]))}),result},generator.get_diff_array=function(array1,array2,way){var result=[];return angular.forEach(array1,function(value,key){1===way?angular.toJson(array2).indexOf(value.value)<0&&result.push(value):angular.toJson(array2).indexOf(angular.toJson(value))<0&&result.push(value)}),result},generator.item_from_array=function(item,array){var result=item;return angular.forEach(array,function(value,key){value.value===item&&(result=value.name)}),result},generator.submit=function($scope,redirectTo){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,token:$scope.token,model:$scope.form_params.model,cmd:$scope.form_params.cmd,flow:$scope.form_params.flow,object_id:$scope.object_id,filter:$scope.filter,query:$scope.form_params.query};return $http.post(generator.makeUrl($scope),data).success(function(data,status,headers){if("application/pdf"===headers("content-type")){var a=document.createElement("a");document.body.appendChild(a),a.style="display: none";var file=new Blob([data],{type:"application/pdf"}),fileURL=URL.createObjectURL(file),fileName=$scope.schema.title;a.href=fileURL,a.download=fileName,a.click()}if(redirectTo===!0&&(data.client_cmd&&generator.pathDecider(data.client_cmd,$scope,data),data.msgbox)){$scope.msgbox=data.msgbox;var newElement=$compile("<msgbox></msgbox>")($scope);angular.element(document.querySelector(".main.ng-scope")).children().remove(),angular.element(document.querySelector(".main.ng-scope")).append(newElement)}})},generator}).controller("ModalCtrl",function($scope,$uibModalInstance,Generator,items){angular.forEach(items,function(value,key){$scope[key]=items[key]}),$scope.$on("disposeModal",function(){$scope.cancel()}),$scope.$on("modalFormLocator",function(event){$scope.linkedModelForm=event.targetScope.linkedModelForm}),$scope.$on("submitModalForm",function(){$scope.onSubmit($scope.linkedModelForm)}),$scope.$on("validateModalDate",function(event,field){$scope.$broadcast("schemaForm.error."+field,"tv4-302",!0)}),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid&&$uibModalInstance.close($scope)},$scope.onNodeSubmit=function(){$scope.$broadcast("schemaFormValidate"),$scope.modalForm.$valid&&$uibModalInstance.close($scope)},$scope.cancel=function(){$uibModalInstance.dismiss("cancel")}}).directive("modalForNodes",function($uibModal,Generator){return{link:function(scope,element,attributes){element.on("click",function(){var modalInstance=$uibModal.open({animation:!0,backdrop:"static",keyboard:!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]]);"add"===attribs[2]&&(node.model={}),attribs[3]&&(node.model=node.model[attribs[3]]),node.edit=attribs[3],scope.node.schema.wf=scope.node.url,angular.forEach(scope.node.schema.properties,function(value,key){scope.node.schema.properties[key].wf=scope.node.url,scope.node.schema.properties[key].list_cmd="select_list"});var newscope={wf:scope.node.wf,url:scope.node.url,form_params:{model:scope.node.schema.model_name},edit:attribs[3]};return Generator.generate(newscope,{forms:scope.node}),newscope.model=newscope.model[node.edit]||newscope.model[0]||{},newscope}}});modalInstance.result.then(function(childmodel,key){var listNodeItem=scope.$parent[childmodel.schema.formType][childmodel.schema.model_name];if("Node"===childmodel.schema.formType&&(listNodeItem.model=angular.copy(childmodel.model),listNodeItem.lengthModels+=1),"ListNode"===childmodel.schema.formType){var reformattedModel={};angular.forEach(childmodel.model,function(value,key){key.indexOf("_id")>-1?angular.forEach(childmodel.form,function(v,k){function indexInTitleMap(element,index,array){return element.value===value?element:void 0}v.formName===key&&(reformattedModel[key]={key:value,unicode:v.titleMap.find(indexInTitleMap).name})}):reformattedModel[key]={key:key,unicode:Generator.item_from_array(value,childmodel.schema.properties[key].titleMap)}}),childmodel.edit?(listNodeItem.model[childmodel.edit]=childmodel.model,Object.keys(reformattedModel).length>0?listNodeItem.items[childmodel.edit]=reformattedModel:listNodeItem.items[childmodel.edit]=angular.copy(childmodel.model)):(listNodeItem.model.push(angular.copy(childmodel.model)),Object.keys(reformattedModel).length>0?listNodeItem.items.push(reformattedModel):listNodeItem.items.push(angular.copy(childmodel.model))),listNodeItem.lengthModels+=1}})})}}}).directive("addModalForLinkedModel",function($uibModal,$rootScope,$route,Generator){return{link:function(scope,element,attributes){element.on("click",function(){var modalInstance=$uibModal.open({animation:!0,backdrop:"static",keyboard:!1,templateUrl:"shared/templates/linkedModelModalContent.html",controller:"ModalCtrl",size:"lg",resolve:{items:function(){var formName=attributes.addModalForLinkedModel;return Generator.get_form({url:scope.form.wf,wf:scope.form.wf,form_params:{model:scope.form.model_name,cmd:scope.form.add_cmd},modalElements:{buttonPositions:{bottom:"move-to-bottom-modal",top:"move-to-top-modal",none:""},workOnForm:"linkedModelForm",workOnDiv:"-modal"+formName},submitModalForm:function(){$rootScope.$broadcast("submitModalForm")},validateModalDate:function(field){$rootScope.$broadcast("validateModalDate",field)},formName:formName})}}});modalInstance.result.then(function(childscope,key){var formName=childscope.formName;Generator.submit(childscope,!1).success(function(data){scope.model[formName]=data.forms.model.object_key,scope.form.titleMap.push({value:data.forms.model.object_key,name:data.forms.model.unicode}),scope.form.selected_item={value:data.forms.model.object_key,name:data.forms.model.unicode},scope.$watch(document.querySelector("input[name="+scope.form.model_name+"]"),function(){angular.element(document.querySelector("input[name="+scope.form.model_name+"]")).val(scope.form.selected_item.name)})})})})}}}).directive("modalFormLocator",function(){return{link:function(scope){scope.$emit("modalFormLocator")}}}).directive("editModalForLinkedModel",function($uibModal,Generator){return{link:function(scope,element){element.on("click",function(){var modalInstance=$uibModal.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:"form"}})}}});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")})})}}}).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")&&$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)})}}}).directive("searchDirective",function(Generator,$log,$rootScope){return{templateUrl:"shared/templates/directives/search.html",restrict:"E",replace:!0,link:function($scope){$scope.searchForm=[{key:"searchbox",htmlClass:"pull-left"},{type:"submit",title:"Ara",style:"btn-info",htmlClass:"pull-left"}],$scope.searchSchema={type:"object",properties:{searchbox:{type:"string",minLength:2,title:"Ara","x-schema-form":{placeholder:"Arama kriteri giriniz..."}}},required:[]},$scope.searchModel={searchbox:""},$scope.searchSubmit=function(form){if($scope.$broadcast("schemaFormValidate"),form.$valid){var searchparams={url:$scope.wf,token:$scope.$parent.token,object_id:$scope.$parent.object_id,form_params:{model:$scope.$parent.form_params.model,cmd:$scope.$parent.reload_cmd,flow:$scope.$parent.form_params.flow,query:$scope.searchModel.searchbox}};Generator.submit(searchparams).success(function(data){$rootScope.$broadcast("updateObjects",data.objects)})}}}}}).directive("sortDirective",function(Generator,$log){return{templateUrl:"shared/templates/directives/sort.html",restrict:"E",replace:!0,link:function($scope){$scope.titleMap=[{value:"artan",name:"Artan"},{value:"azalan",name:"Azalan"}],$scope.sortForm=[{key:"sortbox",htmlClass:"pull-left",type:"select",titleMap:$scope.titleMap},{type:"submit",title:"Sırala",htmlClass:"pull-left"}],$scope.sortSchema={type:"object",properties:{sortbox:{type:"select",title:"Sırala"}},required:["sortbox"]},$scope.sortModel={sortbox:""},$scope.sortSubmit=function(form){if($scope.$broadcast("schemaFormValidate"),form.$valid){var sortparams={url:$scope.wf,token:$scope.$parent.token,object_id:$scope.$parent.object_id,form_params:{model:$scope.$parent.form_params.model,cmd:$scope.$parent.reload_cmd,flow:$scope.$parent.form_params.flow,param:"sort",id:$scope.sortModel.sortbox}};Generator.submit(sortparams)}}}}}).directive("collapseMenu",function($timeout,$window,$cookies){return{templateUrl:"shared/templates/directives/menuCollapse.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope){$rootScope.collapsed=!1,$rootScope.sidebarPinned=$cookies.get("sidebarPinned")||0,$scope.collapseToggle=function(){$window.innerWidth>"768"&&($rootScope.collapsed===!1?(jQuery(".sidebar").css("width","62px"),jQuery(".manager-view").css("width","calc(100% - 62px)"),$rootScope.collapsed=!0,$rootScope.sidebarPinned=0,$cookies.put("sidebarPinned",0)):(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=1,$cookies.put("sidebarPinned",1)))},$timeout(function(){"0"===$cookies.get("sidebarPinned")&&$scope.collapseToggle()})}}}).directive("headerSubMenu",function($location){return{templateUrl:"shared/templates/directives/header-sub-menu.html",restrict:"E",replace:!0,link:function($scope){$scope.style="width:calc(100% - 300px);",$scope.$on("$routeChangeStart",function(){$scope.style="/dashboard"===$location.path()?"width:calc(100% - 300px);":"width:%100 !important;"})}}}).directive("headerBreadcrumb",function($location){return{templateUrl:"shared/templates/directives/header-breadcrumb.html",restrict:"E",replace:!1,link:function($scope){$scope.goBack=function(){$location.state()}}}}).directive("selectedUser",function($http,RESTURL){return{templateUrl:"shared/templates/directives/selected-user.html",restrict:"E",replace:!0,link:function($scope,$rootScope){$scope.$on("selectedUser",function($event,data){$scope.selectedUser=data,$scope.dynamicPopover={content:"",name:data.name,tcno:data.tcno,key:data.key,templateUrl:"shared/templates/directives/selectedUserPopover.html",title:"İşlem Yapılan Kişi"}}),$scope.$on("selectedUserTrigger",function($event,data){({model:"Personel",cmd:"show",id:data[1]});$http.get(RESTURL.url+"ara/personel/"+data[1]).success(function(data){})})}}}).directive("sidebar",["$location",function(){return{templateUrl:"shared/templates/directives/sidebar.html", "use strict";angular.module("ulakbus",["ui.bootstrap","angular-loading-bar","ngRoute","ngSanitize","ngCookies","formService","ulakbus.dashboard","ulakbus.auth","ulakbus.error_pages","ulakbus.crud","ulakbus.debug","ulakbus.devSettings","ulakbus.version","gettext","templates-prod"]).constant("RESTURL",function(){var backendurl=location.href.indexOf("nightly")>-1?"//nightly.api.ulakbus.net/":"//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"}).config(function($logProvider){$logProvider.debugEnabled(!1)}),angular.module("ulakbus").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("/dev/settings",{templateUrl:"components/devSettings/devSettings.html",controller:"DevSettingsCtrl"}).when("/debug/list",{templateUrl:"components/debug/debug.html",controller:"DebugCtrl"}).when("/:wf/",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDCtrl"}).when("/:wf/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/:model",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDCtrl"}).when("/:wf/:model/do/:cmd",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).when("/:wf/:model/do/:cmd/:key",{templateUrl:"components/crud/templates/crud.html",controller:"CRUDListFormCtrl"}).otherwise({redirectTo:"/dashboard"})}]).run(function($rootScope){$rootScope.loggedInUser=!0,$rootScope.loginAttempt=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>'}]),angular.module("ulakbus").config(["$httpProvider",function($httpProvider){$httpProvider.interceptors.push(function($q,$rootScope,$location,$timeout,$log){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,$rootScope.loginAttempt=1,"/login"===$location.path()&&$location.path("/dashboard")),response},responseError:function(rejection){var errorModal=function(){if(0===$rootScope.loginAttempt)return void $log.debug("not logged in, no alert message triggered");var codefield="";rejection.data.error&&(codefield="<p><pre>"+rejection.data.error+"</pre></p>"),$('<div class="modal"><div class="modal-dialog" style="width:100%;" 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">'+rejection.status+rejection.data.title+'</h4></div><div class="modal-body"><div class="alert alert-danger"><strong>'+rejection.data.description+"</strong>"+codefield+'</div></div><div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Kapat</button></div></div></div></div>').modal();try{$("pre:not(.hljs)").each(function(i,block){hljs.highlightBlock(block)})}catch(e){$log.debug("Exception: ",e.message)}};return-1===rejection.status&&(rejection.status="Sunucu hatası",rejection.data={title:"",description:"Sunucu bağlantısında bir hata oluştu.Lütfen yetkili personelle iletişime geçiniz."},$rootScope.$broadcast("alertBox",{title:rejection.status,msg:rejection.data.description,type:"error"})),400===rejection.status&&$location.reload(),401===rejection.status&&($location.path("/login"),"/login"===$location.path()&&$log.debug("show errors on login form")),403===rejection.status&&rejection.data.is_login===!0&&($rootScope.loggedInUser=!0,"/login"===$location.path()&&$location.path("/dashboard")),$rootScope.$broadcast("show_notifications",rejection.data),404===rejection.status&&errorModal(),500===rejection.status&&errorModal(),$q.reject(rejection)}}})}]),angular.module("formService",["ui.bootstrap"]).service("Moment",function(){return window.moment}).factory("Generator",function($http,$q,$timeout,$sce,$location,$route,$compile,$log,RESTURL,$rootScope,Moment){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+getparams},generator.generate=function(scope,data){return data.forms?(angular.forEach(data.forms,function(value,key){scope[key]=data.forms[key]}),scope.client_cmd=data.client_cmd,scope.token=data.token,scope.initialModel=angular.copy(scope.model),generator.prepareFormItems(scope),scope.object_id=scope.form_params.object_id,$log.debug("scope at after generate",scope),scope):scope},generator.group=function(scope){if(!scope.grouping)return scope;var newForm=[],extractFormItem=function(itemList){var extractedList=[];return angular.forEach(itemList,function(value,key){var item=getFormItem(value);item&&extractedList.push(item)}),$log.debug("extractedList: ",extractedList),extractedList},getFormItem=function(item){var formItem;return scope.form.indexOf(item)>-1?(formItem=scope.form[scope.form.indexOf(item)],scope.form.splice(scope.form.indexOf(item),1),formItem):(angular.forEach(scope.form,function(value,key){return value.key===item?(formItem=value,void scope.form.splice(key,1)):void 0}),formItem)},makeGroup=function(itemsToGroup){var subItems=[];return angular.forEach(itemsToGroup,function(value,key){subItems.push({type:"fieldset",items:extractFormItem(value.items),title:value.group_title})}),subItems};return angular.forEach(scope.grouping,function(value,key){newForm.push({type:"fieldset",items:makeGroup(value.groups),htmlClass:"col-md-"+value.layout,title:value.group_title})}),$log.debug("grouped form: ",newForm),$log.debug("rest of form: ",scope.form),$log.debug("form united: ",newForm.concat(scope.form)),scope.form=newForm.concat(scope.form),scope},generator.prepareFormItems=function(scope){return angular.forEach(scope.form,function(value,key){"select"===value.type&&(scope.schema.properties[value.key].type="select",scope.schema.properties[value.key].titleMap=value.titleMap,scope.form[key]=value.key)}),angular.forEach(scope.schema.properties,function(v,k){if("form_params"in scope&&k==scope.form_params.param)return scope.model[k]=scope.form_params.id,void scope.form.splice(scope.form.indexOf(k),1);if("file"===v.type&&(scope.form[scope.form.indexOf(k)]={type:"template",title:v.title,templateUrl:"shared/templates/filefield.html",name:k,key:k,fileInsert:function(){$scope.$broadcast("schemaForm.error."+k,"tv4-302",!0)},imageSrc:scope.model[k]?$rootScope.settings.static_url+scope.model[k]:"",avatar:"avatar"===k?!0:!1},v.type="string"),"select"===v.type&&(scope.form[scope.form.indexOf(k)]={type:"template",title:v.title,templateUrl:"shared/templates/select.html",name:k,key:k,titleMap:v.titleMap}),"submit"===v.type||"button"===v.type){var buttonPositions=scope.modalElements?scope.modalElements.buttonPositions:{bottom:"move-to-bottom",top:"move-to-top",none:""},workOnForm=scope.modalElements?scope.modalElements.workOnForm:"formgenerated",workOnDiv=scope.modalElements?scope.modalElements.workOnDiv:"",buttonClass=buttonPositions[v.position]||buttonPositions.bottom,redirectTo=scope.modalElements?!1:!0;scope.form[scope.form.indexOf(k)]={type:v.type,title:v.title,style:"btn-danger hide "+buttonClass,onClick:function(){delete scope.form_params.cmd,delete scope.form_params.flow,v.cmd&&(scope.form_params.cmd=v.cmd),v.flow&&(scope.form_params.flow=v.flow),v.wf&&(delete scope.form_params.cmd,scope.form_params.wf=v.wf),scope.model[k]=1,scope.modalElements?scope.submitModalForm():v.validation===!1?generator.submit(scope,redirectTo):(scope.$broadcast("schemaFormValidate"),scope[workOnForm].$valid&&(generator.submit(scope,redirectTo),scope.$broadcast("disposeModal")))}},$timeout(function(){var selectorBottom=".buttons-on-bottom"+workOnDiv,buttonsToBottom=angular.element(document.querySelector("."+buttonClass));angular.element(document.querySelector(selectorBottom)).append(buttonsToBottom),buttonsToBottom.removeClass("hide")},500)}if("date"===v.type&&($log.debug("date:",scope.model[k]),scope.model[k]=generator.dateformatter(scope.model[k]),scope.form[scope.form.indexOf(k)]={key:k,name:k,title:v.title,type:"template",templateUrl:"shared/templates/datefield.html",validationMessage:{dateNotValid:"Girdiğiniz tarih geçerli değildir. <i>orn: '01.01.2015'<i/>",302:"Bu alan zorunludur."},$asyncValidators:{dateNotValid:function(value){var deferred=$q.defer();return $timeout(function(){if(scope.model[k]=angular.copy(generator.dateformatter(value)),scope.schema.required.indexOf(k)>-1&&deferred.resolve(),value.constructor===Date)deferred.resolve();else{var dateValue=d=value.split(".");isNaN(Date.parse(value))||3!==dateValue.length?deferred.reject():deferred.resolve()}}),deferred.promise}},status:{opened:!1},open:function($event){this.status.opened=!0},format:"dd.MM.yyyy",onSelect:function(){scope.model[k]=angular.copy(generator.dateformatter(scope.model[k]))}}),("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:v.wf,wf:v.wf,form_params:{model:v.model_name,cmd:v.list_cmd}};scope.generateTitleMap=function(modelScope){return generator.get_list(modelScope).then(function(res){return formitem.titleMap=[],angular.forEach(res.data.objects,function(item){-1!==item?formitem.titleMap.push({value:item.key,name:item.value}):formitem.focusToInput=!0}),formitem.titleMap})},scope.model[k]&&generator.get_list({url:"crud",form_params:{model:v.model_name,object_id:scope.model[k],cmd:"object_name"}}).then(function(data){try{scope.$watch(document.querySelector("input[name="+v.model_name+"]"),function(){document.querySelector("input[name="+k+"]").value=data.data.object_name})}catch(e){document.querySelector("input[name="+k+"]").value=data.data.object_name,$log.debug("exception",e)}}),formitem={type:"template",templateUrl:"shared/templates/foreignKey.html",formName:k,title:v.title,wf:v.wf,add_cmd:v.add_cmd,name:k,key:k,model_name:v.model_name,selected_item:{},titleMap:[],onSelect:function(item,inputname){scope.model[k]=item.value,$timeout(function(){document.querySelector("input[name="+inputname+"]").value=item.name})},onDropdownSelect:function(item,inputname){scope.model[k]=item.value,$timeout(function(){document.querySelector("input[name="+inputname+"]").value=item.name})},getTitleMap:function(viewValue){return modelScope.form_params.query=viewValue,scope.generateTitleMap(modelScope)},getDropdownTitleMap:function(){delete modelScope.form_params.query,formitem.gettingTitleMap=!0,scope.generateTitleMap(modelScope).then(function(data){formitem.titleMap=data,formitem.gettingTitleMap=!1})}},scope.form[scope.form.indexOf(k)]=formitem}if(("ListNode"===v.type||"Node"===v.type)&&"filter_interface"===v.widget){var formitem=scope.form[scope.form.indexOf(k)],modelScope={url:v.wf||scope.wf,wf:v.wf||scope.wf,form_params:{model:v.model_name||v.schema[0].model_name,cmd:v.list_cmd||"select_list",query:""}};scope.generateTitleMap=function(modelScope){generator.get_list(modelScope).then(function(res){formitem.titleMap=[],angular.forEach(res.data.objects,function(item){"-1"!==item&&formitem.titleMap.push({value:item.key,name:item.value})}),formitem.filteredItems=generator.get_diff_array(angular.copy(formitem.titleMap),angular.copy(formitem.selectedFilteredItems),1)})};var modelItems=[],modelKeys=[];angular.forEach(scope.model[k],function(value,mkey){modelItems.push({value:value[v.schema[0].name].key,name:value[v.schema[0].name].unicode});var modelKey={};modelKey[v.schema[0].name]=value[v.schema[0].name].key,modelKeys.push(modelKey)}),scope.model[k]=angular.copy(modelKeys),formitem={type:"template",templateUrl:"shared/templates/multiselect.html",title:v.title,formName:k,wf:v.wf,add_cmd:v.add_cmd,name:v.model_name,model_name:v.model_name,filterValue:"",selected_item:{},filteredItems:[],selectedFilteredItems:modelItems,titleMap:scope.generateTitleMap(modelScope),appendFiltered:function(filterValue){filterValue.length>2&&(formitem.filteredItems=[],angular.forEach(formitem.titleMap,function(value,key){value.name.indexOf(filterValue)>-1&&formitem.filteredItems.push(formitem.titleMap[key])})),2>=filterValue&&(formitem.filteredItems=formitem.titleMap),formitem.filteredItems=generator.get_diff_array(formitem.filteredItems,formitem.selectedFilteredItems)},select:function(selectedItemsModel){selectedItemsModel&&(formitem.selectedFilteredItems=formitem.selectedFilteredItems.concat(selectedItemsModel),formitem.appendFiltered(formitem.filterValue),scope.model[k]=(scope.model[k]||[]).concat(formitem.dataToModel(selectedItemsModel)))},deselect:function(selectedFilteredItemsModel){selectedFilteredItemsModel&&(formitem.selectedFilteredItems=generator.get_diff_array(angular.copy(formitem.selectedFilteredItems),angular.copy(selectedFilteredItemsModel)),formitem.appendFiltered(formitem.filterValue),formitem.filteredItems=formitem.filteredItems.concat(selectedFilteredItemsModel),scope.model[k]=generator.get_diff_array(scope.model[k]||[],formitem.dataToModel(selectedFilteredItemsModel)))},dataToModel:function(data){var dataValues=[];return angular.forEach(data,function(value,key){var dataKey={};dataKey[v.schema[0].name]=value.value,dataValues.push(dataKey)}),dataValues}},scope.form[scope.form.indexOf(k)]=formitem}"ListNode"!==v.type&&"Node"!==v.type||"filter_interface"===v.widget||(scope[v.type]=scope[v.type]||{},scope[v.type][k]=angular.copy({title:v.title,form:[],schema:{properties:{},required:[],title:v.title,type:"object",formType:v.type,model_name:k,inline_edit:scope.inline_edit},url:scope.url,wf:scope.wf,nodeModelChange:function(item){}}),angular.forEach(v.schema,function(item){scope[v.type][k].schema.properties[item.name]=angular.copy(item),item.required===!0&&"idx"!==item.name&&scope[v.type][k].schema.required.push(angular.copy(item.name)),"idx"!==item.name&&scope[v.type][k].form.push(item.name);try{"date"===item.type&&(scope.model[k][item.name]=generator.dateformatter(scope.model[k][item.name]))}catch(e){$log.debug("Error: ",e.message)}}),$timeout(function(){"ListNode"===v.type&&(scope[v.type][k].items=angular.copy(scope.model[k]||[]),angular.forEach(scope[v.type][k].items,function(value,key){value.constructor===Object&&angular.forEach(value,function(x,y){try{"date"===scope[v.type][k].schema.properties[y].type&&(scope[v.type][k].items[key][y]=generator.dateformatter(x),scope[v.type][k].model[key][y]=generator.dateformatter(x)),"select"===scope[v.type][k].schema.properties[y].type&&(scope[v.type][k].items[key][y]=generator.item_from_array(x.toString(),scope[v.type][k].schema.properties[y].titleMap))}catch(e){$log.debug("Field is not date")}})}))}),scope.model[k]&&angular.forEach(scope.model[k],function(value,key){angular.forEach(value,function(y,x){y.constructor===Object&&(scope.model[k][key][x]=y.key)})}),scope.model[k]=scope.model[k]||[],scope[v.type][k].model=scope.model[k],scope[v.type][k].lengthModels=scope.model[k]?1:0)}),$log.debug("scope at after prepareformitems",scope),generator.group(scope)},generator.dateformatter=function(formObject){var ndate=new Date(formObject);if(isNaN(ndate))return"";var newdatearray=Moment(ndate).format("DD.MM.YYYY");return $log.debug("date formatted: ",newdatearray),newdatearray},generator.doItemAction=function($scope,key,todo,mode){var _do={normal:function(){return $log.debug("normal mode starts"),$scope.form_params.cmd=todo.cmd,todo.wf&&($scope.url=todo.wf,$scope.form_params.wf=todo.wf,delete $scope.token,delete $scope.form_params.model,delete $scope.form_params.cmd),todo.object_key?$scope.form_params[todo.object_key]=key:$scope.form_params.object_id=key,$scope.form_params.param=$scope.param,$scope.form_params.id=$scope.param_id,$scope.form_params.token=$scope.token,generator.get_wf($scope)},modal:function(){$log.debug("modal mode is not not ready")},"new":function(){$log.debug("new mode is not not ready")}};return _do[mode]()},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.post(generator.makeUrl(scope),scope.form_params).then(function(res){return res})},generator.get_wf=function(scope){return $http.post(generator.makeUrl(scope),scope.form_params).then(function(res){if(res.data.client_cmd)return generator.pathDecider(res.data.client_cmd,scope,res.data);if(res.data.msgbox){scope.msgbox=res.data.msgbox;var newElement=$compile("<msgbox></msgbox>")(scope);angular.element(document.querySelector(".main.ng-scope")).children().remove(),angular.element(document.querySelector(".main.ng-scope")).append(newElement)}})},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.isValidDate=function(dateValue){return!isNaN(Date.parse(dateValue))},generator.pageData={},generator.getPageData=function(){return generator.pageData},generator.setPageData=function(value){generator.pageData=value},generator.pathDecider=function(client_cmd,$scope,data){function redirectTo(scope,page){var pathUrl="/"+scope.form_params.wf;return pathUrl+=scope.form_params.model?"/"+scope.form_params.model+"/do/"+page:"/do/"+page,$location.path()===pathUrl?$route.reload():void $location.path(pathUrl)}function dispatchClientCmd(){data[$scope.form_params.param]=$scope.form_params.id,data.model=$scope.form_params.model,data.wf=$scope.form_params.wf,data.param=$scope.form_params.param,data.param_id=$scope.form_params.id,data.pageData=!0,data.second_client_cmd=client_cmd[1],generator.setPageData(data),redirectTo($scope,client_cmd[0])}return"reload"===client_cmd[0]||"reset"===client_cmd[0]?void $rootScope.$broadcast("reload_cmd",$scope.reload_cmd):void dispatchClientCmd()},generator.get_diff=function(obj1,obj2){var result={};return angular.forEach(obj1,function(value,key){obj2[key]!=obj1[key]&&(result[key]=angular.copy(obj1[key])),obj2[key].constructor===Array&&obj1[key].constructor===Array&&(result[key]=arguments.callee(obj1[key],obj2[key])),obj2[key].constructor===Object&&obj1[key].constructor===Object&&(result[key]=arguments.callee(obj1[key],obj2[key]))}),result},generator.get_diff_array=function(array1,array2,way){var result=[];return angular.forEach(array1,function(value,key){1===way?angular.toJson(array2).indexOf(value.value)<0&&result.push(value):angular.toJson(array2).indexOf(angular.toJson(value))<0&&result.push(value)}),result},generator.item_from_array=function(item,array){var result=item;return angular.forEach(array,function(value,key){value.value===item&&(result=value.name)}),result},generator.submit=function($scope,redirectTo){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,token:$scope.token,model:$scope.form_params.model,cmd:$scope.form_params.cmd,flow:$scope.form_params.flow,object_id:$scope.object_id,filter:$scope.filter,query:$scope.form_params.query};return $http.post(generator.makeUrl($scope),data).success(function(data,status,headers){if("application/pdf"===headers("content-type")){var a=document.createElement("a");document.body.appendChild(a),a.style="display: none";var file=new Blob([data],{type:"application/pdf"}),fileURL=URL.createObjectURL(file),fileName=$scope.schema.title;a.href=fileURL,a.download=fileName,a.click()}if(redirectTo===!0&&(data.client_cmd&&generator.pathDecider(data.client_cmd,$scope,data),data.msgbox)){$scope.msgbox=data.msgbox;var newElement=$compile("<msgbox></msgbox>")($scope);angular.element(document.querySelector(".main.ng-scope")).children().remove(),angular.element(document.querySelector(".main.ng-scope")).append(newElement)}})},generator}).controller("ModalCtrl",function($scope,$uibModalInstance,Generator,items){angular.forEach(items,function(value,key){$scope[key]=items[key]}),$scope.$on("disposeModal",function(){$scope.cancel()}),$scope.$on("modalFormLocator",function(event){$scope.linkedModelForm=event.targetScope.linkedModelForm}),$scope.$on("submitModalForm",function(){$scope.onSubmit($scope.linkedModelForm)}),$scope.$on("validateModalDate",function(event,field){$scope.$broadcast("schemaForm.error."+field,"tv4-302",!0)}),$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid&&$uibModalInstance.close($scope)},$scope.onNodeSubmit=function(){$scope.$broadcast("schemaFormValidate"),$scope.modalForm.$valid&&$uibModalInstance.close($scope)},$scope.cancel=function(){$uibModalInstance.dismiss("cancel")}}).directive("modalForNodes",function($uibModal,Generator){return{link:function(scope,element,attributes){element.on("click",function(){var modalInstance=$uibModal.open({animation:!0,backdrop:"static",keyboard:!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]]);"add"===attribs[2]&&(node.model={}),attribs[3]&&(node.model=node.model[attribs[3]]),node.edit=attribs[3],scope.node.schema.wf=scope.node.url,angular.forEach(scope.node.schema.properties,function(value,key){scope.node.schema.properties[key].wf=scope.node.url,scope.node.schema.properties[key].list_cmd="select_list"});var newscope={wf:scope.node.wf,url:scope.node.url,form_params:{model:scope.node.schema.model_name},edit:attribs[3]};return Generator.generate(newscope,{forms:scope.node}),newscope.model=newscope.model[node.edit]||newscope.model[0]||{},newscope}}});modalInstance.result.then(function(childmodel,key){var listNodeItem=scope.$parent[childmodel.schema.formType][childmodel.schema.model_name];if("Node"===childmodel.schema.formType&&(listNodeItem.model=angular.copy(childmodel.model),listNodeItem.lengthModels+=1),"ListNode"===childmodel.schema.formType){var reformattedModel={};angular.forEach(childmodel.model,function(value,key){key.indexOf("_id")>-1?angular.forEach(childmodel.form,function(v,k){function indexInTitleMap(element,index,array){return element.value===value?element:void 0}v.formName===key&&(reformattedModel[key]={key:value,unicode:v.titleMap.find(indexInTitleMap).name})}):reformattedModel[key]={key:key,unicode:Generator.item_from_array(value,childmodel.schema.properties[key].titleMap)}}),childmodel.edit?(listNodeItem.model[childmodel.edit]=childmodel.model,Object.keys(reformattedModel).length>0?listNodeItem.items[childmodel.edit]=reformattedModel:listNodeItem.items[childmodel.edit]=angular.copy(childmodel.model)):(listNodeItem.model.push(angular.copy(childmodel.model)),Object.keys(reformattedModel).length>0?listNodeItem.items.push(reformattedModel):listNodeItem.items.push(angular.copy(childmodel.model))),listNodeItem.lengthModels+=1}})})}}}).directive("addModalForLinkedModel",function($uibModal,$rootScope,$route,Generator){return{link:function(scope,element,attributes){element.on("click",function(){var modalInstance=$uibModal.open({animation:!0,backdrop:"static",keyboard:!1,templateUrl:"shared/templates/linkedModelModalContent.html",controller:"ModalCtrl",size:"lg",resolve:{items:function(){var formName=attributes.addModalForLinkedModel;return Generator.get_form({url:scope.form.wf,wf:scope.form.wf,form_params:{model:scope.form.model_name,cmd:scope.form.add_cmd},modalElements:{buttonPositions:{bottom:"move-to-bottom-modal",top:"move-to-top-modal",none:""},workOnForm:"linkedModelForm",workOnDiv:"-modal"+formName},submitModalForm:function(){$rootScope.$broadcast("submitModalForm")},validateModalDate:function(field){$rootScope.$broadcast("validateModalDate",field)},formName:formName})}}});modalInstance.result.then(function(childscope,key){var formName=childscope.formName;Generator.submit(childscope,!1).success(function(data){scope.model[formName]=data.forms.model.object_key,scope.form.titleMap.push({value:data.forms.model.object_key,name:data.forms.model.unicode}),scope.form.selected_item={value:data.forms.model.object_key,name:data.forms.model.unicode},scope.$watch(document.querySelector("input[name="+scope.form.model_name+"]"),function(){angular.element(document.querySelector("input[name="+scope.form.model_name+"]")).val(scope.form.selected_item.name)})})})})}}}).directive("modalFormLocator",function(){return{link:function(scope){scope.$emit("modalFormLocator")}}}).directive("editModalForLinkedModel",function($uibModal,Generator){return{link:function(scope,element){element.on("click",function(){var modalInstance=$uibModal.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:"form"}})}}});modalInstance.result.then(function(childmodel,key){Generator.submit(childmodel)})})}}}),angular.module("ulakbus").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")})})}}}).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")&&$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)})}}}).directive("searchDirective",function(Generator,$log,$rootScope){return{templateUrl:"shared/templates/directives/search.html",restrict:"E",replace:!0,link:function($scope){$scope.searchForm=[{key:"searchbox",htmlClass:"pull-left"},{type:"submit",title:"Ara",style:"btn-info",htmlClass:"pull-left"}],$scope.searchSchema={type:"object",properties:{searchbox:{type:"string",minLength:2,title:"Ara","x-schema-form":{placeholder:"Arama kriteri giriniz..."}}},required:[]},$scope.searchModel={searchbox:""},$scope.searchSubmit=function(form){if($scope.$broadcast("schemaFormValidate"),form.$valid){var searchparams={url:$scope.wf,token:$scope.$parent.token,object_id:$scope.$parent.object_id,form_params:{model:$scope.$parent.form_params.model,cmd:$scope.$parent.reload_cmd,flow:$scope.$parent.form_params.flow,query:$scope.searchModel.searchbox}};Generator.submit(searchparams).success(function(data){$rootScope.$broadcast("updateObjects",data.objects)})}}}}}).directive("sortDirective",function(Generator,$log){return{templateUrl:"shared/templates/directives/sort.html",restrict:"E",replace:!0,link:function($scope){$scope.titleMap=[{value:"artan",name:"Artan"},{value:"azalan",name:"Azalan"}],$scope.sortForm=[{key:"sortbox",htmlClass:"pull-left",type:"select",titleMap:$scope.titleMap},{type:"submit",title:"Sırala",htmlClass:"pull-left"}],$scope.sortSchema={type:"object",properties:{sortbox:{type:"select",title:"Sırala"}},required:["sortbox"]},$scope.sortModel={sortbox:""},$scope.sortSubmit=function(form){if($scope.$broadcast("schemaFormValidate"),form.$valid){var sortparams={url:$scope.wf,token:$scope.$parent.token,object_id:$scope.$parent.object_id,form_params:{model:$scope.$parent.form_params.model,cmd:$scope.$parent.reload_cmd,flow:$scope.$parent.form_params.flow,param:"sort",id:$scope.sortModel.sortbox}};Generator.submit(sortparams)}}}}}).directive("collapseMenu",function($timeout,$window,$cookies){return{templateUrl:"shared/templates/directives/menuCollapse.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope){$rootScope.collapsed=!1,$rootScope.sidebarPinned=$cookies.get("sidebarPinned")||0,$scope.collapseToggle=function(){$window.innerWidth>"768"&&($rootScope.collapsed===!1?(jQuery(".sidebar").css("width","62px"),jQuery(".manager-view").css("width","calc(100% - 62px)"),$rootScope.collapsed=!0,$rootScope.sidebarPinned=0,$cookies.put("sidebarPinned",0)):(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=1,$cookies.put("sidebarPinned",1)))},$timeout(function(){"0"===$cookies.get("sidebarPinned")&&$scope.collapseToggle()})}}}).directive("headerSubMenu",function($location){return{templateUrl:"shared/templates/directives/header-sub-menu.html",restrict:"E",replace:!0,link:function($scope){$scope.style="width:calc(100% - 300px);",$scope.$on("$routeChangeStart",function(){$scope.style="/dashboard"===$location.path()?"width:calc(100% - 300px);":"width:%100 !important;"})}}}).directive("headerBreadcrumb",function($location){return{templateUrl:"shared/templates/directives/header-breadcrumb.html",restrict:"E",replace:!1,link:function($scope){$scope.goBack=function(){$location.state()}}}}).directive("selectedUser",function($http,RESTURL){return{templateUrl:"shared/templates/directives/selected-user.html",restrict:"E",replace:!0,link:function($scope,$rootScope){$scope.$on("selectedUser",function($event,data){$scope.selectedUser=data,$scope.dynamicPopover={content:"",name:data.name,tcno:data.tcno,key:data.key,templateUrl:"shared/templates/directives/selectedUserPopover.html",title:"İşlem Yapılan Kişi"}}),$scope.$on("selectedUserTrigger",function($event,data){({model:"Personel",cmd:"show",id:data[1]});$http.get(RESTURL.url+"ara/personel/"+data[1]).success(function(data){})})}}}).directive("sidebar",["$location",function(){
restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope,$cookies,$route,$http,RESTURL,$log,$location,$window,$timeout){$scope.prepareMenu=function(menuItems){var newMenuItems={};return angular.forEach(menuItems,function(value,key){angular.forEach(value,function(v,k){newMenuItems[k]=v})}),newMenuItems};var sidebarmenu=$("#side-menu"),sidebarUserMenu=$("#side-user-menu");sidebarmenu.metisMenu(),$http.get(RESTURL.url+"menu/").success(function(data){function reGroupMenuItems(items,baseCategory){var newItems={};return angular.forEach(items,function(value,key){newItems[value.kategori]=newItems[value.kategori]||[],value.baseCategory=baseCategory,newItems[value.kategori].push(value)}),newItems}$scope.allMenuItems=angular.copy(data),angular.forEach($scope.allMenuItems,function(value,key){"current_user"!==key&&"settings"!==key&&($scope.allMenuItems[key]=reGroupMenuItems(value,key))}),$rootScope.quick_menu=reGroupMenuItems(data.quick_menu,"quick_menus"),$rootScope.quick_menu=data.quick_menu,delete data.quick_menu,$log.debug("quick menu",$rootScope.quick_menu),$rootScope.$broadcast("authz",data),$rootScope.searchInputs=data,$rootScope.current_user=data.current_user,(data.ogrenci||data.personel)&&($rootScope.current_user.can_search=!0),$rootScope.settings=data.settings,$scope.menuItems=$scope.prepareMenu({other:$scope.allMenuItems.other}),$timeout(function(){sidebarmenu.metisMenu(),sidebarUserMenu.metisMenu()})}),$scope.$on("menuitems",function(event,data){var menu={};menu[data]=$scope.allMenuItems[data],$scope.selectedMenuItems=$scope.prepareMenu(menu),$timeout(function(){sidebarUserMenu.metisMenu()})}),$scope.$on("selectedUser",function($event,data){$scope.selectedUser=data}),$scope.deselectUser=function(){delete $scope.selectedUser,delete $scope.selectedMenuItems},$scope.openSidebar=function(){$window.innerWidth>"768"&&0===$rootScope.sidebarPinned&&(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(){$window.innerWidth>"768"&&0===$rootScope.sidebarPinned&&(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=0)}),$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},$scope.multiCheck=function(y){y===$scope.multiCollapseVar?$scope.multiCollapseVar=0:$scope.multiCollapseVar=y}}}}]).directive("stats",function(){return{templateUrl:"shared/templates/directives/stats.html",restrict:"E",replace:!0,scope:{model:"=",comments:"@",number:"@",name:"@",colour:"@",details:"@",type:"@","goto":"@"}}}).directive("notifications",function(){return{templateUrl:"shared/templates/directives/notifications.html",restrict:"E",replace:!0}}).directive("msgbox",function(){return{templateUrl:"shared/templates/directives/msgbox.html",restrict:"E",replace:!1}}).directive("alertBox",function($timeout){return{templateUrl:"shared/templates/directives/alert.html",restrict:"E",replace:!0,link:function($scope){$scope.$on("alertBox",function($event,data){$timeout(function(){delete $scope.alerts},5e3),$scope.alerts=[data]})}}}).directive("sidebarSearch",function(){return{templateUrl:"shared/templates/directives/sidebar-search.html",restrict:"E",replace:!0,scope:{},controller:function($scope){$scope.selectedMenu="home"}}}).directive("fileread",function($timeout){return{scope:{fileread:"="},link:function(scope,element,attributes){element.bind("change",function(changeEvent){var reader=new FileReader;reader.onload=function(loadEvent){scope.$apply(function(){scope.fileread=loadEvent.target.result}),$timeout(function(){scope.$parent.model[changeEvent.target.name]={file_name:changeEvent.target.files[0].name,file_content:scope.$parent.model[changeEvent.target.name]},document.querySelector("#image-preview").src=URL.createObjectURL(changeEvent.target.files[0])})},reader.readAsDataURL(changeEvent.target.files[0])})}}});var auth=angular.module("ulakbus.auth",["ngRoute","schemaForm","ngCookies"]);auth.controller("LoginCtrl",function($scope,$q,$timeout,$routeParams,$rootScope,$log,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.loggingIn=!1,$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid?($scope.loggingIn=!0,$rootScope.loginAttempt=1,LoginService.login($scope.url,$scope.model).error(function(data){$scope.message=data.title}).then(function(){$scope.loggingIn=!1})):$log.debug("not valid")},$log.debug("login attempt: ",$rootScope.loginAttempt)}),auth.factory("LoginService",function($http,$rootScope,$location,$log,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.debug("logout"),$http.post(RESTURL.url+"logout",{}).success(function(data){$rootScope.loggedInUser=!1,$log.debug("loggedout"),$location.path("/login")})},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}),angular.module("ulakbus.dashboard",[]).config(function($uibTooltipProvider){$uibTooltipProvider.setTriggers({click:"mouseleave"})}).controller("DashCtrl",function($scope,$rootScope,$timeout,$http,$cookies,RESTURL,Generator){$scope.section=function(section_index){$rootScope.section=section_index},$scope.$on("authz",function(event,data){$rootScope.searchInputs=data}),$scope.keyword={student:"",staff:""},$scope.students=[],$scope.staffs=[],$scope.search=function(where){$timeout(function(){"personel"===where&&$scope.keyword.staff.length>2&&$scope.getItems(where,$scope.keyword.staff).success(function(data){$scope.staffs=data.results}),"ogrenci"===where&&$scope.keyword.student.length>2&&$scope.getItems(where,$scope.keyword.student).success(function(data){$scope.students=data.results})},500)},$scope.getItems=function(where,what){return $scope.showResults=!0,$http.get(RESTURL.url+"ara/"+where+"/"+what)},$scope.userPopover={templateUrl:"components/dashboard/user-info.html"},$scope.get_info=function(type,key){Generator.get_list({url:"crud",form_params:{model:type,object_id:key,cmd:"show"}}).then(function(data){$scope.userPopover.name=data.data.object.unicode,$scope.userPopover.tcno=data.data.object.tckn})},$scope.select=function(who,type){$rootScope.$broadcast("selectedUser",{name:who[0],tcno:who[1],key:who[2]}),$rootScope.$broadcast("menuitems",type),$scope.showResults=!1},$scope.$on("notifications",function(event,data){$scope.notifications=data}),$scope.$on("selectedUser",function($event,data){$scope.selectedUser=data}),$scope.deselectUser=function(){delete $scope.selectedUser,delete $scope.selectedMenuItems},$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){}}}),angular.module("ulakbus.crud",["ui.bootstrap","schemaForm","formService"]).config(function(sfErrorMessageProvider){sfErrorMessageProvider.setDefaultMessage(302,"Bu alan zorunludur."),sfErrorMessageProvider.setDefaultMessage(200,"En az {{schema.minLength}} değer giriniz."),sfErrorMessageProvider.setDefaultMessage(201,"En fazla {{schema.minLength}} değer giriniz.")}).service("CrudUtility",function($log,$rootScope){return{generateParam:function(scope,routeParams,cmd){return scope.url=routeParams.wf,angular.forEach(routeParams,function(value,key){key.indexOf("_id")>-1&&"param_id"!==key&&(scope.param=key,scope.param_id=value)}),scope.form_params={model:routeParams.model,param:scope.param||routeParams.param,id:scope.param_id||routeParams.param_id,wf:routeParams.wf,object_id:routeParams.key,filters:{}},scope.param_id&&(scope.form_params.filters[scope.param]={values:[scope.param_id],type:"check"}),scope.model=scope.form_params.model,scope.wf=scope.form_params.wf,scope.param=scope.form_params.param,scope.param_id=scope.form_params.id,scope},listPageItems:function(scope,pageData){angular.forEach(pageData,function(value,key){scope[key]=value}),angular.forEach(scope.objects,function(value,key){if(key>0){var linkIndexes={};angular.forEach(value.actions,function(v,k){"link"===v.show_as&&(linkIndexes=v)}),angular.forEach(value.fields,function(v,k){value.actions.length>0&&linkIndexes.fields?scope.objects[key].fields[k]={type:linkIndexes.fields.indexOf(k)>-1?"link":"str",content:v,cmd:linkIndexes.cmd,mode:linkIndexes.mode}:scope.objects[key].fields[k]={type:"str",content:v}})}}),$log.debug(scope.objects)}}}).controller("CRUDCtrl",function($scope,$routeParams,Generator,CrudUtility){CrudUtility.generateParam($scope,$routeParams),Generator.get_wf($scope)}).controller("CRUDListFormCtrl",function($scope,$rootScope,$location,$http,$log,$uibModal,$timeout,Generator,$routeParams,CrudUtility){$scope.reload=function(reloadData){$scope.form_params.cmd=$scope.reload_cmd,$scope.form_params=angular.extend($scope.form_params,reloadData),$log.debug("reload data",$scope),Generator.get_wf($scope)},$scope.$on("reload_cmd",function(event,data){$scope.reload_cmd=data,$scope.reload({})}),$scope.$on("updateObjects",function($event,data){$scope.objects=data,CrudUtility.listPageItems($scope,{objects:$scope.objects})}),$scope.$on("formLocator",function(event){$scope.formgenerated=event.targetScope.formgenerated}),$scope.remove=function(item,type,index){$scope[type][item.title].model.splice(index,1),$scope[type][item.title].items.splice(index,1)},$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid&&Generator.submit($scope)},$scope.do_action=function(key,todo){Generator.doItemAction($scope,key,todo,todo.mode||"normal")},$scope.getNumber=function(num){return new Array(num)},$scope.createListObjects=function(){$scope.object.constructor===Array?$log.debug("new type show object"):$scope.object.type?$scope.object=[$scope.object]:$scope.object=[{type:"table",fields:angular.copy($scope.object)}]},$scope.showCmd=function(){CrudUtility.generateParam($scope,$routeParams,$routeParams.cmd);var pageData=Generator.getPageData();pageData.pageData===!0?($scope.object=pageData.object,Generator.setPageData({pageData:!1})):Generator.get_wf($scope).then(function(res){$scope.object=res.data.object,$scope.model=$routeParams.model}),$scope.createListObjects()},$scope.listFormCmd=function(){var setpageobjects=function(data){CrudUtility.listPageItems($scope,data),Generator.generate($scope,data),Generator.setPageData({pageData:!1})},pageData=Generator.getPageData();pageData.pageData===!0&&($log.debug("pagedata",pageData.pageData),CrudUtility.generateParam($scope,pageData,$routeParams.cmd),setpageobjects(pageData,pageData),$scope.second_client_cmd&&$scope.createListObjects()),(void 0===pageData.pageData||pageData.pageData===!1)&&(CrudUtility.generateParam($scope,$routeParams,$routeParams.cmd),Generator.get_wf($scope))},$scope.reloadCmd=function(){$scope.reload({})},$scope.resetCmd=function(){delete $scope.token,$scope.cmd="reset",Generator.get_wf($scope)};var executeCmd={show:$scope.showCmd,list:$scope.listFormCmd,form:$scope.listFormCmd,reload:$scope.reloadCmd,reset:$scope.resetCmd};return executeCmd[$routeParams.cmd]()}).directive("crudListDirective",function(){return{templateUrl:"components/crud/templates/list.html",restrict:"E",replace:!0}}).directive("crudFormDirective",function(){return{templateUrl:"components/crud/templates/form.html",restrict:"E",replace:!0}}).directive("crudShowDirective",function(){return{templateUrl:"components/crud/templates/show.html",restrict:"E",replace:!0}}).directive("formLocator",function(){return{link:function(scope){scope.$emit("formLocator")}}}).directive("crudFilters",function(Generator){return{templateUrl:"components/crud/templates/filter.html",restrict:"E",replace:!0,link:function($scope){$scope.form_params.filters=$scope.form_params.filters||{},$scope.filterList={},$scope.filterCollapsed={},$scope.$watch("list_filters",function(){angular.forEach($scope.list_filters,function(value,key){$scope.filterList[value.field]={values:value.values||[],type:value.type},$scope.filterCollapsed[value.field]=Object.keys($scope.filterCollapsed).length>0?!0:!1})}),$scope.collapseFilter=function(field){$scope.filterCollapsed[field]=!$scope.filterCollapsed[field]},$scope.status={startOpened:!1,endOpened:!1},$scope.dateFilterOpen=function($event,which){this.status[which]=!0},$scope.format="dd.MM.yyyy",$scope.filterSubmit=function(){angular.forEach($scope.filterList,function(value,key){if(value.model)if("date"===value.type){var dateValues=[null,null];angular.forEach(value.model,function(v,k){dateValues[k]=Generator.dateformatter(v)}),$scope.form_params.filters[key]={values:dateValues,type:value.type}}else $scope.form_params.filters[key]={values:Object.keys(value.model),type:value.type||"check"}}),Generator.get_wf($scope)}}}}),angular.module("ulakbus.debug",["ngRoute"]).controller("DebugCtrl",function($scope,$rootScope,$location){$scope.debug_queries=$rootScope.debug_queries}),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){}),angular.module("ulakbus.version",["ulakbus.version.interpolate-filter","ulakbus.version.version-directive"]).value("version","0.6.10"),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)}}]); return{templateUrl:"shared/templates/directives/sidebar.html",restrict:"E",replace:!0,scope:{},controller:function($scope,$rootScope,$cookies,$route,$http,RESTURL,$log,$location,$window,$timeout){$scope.prepareMenu=function(menuItems){var newMenuItems={};return angular.forEach(menuItems,function(value,key){angular.forEach(value,function(v,k){newMenuItems[k]=v})}),newMenuItems};var sidebarmenu=$("#side-menu"),sidebarUserMenu=$("#side-user-menu");sidebarmenu.metisMenu(),$http.get(RESTURL.url+"menu/").success(function(data){function reGroupMenuItems(items,baseCategory){var newItems={};return angular.forEach(items,function(value,key){newItems[value.kategori]=newItems[value.kategori]||[],value.baseCategory=baseCategory,newItems[value.kategori].push(value)}),newItems}$scope.allMenuItems=angular.copy(data),angular.forEach($scope.allMenuItems,function(value,key){"current_user"!==key&&"settings"!==key&&($scope.allMenuItems[key]=reGroupMenuItems(value,key))}),$rootScope.quick_menu=reGroupMenuItems(data.quick_menu,"quick_menus"),$rootScope.quick_menu=data.quick_menu,delete data.quick_menu,$log.debug("quick menu",$rootScope.quick_menu),$rootScope.$broadcast("authz",data),$rootScope.searchInputs=data,$rootScope.current_user=data.current_user,(data.ogrenci||data.personel)&&($rootScope.current_user.can_search=!0),$rootScope.settings=data.settings,$scope.menuItems=$scope.prepareMenu({other:$scope.allMenuItems.other}),$timeout(function(){sidebarmenu.metisMenu(),sidebarUserMenu.metisMenu()})}),$scope.$on("menuitems",function(event,data){var menu={};menu[data]=$scope.allMenuItems[data],$scope.selectedMenuItems=$scope.prepareMenu(menu),$timeout(function(){sidebarUserMenu.metisMenu()})}),$scope.$on("selectedUser",function($event,data){$scope.selectedUser=data}),$scope.deselectUser=function(){delete $scope.selectedUser,delete $scope.selectedMenuItems},$scope.openSidebar=function(){$window.innerWidth>"768"&&0===$rootScope.sidebarPinned&&(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(){$window.innerWidth>"768"&&0===$rootScope.sidebarPinned&&(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=0)}),$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},$scope.multiCheck=function(y){y===$scope.multiCollapseVar?$scope.multiCollapseVar=0:$scope.multiCollapseVar=y}}}}]).directive("stats",function(){return{templateUrl:"shared/templates/directives/stats.html",restrict:"E",replace:!0,scope:{model:"=",comments:"@",number:"@",name:"@",colour:"@",details:"@",type:"@","goto":"@"}}}).directive("notifications",function(){return{templateUrl:"shared/templates/directives/notifications.html",restrict:"E",replace:!0}}).directive("msgbox",function(){return{templateUrl:"shared/templates/directives/msgbox.html",restrict:"E",replace:!1}}).directive("alertBox",function($timeout){return{templateUrl:"shared/templates/directives/alert.html",restrict:"E",replace:!0,link:function($scope){$scope.$on("alertBox",function($event,data){$timeout(function(){delete $scope.alerts},5e3),$scope.alerts=[data]})}}}).directive("sidebarSearch",function(){return{templateUrl:"shared/templates/directives/sidebar-search.html",restrict:"E",replace:!0,scope:{},controller:function($scope){$scope.selectedMenu="home"}}}).directive("fileread",function($timeout){return{scope:{fileread:"="},link:function(scope,element,attributes){element.bind("change",function(changeEvent){var reader=new FileReader;reader.onload=function(loadEvent){scope.$apply(function(){scope.fileread=loadEvent.target.result}),$timeout(function(){scope.$parent.model[changeEvent.target.name]={file_name:changeEvent.target.files[0].name,file_content:scope.$parent.model[changeEvent.target.name]},document.querySelector("#image-preview").src=URL.createObjectURL(changeEvent.target.files[0])})},reader.readAsDataURL(changeEvent.target.files[0])})}}});var auth=angular.module("ulakbus.auth",["ngRoute","schemaForm","ngCookies"]);auth.controller("LoginCtrl",function($scope,$q,$timeout,$routeParams,$rootScope,$log,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.loggingIn=!1,$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid?($scope.loggingIn=!0,$rootScope.loginAttempt=1,LoginService.login($scope.url,$scope.model).error(function(data){$scope.message=data.title}).then(function(){$scope.loggingIn=!1})):$log.debug("not valid")},$log.debug("login attempt: ",$rootScope.loginAttempt)}),auth.factory("LoginService",function($http,$rootScope,$location,$log,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.debug("logout"),$http.post(RESTURL.url+"logout",{}).success(function(data){$rootScope.loggedInUser=!1,$log.debug("loggedout"),$location.path("/login")})},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}),angular.module("ulakbus.dashboard",[]).config(function($uibTooltipProvider){$uibTooltipProvider.setTriggers({click:"mouseleave"})}).controller("DashCtrl",function($scope,$rootScope,$timeout,$http,$cookies,RESTURL,Generator){$scope.section=function(section_index){$rootScope.section=section_index},$scope.$on("authz",function(event,data){$rootScope.searchInputs=data}),$scope.keyword={student:"",staff:""},$scope.students=[],$scope.staffs=[],$scope.search=function(where){$timeout(function(){"personel"===where&&$scope.keyword.staff.length>2&&$scope.getItems(where,$scope.keyword.staff).success(function(data){$scope.staffs=data.results}),"ogrenci"===where&&$scope.keyword.student.length>2&&$scope.getItems(where,$scope.keyword.student).success(function(data){$scope.students=data.results})},500)},$scope.getItems=function(where,what){return $scope.showResults=!0,$http.get(RESTURL.url+"ara/"+where+"/"+what)},$scope.userPopover={templateUrl:"components/dashboard/user-info.html"},$scope.get_info=function(type,key){Generator.get_list({url:"crud",form_params:{model:type,object_id:key,cmd:"show"}}).then(function(data){$scope.userPopover.name=data.data.object.unicode,$scope.userPopover.tcno=data.data.object.tckn})},$scope.select=function(who,type){$rootScope.$broadcast("selectedUser",{name:who[0],tcno:who[1],key:who[2]}),$rootScope.$broadcast("menuitems",type),$scope.showResults=!1},$scope.$on("notifications",function(event,data){$scope.notifications=data}),$scope.$on("selectedUser",function($event,data){$scope.selectedUser=data}),$scope.deselectUser=function(){delete $scope.selectedUser,delete $scope.selectedMenuItems},$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){}}}),angular.module("ulakbus.crud",["ui.bootstrap","schemaForm","formService"]).config(function(sfErrorMessageProvider){sfErrorMessageProvider.setDefaultMessage(302,"Bu alan zorunludur."),sfErrorMessageProvider.setDefaultMessage(200,"En az {{schema.minLength}} değer giriniz."),sfErrorMessageProvider.setDefaultMessage(201,"En fazla {{schema.minLength}} değer giriniz.")}).service("CrudUtility",function($log,$rootScope){return{generateParam:function(scope,routeParams,cmd){return scope.url=routeParams.wf,angular.forEach(routeParams,function(value,key){key.indexOf("_id")>-1&&"param_id"!==key&&(scope.param=key,scope.param_id=value)}),scope.form_params={model:routeParams.model,param:scope.param||routeParams.param,id:scope.param_id||routeParams.param_id,wf:routeParams.wf,object_id:routeParams.key,filters:{}},scope.param_id&&(scope.form_params.filters[scope.param]={values:[scope.param_id],type:"check"}),scope.model=scope.form_params.model,scope.wf=scope.form_params.wf,scope.param=scope.form_params.param,scope.param_id=scope.form_params.id,scope},listPageItems:function(scope,pageData){angular.forEach(pageData,function(value,key){scope[key]=value}),angular.forEach(scope.objects,function(value,key){if(key>0){var linkIndexes={};angular.forEach(value.actions,function(v,k){"link"===v.show_as&&(linkIndexes=v)}),angular.forEach(value.fields,function(v,k){value.actions.length>0&&linkIndexes.fields?scope.objects[key].fields[k]={type:linkIndexes.fields.indexOf(k)>-1?"link":"str",content:v,cmd:linkIndexes.cmd,mode:linkIndexes.mode}:scope.objects[key].fields[k]={type:"str",content:v}})}}),$log.debug(scope.objects)}}}).controller("CRUDCtrl",function($scope,$routeParams,Generator,CrudUtility){CrudUtility.generateParam($scope,$routeParams),Generator.get_wf($scope)}).controller("CRUDListFormCtrl",function($scope,$rootScope,$location,$http,$log,$uibModal,$timeout,Generator,$routeParams,CrudUtility){$scope.reload=function(reloadData){$scope.form_params.cmd=$scope.reload_cmd,$scope.form_params=angular.extend($scope.form_params,reloadData),$log.debug("reload data",$scope),Generator.get_wf($scope)},$scope.$on("reload_cmd",function(event,data){$scope.reload_cmd=data,$scope.reload({})}),$scope.$on("updateObjects",function($event,data){$scope.objects=data,CrudUtility.listPageItems($scope,{objects:$scope.objects})}),$scope.$on("formLocator",function(event){$scope.formgenerated=event.targetScope.formgenerated}),$scope.remove=function(item,type,index){$scope[type][item.title].model.splice(index,1),$scope[type][item.title].items.splice(index,1)},$scope.onSubmit=function(form){$scope.$broadcast("schemaFormValidate"),form.$valid&&Generator.submit($scope)},$scope.do_action=function(key,todo){Generator.doItemAction($scope,key,todo,todo.mode||"normal")},$scope.getNumber=function(num){return new Array(num)},$scope.createListObjects=function(){$scope.object.constructor===Array?$log.debug("new type show object"):$scope.object.type?$scope.object=[$scope.object]:$scope.object=[{type:"table",fields:angular.copy($scope.object)}]},$scope.showCmd=function(){CrudUtility.generateParam($scope,$routeParams,$routeParams.cmd);var pageData=Generator.getPageData();pageData.pageData===!0?($scope.object=pageData.object,Generator.setPageData({pageData:!1})):Generator.get_wf($scope).then(function(res){$scope.object=res.data.object,$scope.model=$routeParams.model}),$scope.createListObjects()},$scope.listFormCmd=function(){var setpageobjects=function(data){CrudUtility.listPageItems($scope,data),Generator.generate($scope,data),Generator.setPageData({pageData:!1})},pageData=Generator.getPageData();pageData.pageData===!0&&($log.debug("pagedata",pageData.pageData),CrudUtility.generateParam($scope,pageData,$routeParams.cmd),setpageobjects(pageData,pageData),$scope.second_client_cmd&&$scope.createListObjects()),(void 0===pageData.pageData||pageData.pageData===!1)&&(CrudUtility.generateParam($scope,$routeParams,$routeParams.cmd),Generator.get_wf($scope))},$scope.reloadCmd=function(){$scope.reload({})},$scope.resetCmd=function(){delete $scope.token,$scope.cmd="reset",Generator.get_wf($scope)};var executeCmd={show:$scope.showCmd,list:$scope.listFormCmd,form:$scope.listFormCmd,reload:$scope.reloadCmd,reset:$scope.resetCmd};return executeCmd[$routeParams.cmd]()}).directive("crudListDirective",function(){return{templateUrl:"components/crud/templates/list.html",restrict:"E",replace:!0}}).directive("crudFormDirective",function(){return{templateUrl:"components/crud/templates/form.html",restrict:"E",replace:!0}}).directive("crudShowDirective",function(){return{templateUrl:"components/crud/templates/show.html",restrict:"E",replace:!0}}).directive("formLocator",function(){return{link:function(scope){scope.$emit("formLocator")}}}).directive("crudFilters",function(Generator){return{templateUrl:"components/crud/templates/filter.html",restrict:"E",replace:!0,link:function($scope){$scope.form_params.filters=$scope.form_params.filters||{},$scope.filterList={},$scope.filterCollapsed={},$scope.$watch("list_filters",function(){angular.forEach($scope.list_filters,function(value,key){$scope.filterList[value.field]={values:value.values||[],type:value.type},$scope.filterCollapsed[value.field]=Object.keys($scope.filterCollapsed).length>0?!0:!1})}),$scope.collapseFilter=function(field){$scope.filterCollapsed[field]=!$scope.filterCollapsed[field]},$scope.status={startOpened:!1,endOpened:!1},$scope.dateFilterOpen=function($event,which){this.status[which]=!0},$scope.format="dd.MM.yyyy",$scope.filterSubmit=function(){angular.forEach($scope.filterList,function(value,key){if(value.model)if("date"===value.type){var dateValues=[null,null];angular.forEach(value.model,function(v,k){dateValues[k]=Generator.dateformatter(v)}),$scope.form_params.filters[key]={values:dateValues,type:value.type}}else $scope.form_params.filters[key]={values:Object.keys(value.model),type:value.type||"check"}}),Generator.get_wf($scope)}}}}),angular.module("ulakbus.debug",["ngRoute"]).controller("DebugCtrl",function($scope,$rootScope,$location){$scope.debug_queries=$rootScope.debug_queries}),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))}}),angular.module("ulakbus").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){}),angular.module("ulakbus.version",["ulakbus.version.interpolate-filter","ulakbus.version.version-directive"]).value("version","0.6.10"),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 \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
// Canonical path provides a consistent path (i.e. always forward slashes) across different OSes
var path = require('canonical-path'); var path = require('canonical-path');
var Package = require('dgeni').Package; var Package = require('dgeni').Package;
// Create and export a new Dgeni package called dgeni-example. This package depends upon
// the jsdoc and nunjucks packages defined in the dgeni-packages npm module.
module.exports = new Package('docs_conf', [ module.exports = new Package('docs_conf', [
require('dgeni-packages/base'), require('dgeni-packages/base'),
require('dgeni-packages/jsdoc'), require('dgeni-packages/jsdoc'),
...@@ -13,48 +10,64 @@ module.exports = new Package('docs_conf', [ ...@@ -13,48 +10,64 @@ module.exports = new Package('docs_conf', [
require('dgeni-packages/links') require('dgeni-packages/links')
]) ])
// Configure our dgeni-example package. We can ask the Dgeni dependency injector
// to provide us with access to services and processors that we wish to configure
.config(function(log, readFilesProcessor, templateFinder, writeFilesProcessor, computeIdsProcessor, computePathsProcessor, getAliases) { .config(function(log, readFilesProcessor, templateFinder, writeFilesProcessor, computeIdsProcessor, computePathsProcessor, getAliases) {
// Set logging level
log.level = 'info'; log.level = 'info';
// Specify the base path used when resolving relative paths to source and output files
readFilesProcessor.basePath = path.resolve(__dirname, '..'); readFilesProcessor.basePath = path.resolve(__dirname, '..');
console.log(readFilesProcessor.basePath); console.log(readFilesProcessor.basePath);
// Specify collections of source files that should contain the documentation to extract
readFilesProcessor.sourceFiles = [ readFilesProcessor.sourceFiles = [
{ {
// Process all js files in `app` and its subfolders ...
include: ['app/components/**/*.js', 'app/zetalib/*.js', 'app/shared/**/*.js'], include: ['app/components/**/*.js', 'app/zetalib/*.js', 'app/shared/**/*.js'],
// ... except for this one!
exclude: 'app/**/*_test.js', exclude: 'app/**/*_test.js',
// When calculating the relative path to these files use this as the base path.
// So `src/foo/bar.js` will have relative path of `foo/bar.js`
basePath: 'app' basePath: 'app'
} }
]; ];
// Specify where the writeFilesProcessor will write our generated doc files
writeFilesProcessor.outputFolder = 'docs/html'; writeFilesProcessor.outputFolder = 'docs/html';
templateFinder.templateFolders.push(path.resolve(__dirname, 'templates')); templateFinder.templateFolders.push(path.resolve(__dirname, 'templates'));
// Specify how to match docs to templates.
// In this case we just use the same static template for all docs
templateFinder.templatePatterns.push('common.template.html'); templateFinder.templatePatterns.push('common.template.html');
computeIdsProcessor.idTemplates.push({ computeIdsProcessor.idTemplates = [
docTypes: [ 'controller' ], {
idTemplate: 'module:${module}.${docType}:${name}', docTypes: ['module' ],
getAliases: getAliases idTemplate: 'module:${name}',
}); getAliases: getAliases
},
computePathsProcessor.pathTemplates.push({ {
docTypes: [ 'controller' ], docTypes: ['method', 'property', 'event'],
pathTemplate: '${area}/${module}/${docType}/${name}.html', getId: function(doc) {
outputPathTemplate: '/partials/${area}/${module}/${docType}/${name}.html' var parts = doc.name.split('#');
}); var name = parts.pop();
parts.push(doc.docType + ':' + name);
return parts.join('#');
},
getAliases: getAliases
},
{
docTypes: [ 'controller', 'provider', 'service', 'directive', 'input', 'object', 'function', 'filter', 'type' ],
idTemplate: 'module:${module}.${docType}:${name}',
getAliases: getAliases
}
];
computePathsProcessor.pathTemplates = [
{
docTypes: [ 'controller', 'provider', 'service', 'directive', 'input', 'object', 'function', 'filter', 'type' ],
pathTemplate: '${docType}/${name}.html',
outputPathTemplate: 'partials/${area}/${module}/${docType}/${name}.html'
},
{
docTypes: ['module' ],
pathTemplate: '/${area}/${name}',
outputPathTemplate: 'partials/${area}/${name}/index.html'
},
{
docTypes: ['componentGroup' ],
pathTemplate: '${area}/${moduleName}/${groupType}',
outputPathTemplate: 'partials/${area}/${moduleName}/${groupType}/index.html'
}
];
}); });
\ No newline at end of file
<!DOCTYPE html>
<!--[if lt IE 7]>
<html lang="en" ng-app="ulakbus" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html lang="en" ng-app="ulakbus" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html lang="en" ng-app="ulakbus" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html lang="en" ng-app="ulakbus" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ULAKBUS-UI API DOCUMENTATION</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="/img/favicon.ico">
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="static/style.css">
<link href="styles/roboto/roboto.css" rel="stylesheet">
<link href="styles/jquery-ui.min.css" rel="stylesheet">
<link href="styles/monokai-sublime.css" rel="stylesheet">
<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css" type="text/css">
</head>
<body>
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0"
ng-if="$root.loggedInUser">
<collapse-menu></collapse-menu>
<!--<ul class="header-menu">-->
<!--<li><a href="">Mesajlar</a></li>-->
<!--<li><a href="">Görevler</a></li>-->
<!--<li><a href="">Raporlar</a></li>-->
<!--<li><a href="">Ayarlar</a></li>-->
<!--</ul>-->
<div class="navbar-header">
<div class="brand">
<a href="#/dashboard" ng-click="$root.breadcrumbLinks = ['Panel']" class="logo"><img
src="/img/brand-logo.png"/></a>
</div>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- /.navbar-header -->
<header-notification></header-notification>
</nav>
<div class="manager-view">
<div class="manager-view-inner">
<div class="manager-view-content">
<div class="row">
<div class="main" ng-view>
</div>
</div>
</div>
</div>
</div>
<alert-box></alert-box>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-i18n/angular-locale_tr.js"></script>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="bower_components/angular-route/angular-route.min.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.min.js"></script>
<script src="bower_components/angular-resource/angular-resource.min.js"></script>
<script src="app.js"></script>
</body>
</html>
<header class="api-profile-header">
<h1 class="api-profile-header-heading">ModalCtrl</h1>
<ol class="api-profile-header-structure naked-list step-list">
<li>
- controller in module <a href=""></a>
</li>
</ol>
</header>
<div class="api-profile-description">
<p>controller for listnode, node and linkedmodel modal and save data of it</p>
</div>
<div>
<h2 id="usage">Usage</h2>
<p><code>ModalCtrl(items, $scope, $uibModalInstance, $route);</code></p>
<section class="api-section">
<h3>Arguments</h3>
<table class="variables-matrix input-arguments">
<thead>
<tr>
<th>Param</th>
<th>Type</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr>
<td>
items
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
$scope
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
$uibModalInstance
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
$route
</td>
<td>
</td>
<td>
</td>
</tr>
</tbody>
</table>
</section>
<h3>Returns</h3>
<table class="variables-matrix return-arguments">
<tr>
<td></td>
<td><p>returns value for modal</p>
</td>
</tr>
</table>
</div>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/makeUrl">makeUrl</a></td> <td><a href="function/makeUrl.html">makeUrl</a></td>
<td><p>this function generates url combining backend url and the related object properties for http requests</p> <td><p>this function generates url combining backend url and the related object properties for http requests</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/generate">generate</a></td> <td><a href="function/generate.html">generate</a></td>
<td><ul> <td><ul>
<li>generate function is inclusive for form generation <li>generate function is inclusive for form generation
defines given scope&#39;s client_cmd, model, schema, form, token, object_id objects</li> defines given scope&#39;s client_cmd, model, schema, form, token, object_id objects</li>
...@@ -27,13 +27,13 @@ defines given scope&#39;s client_cmd, model, schema, form, token, object_id obje ...@@ -27,13 +27,13 @@ defines given scope&#39;s client_cmd, model, schema, form, token, object_id obje
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/group">group</a></td> <td><a href="function/group.html">group</a></td>
<td><p>group function to group form layout by form meta data for layout</p> <td><p>group function to group form layout by form meta data for layout</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/prepareFormItems">prepareFormItems</a></td> <td><a href="function/prepareFormItems.html">prepareFormItems</a></td>
<td><p>prepareFormItems looks up fields of schema objects and changes their types to proper type for schemaform <td><p>prepareFormItems looks up fields of schema objects and changes their types to proper type for schemaform
for listnode, node and model types it uses templates to generate modal for listnode, node and model types it uses templates to generate modal
prepareforms checks input types and convert if necessary</p> prepareforms checks input types and convert if necessary</p>
...@@ -41,13 +41,13 @@ prepareforms checks input types and convert if necessary</p> ...@@ -41,13 +41,13 @@ prepareforms checks input types and convert if necessary</p>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/dateformatter">dateformatter</a></td> <td><a href="function/dateformatter.html">dateformatter</a></td>
<td><p>dateformatter handles all date fields and returns humanized and jquery datepicker format dates</p> <td><p>dateformatter handles all date fields and returns humanized and jquery datepicker format dates</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/doItemAction">doItemAction</a></td> <td><a href="function/doItemAction.html">doItemAction</a></td>
<td><p>mode could be in [&#39;normal&#39;, &#39;modal&#39;, &#39;new&#39;] . the default mode is &#39;normal&#39; and it loads data on same <td><p>mode could be in [&#39;normal&#39;, &#39;modal&#39;, &#39;new&#39;] . the default mode is &#39;normal&#39; and it loads data on same
tab without modal. &#39;modal&#39; will use modal to manipulate data and do all actions in that modal. &#39;new&#39; tab without modal. &#39;modal&#39; will use modal to manipulate data and do all actions in that modal. &#39;new&#39;
will be open new page with response data</p> will be open new page with response data</p>
...@@ -55,57 +55,57 @@ will be open new page with response data</p> ...@@ -55,57 +55,57 @@ will be open new page with response data</p>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/get_form">get_form</a></td> <td><a href="function/get_form.html">get_form</a></td>
<td><p>Communicates with api with given scope object.</p> <td><p>Communicates with api with given scope object.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/get_list">get_list</a></td> <td><a href="function/get_list.html">get_list</a></td>
<td><p>gets list of related wf/model</p> <td><p>gets list of related wf/model</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/get_wf">get_wf</a></td> <td><a href="function/get_wf.html">get_wf</a></td>
<td><p>get_wf is the main function for client_cmd based api calls <td><p>get_wf is the main function for client_cmd based api calls
based on response content it redirects to related path/controller with pathDecider function</p> based on response content it redirects to related path/controller with pathDecider function</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/isValidEmail">isValidEmail</a></td> <td><a href="function/isValidEmail.html">isValidEmail</a></td>
<td><p>checks if given value is a valid email address.</p> <td><p>checks if given value is a valid email address.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/isValidTCNo">isValidTCNo</a></td> <td><a href="function/isValidTCNo.html">isValidTCNo</a></td>
<td><p>checks if given value is a valid identity number for Turkey.</p> <td><p>checks if given value is a valid identity number for Turkey.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/isValidDate">isValidDate</a></td> <td><a href="function/isValidDate.html">isValidDate</a></td>
<td><p>checks if given value can be parsed as Date object</p> <td><p>checks if given value can be parsed as Date object</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/pageData">pageData</a></td> <td><a href="function/pageData.html">pageData</a></td>
<td><p>pageData object is moving object from response to controller <td><p>pageData object is moving object from response to controller
with this object controller will not need to call the api for response object to work on to</p> with this object controller will not need to call the api for response object to work on to</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/pathDecider">pathDecider</a></td> <td><a href="function/pathDecider.html">pathDecider</a></td>
<td><p>pathDecider is used to redirect related path by looking up the data in response</p> <td><p>pathDecider is used to redirect related path by looking up the data in response</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/redirectTo">redirectTo</a></td> <td><a href="function/redirectTo.html">redirectTo</a></td>
<td><p>redirectTo function redirects to related controller and path with given data <td><p>redirectTo function redirects to related controller and path with given data
before redirect setPageData must be called and pageData need to be defined before redirect setPageData must be called and pageData need to be defined
otherwise redirected path will call api for its data</p> otherwise redirected path will call api for its data</p>
...@@ -113,24 +113,24 @@ otherwise redirected path will call api for its data</p> ...@@ -113,24 +113,24 @@ otherwise redirected path will call api for its data</p>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/get_diff">get_diff</a></td> <td><a href="function/get_diff.html">get_diff</a></td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/get_diff_array">get_diff_array</a></td> <td><a href="function/get_diff_array.html">get_diff_array</a></td>
<td><p>extracts items of second array from the first array</p> <td><p>extracts items of second array from the first array</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/item_from_array">item_from_array</a></td> <td><a href="function/item_from_array.html">item_from_array</a></td>
<td><p>get item unicode name from titleMap</p> <td><p>get item unicode name from titleMap</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/submit">submit</a></td> <td><a href="function/submit.html">submit</a></td>
<td><p>submit function is general function for submiting forms. <td><p>submit function is general function for submiting forms.
redirectTo param is used for redirect if return value will be evaluated in a new page.</p> redirectTo param is used for redirect if return value will be evaluated in a new page.</p>
</td> </td>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/formService">formService</a> - function in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/service/Generator">Generator</a></td> <td><a href="service/Generator.html">Generator</a></td>
<td><p>form service&#39;s Generator factory service handles all generic form operations</p> <td><p>form service&#39;s Generator factory service handles all generic form operations</p>
</td> </td>
</tr> </tr>
...@@ -64,13 +64,13 @@ ...@@ -64,13 +64,13 @@
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/makeUrl">makeUrl</a></td> <td><a href="function/makeUrl.html">makeUrl</a></td>
<td><p>this function generates url combining backend url and the related object properties for http requests</p> <td><p>this function generates url combining backend url and the related object properties for http requests</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/generate">generate</a></td> <td><a href="function/generate.html">generate</a></td>
<td><ul> <td><ul>
<li>generate function is inclusive for form generation <li>generate function is inclusive for form generation
defines given scope&#39;s client_cmd, model, schema, form, token, object_id objects</li> defines given scope&#39;s client_cmd, model, schema, form, token, object_id objects</li>
...@@ -79,13 +79,13 @@ defines given scope&#39;s client_cmd, model, schema, form, token, object_id obje ...@@ -79,13 +79,13 @@ defines given scope&#39;s client_cmd, model, schema, form, token, object_id obje
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/group">group</a></td> <td><a href="function/group.html">group</a></td>
<td><p>group function to group form layout by form meta data for layout</p> <td><p>group function to group form layout by form meta data for layout</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/prepareFormItems">prepareFormItems</a></td> <td><a href="function/prepareFormItems.html">prepareFormItems</a></td>
<td><p>prepareFormItems looks up fields of schema objects and changes their types to proper type for schemaform <td><p>prepareFormItems looks up fields of schema objects and changes their types to proper type for schemaform
for listnode, node and model types it uses templates to generate modal for listnode, node and model types it uses templates to generate modal
prepareforms checks input types and convert if necessary</p> prepareforms checks input types and convert if necessary</p>
...@@ -93,13 +93,13 @@ prepareforms checks input types and convert if necessary</p> ...@@ -93,13 +93,13 @@ prepareforms checks input types and convert if necessary</p>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/dateformatter">dateformatter</a></td> <td><a href="function/dateformatter.html">dateformatter</a></td>
<td><p>dateformatter handles all date fields and returns humanized and jquery datepicker format dates</p> <td><p>dateformatter handles all date fields and returns humanized and jquery datepicker format dates</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/doItemAction">doItemAction</a></td> <td><a href="function/doItemAction.html">doItemAction</a></td>
<td><p>mode could be in [&#39;normal&#39;, &#39;modal&#39;, &#39;new&#39;] . the default mode is &#39;normal&#39; and it loads data on same <td><p>mode could be in [&#39;normal&#39;, &#39;modal&#39;, &#39;new&#39;] . the default mode is &#39;normal&#39; and it loads data on same
tab without modal. &#39;modal&#39; will use modal to manipulate data and do all actions in that modal. &#39;new&#39; tab without modal. &#39;modal&#39; will use modal to manipulate data and do all actions in that modal. &#39;new&#39;
will be open new page with response data</p> will be open new page with response data</p>
...@@ -107,57 +107,57 @@ will be open new page with response data</p> ...@@ -107,57 +107,57 @@ will be open new page with response data</p>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/get_form">get_form</a></td> <td><a href="function/get_form.html">get_form</a></td>
<td><p>Communicates with api with given scope object.</p> <td><p>Communicates with api with given scope object.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/get_list">get_list</a></td> <td><a href="function/get_list.html">get_list</a></td>
<td><p>gets list of related wf/model</p> <td><p>gets list of related wf/model</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/get_wf">get_wf</a></td> <td><a href="function/get_wf.html">get_wf</a></td>
<td><p>get_wf is the main function for client_cmd based api calls <td><p>get_wf is the main function for client_cmd based api calls
based on response content it redirects to related path/controller with pathDecider function</p> based on response content it redirects to related path/controller with pathDecider function</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/isValidEmail">isValidEmail</a></td> <td><a href="function/isValidEmail.html">isValidEmail</a></td>
<td><p>checks if given value is a valid email address.</p> <td><p>checks if given value is a valid email address.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/isValidTCNo">isValidTCNo</a></td> <td><a href="function/isValidTCNo.html">isValidTCNo</a></td>
<td><p>checks if given value is a valid identity number for Turkey.</p> <td><p>checks if given value is a valid identity number for Turkey.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/isValidDate">isValidDate</a></td> <td><a href="function/isValidDate.html">isValidDate</a></td>
<td><p>checks if given value can be parsed as Date object</p> <td><p>checks if given value can be parsed as Date object</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/pageData">pageData</a></td> <td><a href="function/pageData.html">pageData</a></td>
<td><p>pageData object is moving object from response to controller <td><p>pageData object is moving object from response to controller
with this object controller will not need to call the api for response object to work on to</p> with this object controller will not need to call the api for response object to work on to</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/pathDecider">pathDecider</a></td> <td><a href="function/pathDecider.html">pathDecider</a></td>
<td><p>pathDecider is used to redirect related path by looking up the data in response</p> <td><p>pathDecider is used to redirect related path by looking up the data in response</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/redirectTo">redirectTo</a></td> <td><a href="function/redirectTo.html">redirectTo</a></td>
<td><p>redirectTo function redirects to related controller and path with given data <td><p>redirectTo function redirects to related controller and path with given data
before redirect setPageData must be called and pageData need to be defined before redirect setPageData must be called and pageData need to be defined
otherwise redirected path will call api for its data</p> otherwise redirected path will call api for its data</p>
...@@ -165,24 +165,24 @@ otherwise redirected path will call api for its data</p> ...@@ -165,24 +165,24 @@ otherwise redirected path will call api for its data</p>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/get_diff">get_diff</a></td> <td><a href="function/get_diff.html">get_diff</a></td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/get_diff_array">get_diff_array</a></td> <td><a href="function/get_diff_array.html">get_diff_array</a></td>
<td><p>extracts items of second array from the first array</p> <td><p>extracts items of second array from the first array</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/item_from_array">item_from_array</a></td> <td><a href="function/item_from_array.html">item_from_array</a></td>
<td><p>get item unicode name from titleMap</p> <td><p>get item unicode name from titleMap</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/function/submit">submit</a></td> <td><a href="function/submit.html">submit</a></td>
<td><p>submit function is general function for submiting forms. <td><p>submit function is general function for submiting forms.
redirectTo param is used for redirect if return value will be evaluated in a new page.</p> redirectTo param is used for redirect if return value will be evaluated in a new page.</p>
</td> </td>
...@@ -191,6 +191,29 @@ redirectTo param is used for redirect if return value will be evaluated in a new ...@@ -191,6 +191,29 @@ redirectTo param is used for redirect if return value will be evaluated in a new
</table> </table>
</div> </div>
<div>
<h3 class="component-heading" id="directive">Directive</h3>
<table class="definition-table">
<tr>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td><a href="directive/modalForNodes.html">modalForNodes</a></td>
<td><p>add modal directive for nodes</p>
</td>
</tr>
<tr>
<td><a href="directive/addModalForLinkedModel.html">addModalForLinkedModel</a></td>
<td><p>add modal directive for linked models</p>
</td>
</tr>
</table>
</div>
</div> </div>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<li> <li>
- service in module <a href="api/formService">formService</a> - service in module <a href="/api/formService">formService</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</tr> </tr>
<tr> <tr>
<td><a href="api/formService/service/Generator">Generator</a></td> <td><a href="service/Generator.html">Generator</a></td>
<td><p>form service&#39;s Generator factory service handles all generic form operations</p> <td><p>form service&#39;s Generator factory service handles all generic form operations</p>
</td> </td>
</tr> </tr>
......
<header class="api-profile-header">
<h1 class="api-profile-header-heading">CRUDCtrl</h1>
<ol class="api-profile-header-structure naked-list step-list">
<li>
- controller in module <a href="/api/ulakbus.crud">ulakbus.crud</a>
</li>
</ol>
</header>
<div class="api-profile-description">
<p>CRUDCtrl controller is base controller for crud module to redirect to related controller
This controller play an empty role for api calls.
With response data, location path change to related controller</p>
</div>
<div>
<h2 id="usage">Usage</h2>
<p><code>CRUDCtrl();</code></p>
<h3>Returns</h3>
<table class="variables-matrix return-arguments">
<tr>
<td><a href="" class="label type-hint type-hint-object">object</a></td>
<td></td>
</tr>
</table>
</div>
<header class="api-profile-header">
<h1 class="api-profile-header-heading">CRUDListFormCtrl</h1>
<ol class="api-profile-header-structure naked-list step-list">
<li>
- controller in module <a href="/api/ulakbus.crud">ulakbus.crud</a>
</li>
</ol>
</header>
<div class="api-profile-description">
<p>CRUDListFormCtrl is the main controller for crud module
Based on the client_cmd parameter it generates its scope items.
client_cmd can be in [&#39;show&#39;, &#39;list&#39;, &#39;form&#39;, &#39;reload&#39;, &#39;refresh&#39;]
There are 3 directives to manipulate controllers scope objects in crud.html</p>
<p>The controller works in 2 ways, with and without pageData.
pageData is generated by formService.Generator and it contains data to manipulate page.
If pageData has set, using Generator&#39;s getPageData() function, sets its scope items. After getting pageData
pageData must be set to <code>{pageData: false}</code> for clear scope of next job.</p>
<p>If pageData has not set using Generator&#39;s get_wf() function gets scope items from api call.</p>
</div>
<div>
<h2 id="usage">Usage</h2>
<p><code>CRUDListFormCtrl();</code></p>
<h3>Returns</h3>
<table class="variables-matrix return-arguments">
<tr>
<td><a href="" class="label type-hint type-hint-object">object</a></td>
<td></td>
</tr>
</table>
</div>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</tr> </tr>
<tr> <tr>
<td><a href="api/ulakbus.crud/controller/CRUDCtrl.html">CRUDCtrl</a></td> <td><a href="controller/CRUDCtrl.html">CRUDCtrl</a></td>
<td><p>CRUDCtrl controller is base controller for crud module to redirect to related controller <td><p>CRUDCtrl controller is base controller for crud module to redirect to related controller
This controller play an empty role for api calls. This controller play an empty role for api calls.
With response data, location path change to related controller</p> With response data, location path change to related controller</p>
...@@ -20,7 +20,7 @@ With response data, location path change to related controller</p> ...@@ -20,7 +20,7 @@ With response data, location path change to related controller</p>
</tr> </tr>
<tr> <tr>
<td><a href="api/ulakbus.crud/controller/CRUDListFormCtrl.html">CRUDListFormCtrl</a></td> <td><a href="controller/CRUDListFormCtrl.html">CRUDListFormCtrl</a></td>
<td><p>CRUDListFormCtrl is the main controller for crud module <td><p>CRUDListFormCtrl is the main controller for crud module
Based on the client_cmd parameter it generates its scope items. Based on the client_cmd parameter it generates its scope items.
client_cmd can be in [&#39;show&#39;, &#39;list&#39;, &#39;form&#39;, &#39;reload&#39;, &#39;refresh&#39;] client_cmd can be in [&#39;show&#39;, &#39;list&#39;, &#39;form&#39;, &#39;reload&#39;, &#39;refresh&#39;]
......
<header class="api-profile-header">
<h1 class="api-profile-header-heading">crudFilters</h1>
<ol class="api-profile-header-structure naked-list step-list">
<li>
- directive in module <a href="/api/ulakbus.crud">ulakbus.crud</a>
</li>
</ol>
</header>
<div class="api-profile-description">
<p>directive for filtering functionality. There are three types of filters; <code>check</code>, <code>select</code>, and <code>date</code>.</p>
</div>
<div>
<h2>Directive Info</h2>
<ul>
<li>This directive executes at priority level 0.</li>
</ul>
<h2 id="usage">Usage</h2>
<div class="usage">
<ul>
<li>as attribute:
<pre><code>&lt;ANY&gt;&#10;...&#10;&lt;/ANY&gt;</code></pre>
</li>
</div>
</div>
<header class="api-profile-header">
<h1 class="api-profile-header-heading">crudFormDirective</h1>
<ol class="api-profile-header-structure naked-list step-list">
<li>
- directive in module <a href="/api/ulakbus.crud">ulakbus.crud</a>
</li>
</ol>
</header>
<div class="api-profile-description">
<p>directive for form generation.
provides template for <code>scope.forms</code> object.</p>
</div>
<div>
<h2>Directive Info</h2>
<ul>
<li>This directive executes at priority level 0.</li>
</ul>
<h2 id="usage">Usage</h2>
<div class="usage">
<ul>
<li>as attribute:
<pre><code>&lt;ANY&gt;&#10;...&#10;&lt;/ANY&gt;</code></pre>
</li>
</div>
</div>
<header class="api-profile-header">
<h1 class="api-profile-header-heading">crudListDirective</h1>
<ol class="api-profile-header-structure naked-list step-list">
<li>
- directive in module <a href="/api/ulakbus.crud">ulakbus.crud</a>
</li>
</ol>
</header>
<div class="api-profile-description">
<p>directive for listing objects.
provides template for <code>scope.objects</code> object.</p>
</div>
<div>
<h2>Directive Info</h2>
<ul>
<li>This directive executes at priority level 0.</li>
</ul>
<h2 id="usage">Usage</h2>
<div class="usage">
<ul>
<li>as attribute:
<pre><code>&lt;ANY&gt;&#10;...&#10;&lt;/ANY&gt;</code></pre>
</li>
</div>
</div>
<header class="api-profile-header">
<h1 class="api-profile-header-heading">crudShowDirective</h1>
<ol class="api-profile-header-structure naked-list step-list">
<li>
- directive in module <a href="/api/ulakbus.crud">ulakbus.crud</a>
</li>
</ol>
</header>
<div class="api-profile-description">
<p>directive for single object or detail of an object.
provides template for <code>scope.object</code> object.</p>
</div>
<div>
<h2>Directive Info</h2>
<ul>
<li>This directive executes at priority level 0.</li>
</ul>
<h2 id="usage">Usage</h2>
<div class="usage">
<ul>
<li>as attribute:
<pre><code>&lt;ANY&gt;&#10;...&#10;&lt;/ANY&gt;</code></pre>
</li>
</div>
</div>
<header class="api-profile-header">
<h1 class="api-profile-header-heading">formLocator</h1>
<ol class="api-profile-header-structure naked-list step-list">
<li>
- directive in module <a href="/api/ulakbus.crud">ulakbus.crud</a>
</li>
</ol>
</header>
<div class="api-profile-description">
<p>directive for finding form element. we use this directive because when form dynamically generated using
schemaform it belongs to a scope which is hard to reach. This makes it easy to locate form object.</p>
</div>
<div>
<h2>Directive Info</h2>
<ul>
<li>This directive executes at priority level 0.</li>
</ul>
<h2 id="usage">Usage</h2>
<div class="usage">
<ul>
<li>as attribute:
<pre><code>&lt;ANY&gt;&#10;...&#10;&lt;/ANY&gt;</code></pre>
</li>
</div>
</div>
<h1>Directive components in <code>ulakbus.crud</code></h1>
<div class="component-breakdown">
<div>
<table class="definition-table">
<tr>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td><a href="directive/crudListDirective.html">crudListDirective</a></td>
<td><p>directive for listing objects.
provides template for <code>scope.objects</code> object.</p>
</td>
</tr>
<tr>
<td><a href="directive/crudFormDirective.html">crudFormDirective</a></td>
<td><p>directive for form generation.
provides template for <code>scope.forms</code> object.</p>
</td>
</tr>
<tr>
<td><a href="directive/crudShowDirective.html">crudShowDirective</a></td>
<td><p>directive for single object or detail of an object.
provides template for <code>scope.object</code> object.</p>
</td>
</tr>
<tr>
<td><a href="directive/formLocator.html">formLocator</a></td>
<td><p>directive for finding form element. we use this directive because when form dynamically generated using
schemaform it belongs to a scope which is hard to reach. This makes it easy to locate form object.</p>
</td>
</tr>
<tr>
<td><a href="directive/crudFilters.html">crudFilters</a></td>
<td><p>directive for filtering functionality. There are three types of filters; <code>check</code>, <code>select</code>, and <code>date</code>.</p>
</td>
</tr>
</table>
</div>
</div>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/ulakbus.crud">ulakbus.crud</a> - function in module <a href="/api/ulakbus.crud">ulakbus.crud</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
</tr> </tr>
<tr> <tr>
<td><a href="api/ulakbus.crud/function/generateParam">generateParam</a></td> <td><a href="function/generateParam.html">generateParam</a></td>
<td><p>generateParam is a function to generate required params to post backend api.</p> <td><p>generateParam is a function to generate required params to post backend api.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/ulakbus.crud/function/listPageItems">listPageItems</a></td> <td><a href="function/listPageItems.html">listPageItems</a></td>
<td><p>listPageItems is a function to prepare objects to list in the list page.</p> <td><p>listPageItems is a function to prepare objects to list in the list page.</p>
</td> </td>
</tr> </tr>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<ol class="api-profile-header-structure naked-list step-list"> <ol class="api-profile-header-structure naked-list step-list">
<li> <li>
- function in module <a href="api/ulakbus.crud">ulakbus.crud</a> - function in module <a href="/api/ulakbus.crud">ulakbus.crud</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</tr> </tr>
<tr> <tr>
<td><a href="api/ulakbus.crud/service/CrudUtility">CrudUtility</a></td> <td><a href="service/CrudUtility.html">CrudUtility</a></td>
<td><p>Crud Utility is a service to provide generic functions for Crud controllers to format data and scope object.</p> <td><p>Crud Utility is a service to provide generic functions for Crud controllers to format data and scope object.</p>
</td> </td>
</tr> </tr>
...@@ -64,13 +64,13 @@ ...@@ -64,13 +64,13 @@
</tr> </tr>
<tr> <tr>
<td><a href="api/ulakbus.crud/function/generateParam">generateParam</a></td> <td><a href="function/generateParam.html">generateParam</a></td>
<td><p>generateParam is a function to generate required params to post backend api.</p> <td><p>generateParam is a function to generate required params to post backend api.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a href="api/ulakbus.crud/function/listPageItems">listPageItems</a></td> <td><a href="function/listPageItems.html">listPageItems</a></td>
<td><p>listPageItems is a function to prepare objects to list in the list page.</p> <td><p>listPageItems is a function to prepare objects to list in the list page.</p>
</td> </td>
</tr> </tr>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</tr> </tr>
<tr> <tr>
<td><a href="api/ulakbus.crud/controller/CRUDCtrl.html">CRUDCtrl</a></td> <td><a href="controller/CRUDCtrl.html">CRUDCtrl</a></td>
<td><p>CRUDCtrl controller is base controller for crud module to redirect to related controller <td><p>CRUDCtrl controller is base controller for crud module to redirect to related controller
This controller play an empty role for api calls. This controller play an empty role for api calls.
With response data, location path change to related controller</p> With response data, location path change to related controller</p>
...@@ -95,7 +95,7 @@ With response data, location path change to related controller</p> ...@@ -95,7 +95,7 @@ With response data, location path change to related controller</p>
</tr> </tr>
<tr> <tr>
<td><a href="api/ulakbus.crud/controller/CRUDListFormCtrl.html">CRUDListFormCtrl</a></td> <td><a href="controller/CRUDListFormCtrl.html">CRUDListFormCtrl</a></td>
<td><p>CRUDListFormCtrl is the main controller for crud module <td><p>CRUDListFormCtrl is the main controller for crud module
Based on the client_cmd parameter it generates its scope items. Based on the client_cmd parameter it generates its scope items.
client_cmd can be in [&#39;show&#39;, &#39;list&#39;, &#39;form&#39;, &#39;reload&#39;, &#39;refresh&#39;] client_cmd can be in [&#39;show&#39;, &#39;list&#39;, &#39;form&#39;, &#39;reload&#39;, &#39;refresh&#39;]
...@@ -106,6 +106,51 @@ There are 3 directives to manipulate controllers scope objects in crud.html</p> ...@@ -106,6 +106,51 @@ There are 3 directives to manipulate controllers scope objects in crud.html</p>
</table> </table>
</div> </div>
<div>
<h3 class="component-heading" id="directive">Directive</h3>
<table class="definition-table">
<tr>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td><a href="directive/crudListDirective.html">crudListDirective</a></td>
<td><p>directive for listing objects.
provides template for <code>scope.objects</code> object.</p>
</td>
</tr>
<tr>
<td><a href="directive/crudFormDirective.html">crudFormDirective</a></td>
<td><p>directive for form generation.
provides template for <code>scope.forms</code> object.</p>
</td>
</tr>
<tr>
<td><a href="directive/crudShowDirective.html">crudShowDirective</a></td>
<td><p>directive for single object or detail of an object.
provides template for <code>scope.object</code> object.</p>
</td>
</tr>
<tr>
<td><a href="directive/formLocator.html">formLocator</a></td>
<td><p>directive for finding form element. we use this directive because when form dynamically generated using
schemaform it belongs to a scope which is hard to reach. This makes it easy to locate form object.</p>
</td>
</tr>
<tr>
<td><a href="directive/crudFilters.html">crudFilters</a></td>
<td><p>directive for filtering functionality. There are three types of filters; <code>check</code>, <code>select</code>, and <code>date</code>.</p>
</td>
</tr>
</table>
</div>
</div> </div>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<li> <li>
- service in module <a href="api/ulakbus.crud">ulakbus.crud</a> - service in module <a href="/api/ulakbus.crud">ulakbus.crud</a>
</li> </li>
</ol> </ol>
</header> </header>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</tr> </tr>
<tr> <tr>
<td><a href="api/ulakbus.crud/service/CrudUtility">CrudUtility</a></td> <td><a href="service/CrudUtility.html">CrudUtility</a></td>
<td><p>Crud Utility is a service to provide generic functions for Crud controllers to format data and scope object.</p> <td><p>Crud Utility is a service to provide generic functions for Crud controllers to format data and scope object.</p>
</td> </td>
</tr> </tr>
......
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