Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
48409879
Commit
48409879
authored
Dec 05, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolves #55
parent
36a4c94b
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
456 additions
and
128 deletions
+456
-128
Gruntfile.js
Gruntfile.js
+10
-4
crud_controller.js
app/components/crud/crud_controller.js
+10
-0
filter.html
app/components/crud/templates/filter.html
+21
-29
list.html
app/components/crud/templates/list.html
+5
-5
directives.js
app/shared/directives.js
+1
-1
linkedModelModalContent.html
app/shared/templates/linkedModelModalContent.html
+3
-3
nodeTable.html
app/shared/templates/nodeTable.html
+11
-11
form_service.js
app/zetalib/form_service.js
+50
-21
app.js
dist/app.js
+3
-3
components.js
dist/bower_components/components.js
+3
-2
app.css
dist/css/app.css
+299
-1
templates.js
dist/templates.js
+40
-48
No files found.
Gruntfile.js
View file @
48409879
...
...
@@ -145,7 +145,7 @@ module.exports = function (grunt) {
"app/bower_components/angular-loading-bar/build/loading-bar.js"
,
"app/bower_components/metisMenu/dist/metisMenu.js"
,
"app/bower_components/Chart.js/Chart.js"
,
//"app/shared/scripts/jquery-ui.min
.js"
"app/bower_components/intro.js/intro
.js"
],
dest
:
'dist/bower_components/components.js'
},
...
...
@@ -157,7 +157,9 @@ module.exports = function (grunt) {
"app/app.css"
,
"app/bower_components/metisMenu/dist/metisMenu.min.css"
,
"app/bower_components/angular-loading-bar/build/loading-bar.min.css"
,
"app/bower_components/font-awesome/css/font-awesome.min.css"
"app/bower_components/font-awesome/css/font-awesome.min.css"
,
"app/bower_components/intro.js/intro.css"
,
"app/bower_components/intro.js/themes/introjs-nassim.css"
]
}
},
...
...
@@ -193,17 +195,21 @@ module.exports = function (grunt) {
"app/bower_components/json3/lib/json3.min.js"
,
"app/bower_components/angular-loading-bar/build/loading-bar.min.js"
,
"app/bower_components/metisMenu/dist/metisMenu.min.js"
,
"app/bower_components/Chart.js/Chart.min.js"
"app/bower_components/Chart.js/Chart.min.js"
,
"app/bower_components/intro.js/minified/intro.min.js"
],
dest
:
'dist/<%= grunt.branchname %>/bower_components/components.js'
},
css_branch
:
{
src
:
[
"app/bower_components/angular-bootstrap/ui-bootstrap-csp.css"
,
"app/bower_components/bootstrap/dist/css/bootstrap.min.css"
,
"app/app.css"
,
"app/bower_components/metisMenu/dist/metisMenu.min.css"
,
"app/bower_components/angular-loading-bar/build/loading-bar.min.css"
,
"app/bower_components/font-awesome/css/font-awesome.min.css"
"app/bower_components/font-awesome/css/font-awesome.min.css"
,
"app/bower_components/intro.js/minified/intro.min.css"
,
"app/bower_components/intro.js/themes/introjs-nassim.css"
],
dest
:
'dist/<%= grunt.branchname %>/css/app.css'
}
...
...
app/components/crud/crud_controller.js
View file @
48409879
...
...
@@ -150,6 +150,16 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
}
};
$scope
.
filter
=
{};
$scope
.
addToFilter
=
function
(
field
,
filterValue
)
{
};
$scope
.
filterSubmit
=
function
()
{
};
$scope
.
do_action
=
function
(
key
,
cmd
,
mode
)
{
Generator
.
doItemAction
(
$scope
,
key
,
cmd
,
mode
||
'normal'
);
};
...
...
app/components/crud/templates/filter.html
View file @
48409879
<div>
<h2>
Filtrele
</h2>
<div
class=
"right-sidebar-box
"
>
<div
class=
"right-sidebar-messages"
>
<div
class=
"
right-sidebar-title
clearfix"
>
<h3>
Tarİh Aralığı
</h3>
<div
ng-repeat=
"filter in list_filters
"
>
<div>
<div
class=
" clearfix"
>
<h3>
{{filter.verbose_name}}
</h3>
</div>
<div
class=
"right-sidebar-message-block"
>
<div
ng-if=
"filter.type==='check' || !filter.type"
>
<div
class=
"checkbox"
ng-repeat=
"filterItem in filter.values"
>
<input
type=
"checkbox"
name=
"filter_group[]"
value=
"{{filterItem.value}}"
/>
{{filterItem.name}}
<br
/>
</div>
</div>
<div
ng-if=
"filter.type==='select'"
>
<div
class=
"col-md-12"
>
<select
name=
"filterSelect"
id=
"filterSelect"
class=
"form-control"
>
<option
ng-repeat=
"filterItem in filter.values"
value=
"{{filterItem.value}}"
>
{{filterItem.name}}
</option>
</select>
</div>
</div>
<div
ng-if=
"filter.type==='date'"
>
<div
class=
"col-md-6"
>
<br>
<label
class=
"control-label"
for=
"startDate"
>
Başlangıç
</label>
...
...
@@ -22,30 +37,7 @@
<div
class=
"clearfix"
></div>
<div
class=
"right-sidebar-box"
>
<div
class=
"right-sidebar-messages"
>
<div
class=
"right-sidebar-title clearfix"
>
<br><br>
<h3>
Fİltre başlığı
</h3>
</div>
<div
class=
"right-sidebar-message-block"
>
<div
class=
"col-md-12"
>
<br>
<label
class=
"control-label"
for=
"filterSelect"
>
Seçim
</label>
<select
name=
"filterSelect"
id=
"filterSelect"
>
<option
value=
"1"
>
opsiyon 1
</option>
<option
value=
"2"
>
opsiyon 2
</option>
<option
value=
"3"
>
opsiyon 3
</option>
<option
value=
"4"
>
opsiyon 4
</option>
</select>
</div>
</div>
</div>
</div>
<div
class=
"clearfix"
></div>
<div
style=
"margin-top: 40px;"
>
<button
type=
"button"
class=
"btn btn-
primary
"
>
Filtrele
</button>
<button
type=
"button"
class=
"btn btn-
warning"
ng-click=
"filterSubmit()
"
>
Filtrele
</button>
</div>
</div>
\ No newline at end of file
app/components/crud/templates/list.html
View file @
48409879
<div
class=
"starter-template
container
"
>
<div
class=
"starter-template"
>
<sort-directive
ng-if=
"meta['allow_sort']===true"
></sort-directive>
<search-directive
ng-if=
"meta['allow_search']===true"
></search-directive>
<div
class=
"clearfix"
></div>
...
...
@@ -13,7 +13,7 @@
<thead>
<tr>
<td
colspan=
"2"
>
<label>
<label
ng-if=
"meta.allow_selection === true"
>
<input
type=
"checkbox"
style=
"zoom:1.5; margin:5px 0 0 8px;"
>
Hepsini Seç
</label>
...
...
@@ -26,7 +26,7 @@
<tbody>
<tr
ng-repeat=
"object in objects"
ng-if=
"$index>0"
>
<td
width=
"60"
>
<label>
<label
ng-if=
"meta.allow_selection === true"
>
<input
type=
"checkbox"
style=
"zoom:1.5; margin:5px 0 0 8px;"
>
</label>
</td>
...
...
@@ -40,7 +40,7 @@
</td>
<td>
<button
class=
"btn btn-
primary
"
style=
"margin-right: 5px;"
ng-repeat=
"action in object.actions"
<button
class=
"btn btn-
info
"
style=
"margin-right: 5px;"
ng-repeat=
"action in object.actions"
ng-if=
"action.show_as==='button'"
ng-click=
"do_action(object.key, action.cmd, action.mode)"
>
{{action
.name}}
...
...
@@ -55,7 +55,7 @@
<hr/>
<div
class=
"btn-group"
ng-if=
"objects[1]"
>
<button
type=
"button"
class=
"btn btn-
default
dropdown-toggle"
data-toggle=
"dropdown"
aria-haspopup=
"true"
<button
type=
"button"
class=
"btn btn-
info
dropdown-toggle"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
>
İşlemler
<span
class=
"caret"
></span>
</button>
...
...
app/shared/directives.js
View file @
48409879
...
...
@@ -86,7 +86,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
restrict
:
'E'
,
replace
:
true
,
link
:
function
(
$scope
)
{
$scope
.
searchForm
=
[{
key
:
'searchbox'
,
htmlClass
:
"pull-left"
},
{
type
:
"submit"
,
title
:
"Ara"
,
htmlClass
:
"pull-left"
}];
$scope
.
searchForm
=
[{
key
:
'searchbox'
,
htmlClass
:
"pull-left"
},
{
type
:
"submit"
,
title
:
"Ara"
,
style
:
"btn-info"
,
htmlClass
:
"pull-left"
}];
$scope
.
searchSchema
=
{
type
:
"object"
,
properties
:
{
...
...
app/shared/templates/linkedModelModalContent.html
View file @
48409879
<div
class=
"modal-body"
>
<div
class=
"modal-body"
style=
"overflow: auto;"
>
<h3>
{{schema.title}}
</h3>
<div
class=
"buttons-on-top-modal"
></div>
<div
class=
"buttons-on-top-modal
{{formName}}
"
></div>
<hr>
<form
name=
"linkedModelForm"
sf-schema=
"schema"
sf-form=
"form"
sf-model=
"model"
modal-form-locator
></form>
<div
ng-repeat=
"node in Node"
>
...
...
@@ -32,7 +32,7 @@
<hr>
</div>
<hr>
<div
class=
"buttons-on-bottom-modal"
></div>
<div
class=
"buttons-on-bottom-modal
{{formName}}
"
></div>
</div>
<div
class=
"modal-footer"
>
...
...
app/shared/templates/nodeTable.html
View file @
48409879
...
...
@@ -13,12 +13,12 @@
</tr>
<tr
ng-if=
"node.schema.formType=='ListNode'"
>
<th
colspan=
"2"
>
<
label
>
<
input
type=
"checkbox"
style=
"zoom:1.5; margin:5px 0 0 8px;"
>
Hepsini Seç
<
/label
>
<
!--<label>--
>
<
!--<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">--
>
<!--Hepsini Seç-->
<
!--</label>--
>
</th>
<th
ng-repeat=
"(key,value) in node.
model track by $index"
>
{{ key
}}
</th>
<th
ng-repeat=
"(key,value) in node.
items track by $index"
ng-if=
"key!=='idx' && $index === 0"
>
{{ value.verbose_name
}}
</th>
<th>
İşlem
</th>
</tr>
</thead>
...
...
@@ -34,21 +34,21 @@
<td
ng-repeat=
"value in node.model track by $index"
>
{{ value }}
</td>
<td>
<button
modal-for-nodes=
"{{node.schema.model_name}},{{node.schema.formType}},edit"
>
Düzenle
</button><br>
<button>
Sil
</button>
<button
ng-click=
"remove(node)"
>
Sil
</button>
</td>
</tr>
<tr
ng-repeat=
"listnodemodel in node.items track by $index"
ng-if=
"node.schema.formType=='ListNode'"
>
<td
width=
"60"
>
<
label
>
<
input
type=
"checkbox"
style=
"zoom:1.5; margin:5px 0 0 8px;"
>
<
/label
>
<
!--<label>--
>
<
!--<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">--
>
<
!--</label>--
>
</td>
<th
scope=
"row"
style=
"text-align:center"
>
{{$index+1}}
</th>
<td
ng-repeat=
"(k, v) in listnodemodel track by $index"
>
{{ v
}}
</td>
<td
ng-repeat=
"(k, v) in listnodemodel track by $index"
ng-if=
"k!=='idx'"
>
{{ v.unicode
}}
</td>
<td>
<button
modal-for-nodes=
"{{node.schema.model_name}},{{node.schema.formType}},edit,{{$index}}"
>
Düzenle
</button><br>
<button>
Sil
</button>
<button
ng-click=
"remove(listnodemodel)"
>
Sil
</button>
</td>
</tr>
...
...
app/zetalib/form_service.js
View file @
48409879
...
...
@@ -140,7 +140,7 @@ angular.module('formService', ['ui.bootstrap'])
scope
.
form
[
scope
.
form
.
indexOf
(
k
)]
=
{
type
:
v
.
type
,
title
:
v
.
title
,
style
:
"btn-
primary
hide "
+
buttonClass
,
style
:
"btn-
danger
hide "
+
buttonClass
,
onClick
:
function
()
{
delete
scope
.
form_params
.
cmd
;
delete
scope
.
form_params
.
flow
;
...
...
@@ -179,7 +179,7 @@ angular.module('formService', ['ui.bootstrap'])
buttonsToBottom
.
removeClass
(
'hide'
);
//buttonsToTop.removeClass('hide');
});
}
,
500
);
}
// check if type is date and if type date found change it to string
...
...
@@ -216,11 +216,11 @@ angular.module('formService', ['ui.bootstrap'])
scope
.
model
[
k
]
=
date
;
if
(
scope
.
modalElements
)
{
scope
.
validateModalDate
(
k
);
}
scope
.
$broadcast
(
'schemaForm.error.'
+
k
,
'tv4-302'
,
true
);
}
}
});
});
}
,
1000
);
}
if
(
v
.
type
===
'int'
||
v
.
type
===
'float'
)
{
...
...
@@ -257,7 +257,7 @@ angular.module('formService', ['ui.bootstrap'])
});
}
// get selected item from titleMap using model value
if
(
item
.
key
===
scope
.
model
[
k
])
{
if
(
item
.
key
===
scope
.
model
[
k
])
{
formitem
.
selected_item
=
{
value
:
item
.
key
,
name
:
item
.
value
};
}
});
...
...
@@ -270,6 +270,7 @@ angular.module('formService', ['ui.bootstrap'])
);
}
catch
(
e
)
{
angular
.
element
(
document
.
querySelector
(
'input[name='
+
v
.
model_name
+
']'
)).
val
(
formitem
.
selected_item
.
name
);
$log
.
debug
(
'exception'
,
e
);
}
...
...
@@ -390,6 +391,7 @@ angular.module('formService', ['ui.bootstrap'])
}
if
((
v
.
type
===
'ListNode'
||
v
.
type
===
'Node'
)
&&
v
.
widget
!==
'filter_interface'
)
{
//if (v.type === 'ListNode' || v.type === 'Node') {
scope
[
v
.
type
]
=
scope
[
v
.
type
]
||
{};
...
...
@@ -409,7 +411,7 @@ angular.module('formService', ['ui.bootstrap'])
});
if
(
v
.
type
===
'ListNode'
)
{
scope
[
v
.
type
][
k
].
items
=
[]
;
scope
[
v
.
type
][
k
].
items
=
angular
.
copy
(
scope
.
model
[
k
]
||
[])
;
}
angular
.
forEach
(
v
.
schema
,
function
(
item
)
{
...
...
@@ -421,13 +423,7 @@ angular.module('formService', ['ui.bootstrap'])
}
// idx field must be hidden
if
(
item
.
name
===
'idx'
)
{
scope
[
v
.
type
][
k
].
form
.
push
({
type
:
'string'
,
key
:
angular
.
copy
(
item
.
name
),
htmlClass
:
'hidden'
});
}
else
{
if
(
item
.
name
!==
'idx'
)
{
scope
[
v
.
type
][
k
].
form
.
push
(
item
.
name
);
}
...
...
@@ -437,7 +433,19 @@ angular.module('formService', ['ui.bootstrap'])
});
scope
[
v
.
type
][
k
].
model
=
angular
.
copy
(
scope
.
model
[
k
])
||
{};
if
(
scope
.
model
[
k
])
{
angular
.
forEach
(
scope
.
model
[
k
],
function
(
value
,
key
)
{
angular
.
forEach
(
value
,
function
(
y
,
x
)
{
if
(
y
.
constructor
===
Object
)
{
scope
.
model
[
k
][
key
][
x
]
=
y
.
key
;
}
});
});
}
scope
.
model
[
k
]
=
scope
.
model
[
k
]
||
[];
scope
[
v
.
type
][
k
].
model
=
scope
.
model
[
k
];
// lengthModels is length of the listnode models. if greater than 0 show records on template
scope
[
v
.
type
][
k
][
'lengthModels'
]
=
scope
.
model
[
k
]
?
1
:
0
;
...
...
@@ -672,7 +680,7 @@ angular.module('formService', ['ui.bootstrap'])
// todo: diff for all submits to recognize form change. if no change returns to view with no submit
angular
.
forEach
(
$scope
.
ListNode
,
function
(
value
,
key
)
{
$scope
.
model
[
key
]
=
value
.
items
;
$scope
.
model
[
key
]
=
value
.
model
;
});
angular
.
forEach
(
$scope
.
Node
,
function
(
value
,
key
)
{
$scope
.
model
[
key
]
=
value
.
model
;
...
...
@@ -683,9 +691,12 @@ angular.module('formService', ['ui.bootstrap'])
"model"
:
$scope
.
form_params
.
model
,
"cmd"
:
$scope
.
form_params
.
cmd
,
"flow"
:
$scope
.
form_params
.
flow
,
"object_id"
:
$scope
.
object_id
"object_id"
:
$scope
.
object_id
,
"filter"
:
$scope
.
filter
};
debugger
;
return
$http
.
post
(
generator
.
makeUrl
(
$scope
),
data
)
.
success
(
function
(
data
)
{
if
(
redirectTo
===
true
)
{
...
...
@@ -738,10 +749,8 @@ angular.module('formService', ['ui.bootstrap'])
$scope
.
onSubmit
=
function
(
form
)
{
$scope
.
$broadcast
(
'schemaFormValidate'
);
if
(
form
.
$valid
)
{
// send form to modalinstance result function
$uibModalInstance
.
close
(
$scope
);
}
};
...
...
@@ -772,6 +781,7 @@ angular.module('formService', ['ui.bootstrap'])
var
modalInstance
=
$uibModal
.
open
({
animation
:
true
,
backdrop
:
'static'
,
keyboard
:
false
,
templateUrl
:
'shared/templates/listnodeModalContent.html'
,
controller
:
'ModalCtrl'
,
size
:
'lg'
,
...
...
@@ -802,10 +812,13 @@ angular.module('formService', ['ui.bootstrap'])
var
newscope
=
{
url
:
scope
.
node
.
url
,
form_params
:
{
model
:
scope
.
node
.
schema
.
model_name
}
form_params
:
{
model
:
scope
.
node
.
schema
.
model_name
},
edit
:
attribs
[
3
]
};
Generator
.
generate
(
newscope
,
{
forms
:
scope
.
node
});
// modal will add only one item to listNode, so just need one model (not array)
newscope
.
model
=
angular
.
copy
(
newscope
.
model
[
node
.
edit
]
||
newscope
.
model
[
0
]
||
{});
return
newscope
;
}
}
...
...
@@ -820,10 +833,25 @@ angular.module('formService', ['ui.bootstrap'])
}
if
(
childmodel
.
schema
.
formType
===
'ListNode'
)
{
// reformat listnode model
var
reformattedModel
=
{};
angular
.
forEach
(
childmodel
.
model
,
function
(
value
,
key
)
{
if
(
key
.
indexOf
(
'_id'
)
>
-
1
)
{
angular
.
forEach
(
childmodel
.
form
,
function
(
v
,
k
)
{
if
(
v
.
formName
===
key
)
{
//if (!childmodel.model[key].key) {
function
indexInTitleMap
(
element
,
index
,
array
){
if
(
element
[
'value'
]
===
value
){
return
element
;}}
reformattedModel
[
key
]
=
{
"key"
:
value
,
"unicode"
:
v
.
titleMap
.
find
(
indexInTitleMap
).
name
};
//}
}
});
}
});
if
(
childmodel
.
edit
)
{
listNodeItem
.
model
[
childmodel
.
edit
]
=
childmodel
.
model
;
}
else
{
listNodeItem
.
items
.
push
(
angular
.
copy
(
childmodel
.
model
));
listNodeItem
.
model
.
push
(
angular
.
copy
(
childmodel
.
model
));
listNodeItem
.
items
.
push
(
reformattedModel
);
}
listNodeItem
.
lengthModels
+=
1
;
}
...
...
@@ -849,6 +877,7 @@ angular.module('formService', ['ui.bootstrap'])
var
modalInstance
=
$uibModal
.
open
({
animation
:
true
,
backdrop
:
'static'
,
keyboard
:
false
,
templateUrl
:
'shared/templates/linkedModelModalContent.html'
,
controller
:
'ModalCtrl'
,
size
:
'lg'
,
...
...
@@ -866,7 +895,7 @@ angular.module('formService', ['ui.bootstrap'])
none
:
''
},
workOnForm
:
'linkedModelForm'
,
workOnDiv
:
'-modal'
workOnDiv
:
'-modal'
+
formName
},
submitModalForm
:
function
()
{
$rootScope
.
$broadcast
(
'submitModalForm'
);
...
...
dist/app.js
View file @
48409879
/*! ulakbus-ui 2015-12-03 */
"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"
});
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
.
$on
(
"$routeChangeStart"
,
function
(
event
,
next
,
current
){})}).
config
([
"$httpProvider"
,
function
(
$httpProvider
){
$httpProvider
.
defaults
.
withCredentials
=!
0
}]).
run
(
function
(
gettextCatalog
){
gettextCatalog
.
setCurrentLanguage
(
"tr"
),
gettextCatalog
.
debug
=!
0
}).
config
([
"cfpLoadingBarProvider"
,
function
(
cfpLoadingBarProvider
){
cfpLoadingBarProvider
.
includeBar
=!
1
,
cfpLoadingBarProvider
.
parentSelector
=
"loaderdiv"
,
cfpLoadingBarProvider
.
spinnerTemplate
=
'<div class="loader">Loading...</div>'
}]),
app
.
config
([
"$httpProvider"
,
function
(
$httpProvider
){
$httpProvider
.
interceptors
.
push
(
function
(
$q
,
$rootScope
,
$location
,
$timeout
){
return
{
request
:
function
(
config
){
return
"POST"
===
config
.
method
&&
(
config
.
headers
[
"Content-Type"
]
=
"text/plain"
),
config
},
response
:
function
(
response
){
return
response
.
data
.
_debug_queries
&&
response
.
data
.
_debug_queries
.
length
>
0
&&
(
$rootScope
.
debug_queries
=
$rootScope
.
debug_queries
||
[],
$rootScope
.
debug_queries
.
push
({
url
:
response
.
config
.
url
,
queries
:
response
.
data
.
_debug_queries
})),
response
.
data
.
is_login
===!
1
&&
(
$rootScope
.
loggedInUser
=
response
.
data
.
is_login
,
$location
.
path
(
"/login"
)),
response
.
data
.
is_login
===!
0
&&
(
$rootScope
.
loggedInUser
=!
0
,
"/login"
===
$location
.
path
()
&&
$location
.
path
(
"/dashboard"
)),
response
},
responseError
:
function
(
rejection
){
var
errorModal
=
function
(){
var
codefield
=
""
;
rejection
.
data
.
error
&&
(
codefield
=
"<p><pre>"
+
rejection
.
data
.
error
+
"</pre></p>"
),
$
(
'<div class="modal"><div class="modal-dialog" style="width:1024px;" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</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">Close</button></div></div></div></div>'
).
modal
()};
return
-
1
===
rejection
.
status
&&
(
rejection
.
data
=
{
title
:
"error"
,
description
:
"connection failed"
},
errorModal
()),
400
===
rejection
.
status
&&
$location
.
reload
(),
401
===
rejection
.
status
&&
(
$location
.
path
(
"/login"
),
"/login"
===
$location
.
path
()
&&
console
.
log
(
"show errors on login form"
)),
403
===
rejection
.
status
&&
(
rejection
.
data
.
is_login
===!
0
&&
(
$rootScope
.
loggedInUser
=!
0
,
"/login"
===
$location
.
path
()
&&
$location
.
path
(
"/dashboard"
)),
errorModal
()),
$rootScope
.
$broadcast
(
"show_notifications"
,
rejection
.
data
),
404
===
rejection
.
status
&&
errorModal
(),
500
===
rejection
.
status
&&
errorModal
(),
$q
.
reject
(
rejection
)}}})}]),
angular
.
module
(
"formService"
,[
"ui.bootstrap"
]).
factory
(
"Generator"
,
function
(
$http
,
$q
,
$timeout
,
$location
,
$route
,
$compile
,
$log
,
RESTURL
,
$rootScope
){
var
generator
=
{};
return
generator
.
makeUrl
=
function
(
scope
){
var
getparams
=
scope
.
form_params
.
param
?
"?"
+
scope
.
form_params
.
param
+
"="
+
scope
.
form_params
.
id
:
""
;
return
RESTURL
.
url
+
scope
.
url
+
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
(
formObject
){
return
formObject
},
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
(
"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-primary 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
),
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"
)})}
if
(
"date"
===
v
.
type
&&
(
scope
.
form
[
scope
.
form
.
indexOf
(
k
)]
=
{
key
:
k
,
name
:
k
,
validationMessage
:{
dateNotValid
:
"Girdiğiniz tarih geçerli değildir. <i>orn: '01.01.2015'<i/>"
},
$asyncValidators
:{
dateNotValid
:
function
(
value
){
var
deferred
=
$q
.
defer
();
return
$timeout
(
function
(){
var
dateValue
=
d
=
value
.
split
(
"."
);
isNaN
(
Date
.
parse
([
d
[
1
],
d
[
0
],
d
[
2
]].
join
(
"."
)))
||
3
!==
dateValue
.
length
?
deferred
.
reject
():
deferred
.
resolve
()},
500
),
deferred
.
promise
}}},
v
.
type
=
"string"
,
scope
.
model
[
k
]
=
generator
.
dateformatter
(
scope
.
model
[
k
]),
$timeout
(
function
(){
jQuery
(
"#"
+
k
).
datepicker
({
changeMonth
:
!
0
,
changeYear
:
!
0
,
dateFormat
:
"dd.mm.yy"
,
onSelect
:
function
(
date
,
inst
){
scope
.
model
[
k
]
=
date
,
scope
.
modalElements
&&
scope
.
validateModalDate
(
k
),
scope
.
$broadcast
(
"schemaForm.error."
+
k
,
"tv4-302"
,
!
0
)}})})),(
"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
,
form_params
:{
model
:
v
.
model_name
,
cmd
:
v
.
list_cmd
}};
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
}),
item
.
key
===
scope
.
model
[
k
]
&&
(
formitem
.
selected_item
=
{
value
:
item
.
key
,
name
:
item
.
value
})});
try
{
scope
.
$watch
(
document
.
querySelector
(
"input[name="
+
v
.
model_name
+
"]"
),
function
(){
angular
.
element
(
document
.
querySelector
(
"input[name="
+
v
.
model_name
+
"]"
)).
val
(
formitem
.
selected_item
.
name
)})}
catch
(
e
){
$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
:
v
.
model_name
,
model_name
:
v
.
model_name
,
selected_item
:{},
titleMap
:
scope
.
generateTitleMap
(
modelScope
),
onSelect
:
function
(
item
){
scope
.
model
[
k
]
=
item
.
value
},
onDropdownSelect
:
function
(
item
,
inputname
){
scope
.
model
[
k
]
=
item
.
value
,
jQuery
(
"input[name="
+
inputname
+
"]"
).
val
(
item
.
name
)}},
scope
.
form
[
scope
.
form
.
indexOf
(
k
)]
=
formitem
}
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
,
form_params
:{
model
:
v
.
model_name
||
v
.
schema
[
0
].
model_name
,
cmd
:
v
.
list_cmd
||
"select_list"
}};
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
])})),
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
},
url
:
scope
.
url
}),
"ListNode"
===
v
.
type
&&
(
scope
[
v
.
type
][
k
].
items
=
[]),
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
({
type
:
"string"
,
key
:
angular
.
copy
(
item
.
name
),
htmlClass
:
"hidden"
}):
scope
[
v
.
type
][
k
].
form
.
push
(
item
.
name
),
"date"
===
item
.
type
&&
(
scope
.
model
[
k
][
item
.
name
]
=
generator
.
dateformatter
(
scope
.
model
[
k
][
item
.
name
]))}),
scope
[
v
.
type
][
k
].
model
=
angular
.
copy
(
scope
.
model
[
k
])
||
{},
scope
[
v
.
type
][
k
].
lengthModels
=
scope
.
model
[
k
]?
1
:
0
)}),
$log
.
debug
(
"scope at after prepareformitems"
,
scope
),
scope
},
generator
.
dateformatter
=
function
(
formObject
){
var
ndate
=
new
Date
(
formObject
);
if
(
"Invalid Date"
==
ndate
)
return
""
;
var
newdatearray
=
[
ndate
.
getDate
(),
ndate
.
getMonth
()
+
1
,
ndate
.
getFullYear
()];
return
newdatearray
.
join
(
"."
)},
generator
.
doItemAction
=
function
(
$scope
,
key
,
cmd
,
mode
){
var
_do
=
{
normal
:
function
(){
return
$log
.
debug
(
"normal mode starts"
),
$scope
.
form_params
.
cmd
=
cmd
,
$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
){
var
datevalid
=
Date
.
parse
(
dateValue
)
===
Nan
?
!
1
:
!
0
;
return
datevalid
},
generator
.
asyncValidators
=
{
emailNotValid
:
function
(
value
){
var
deferred
=
$q
.
defer
();
return
$timeout
(
function
(){
generator
.
isValidEmail
(
value
)?
deferred
.
resolve
():
deferred
.
reject
()},
500
),
deferred
.
promise
},
tcNoNotValid
:
function
(
value
){
var
deferred
=
$q
.
defer
();
return
$timeout
(
function
(){
generator
.
isValidTCNo
(
value
)?
deferred
.
resolve
():
deferred
.
reject
()},
500
),
deferred
.
promise
}},
generator
.
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
,
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
=
{};
for
(
key
in
obj1
)
obj2
[
key
]
!=
obj1
[
key
]
&&
(
result
[
key
]
=
obj1
[
key
]),
"array"
==
typeof
obj2
[
key
]
&&
"array"
==
typeof
obj1
[
key
]
&&
(
result
[
key
]
=
arguments
.
callee
(
obj1
[
key
],
obj2
[
key
])),
"object"
==
typeof
obj2
[
key
]
&&
"object"
==
typeof
obj1
[
key
]
&&
(
result
[
key
]
=
arguments
.
callee
(
obj1
[
key
],
obj2
[
key
]));
return
result
},
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
.
submit
=
function
(
$scope
,
redirectTo
){
angular
.
forEach
(
$scope
.
ListNode
,
function
(
value
,
key
){
$scope
.
model
[
key
]
=
value
.
items
}),
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
};
return
$http
.
post
(
generator
.
makeUrl
(
$scope
),
data
).
success
(
function
(
data
){
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"
,
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
=
{
url
:
scope
.
node
.
url
,
form_params
:{
model
:
scope
.
node
.
schema
.
model_name
}};
return
Generator
.
generate
(
newscope
,{
forms
:
scope
.
node
}),
newscope
}}});
modalInstance
.
result
.
then
(
function
(
childmodel
,
key
){
var
listNodeItem
=
scope
.
$parent
[
childmodel
.
schema
.
formType
][
childmodel
.
schema
.
model_name
];
"Node"
===
childmodel
.
schema
.
formType
&&
(
listNodeItem
.
model
=
angular
.
copy
(
childmodel
.
model
),
listNodeItem
.
lengthModels
+=
1
),
"ListNode"
===
childmodel
.
schema
.
formType
&&
(
childmodel
.
edit
?
listNodeItem
.
model
[
childmodel
.
edit
]
=
childmodel
.
model
:
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"
,
templateUrl
:
"shared/templates/linkedModelModalContent.html"
,
controller
:
"ModalCtrl"
,
size
:
"lg"
,
resolve
:{
items
:
function
(){
var
formName
=
attributes
.
addModalForLinkedModel
;
return
Generator
.
get_form
({
url
:
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"
},
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
()},
5
e3
),
$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
){
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"
,
htmlClass
:
"pull-left"
}],
$scope
.
searchSchema
=
{
type
:
"object"
,
properties
:{
searchbox
:{
type
:
"string"
,
minLength
:
2
,
title
:
"Ara"
,
"x-schema-form"
:{
placeholder
:
"Arama kriteri giriniz..."
}}},
required
:[
"searchbox"
]},
$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
,
param
:
"query"
,
id
:
$scope
.
searchModel
.
searchbox
}};
Generator
.
submit
(
searchparams
)}}}}}).
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;"
,
console
.
log
(
"style of header"
,
$location
.
path
())})}}}).
directive
(
"headerBreadcrumb"
,
function
(){
return
{
templateUrl
:
"shared/templates/directives/header-breadcrumb.html"
,
restrict
:
"E"
,
replace
:
!
0
}}).
directive
(
"selectedUser"
,
function
(){
return
{
templateUrl
:
"shared/templates/directives/selected-user.html"
,
restrict
:
"E"
,
replace
:
!
1
,
link
:
function
(
$scope
,
$rootScope
){
$scope
.
selectedUser
=
$rootScope
.
selectedUser
}}}).
directive
(
"sidebar"
,[
"$location"
,
function
(){
return
{
templateUrl
:
"shared/templates/directives/sidebar.html"
,
restrict
:
"E"
,
replace
:
!
0
,
scope
:{},
controller
:
function
(
$scope
,
$rootScope
,
$cookies
,
$route
,
$http
,
RESTURL
,
$location
,
$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"
);
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
){
$scope
.
allMenuItems
[
key
]
=
reGroupMenuItems
(
value
,
key
)}),
$rootScope
.
$broadcast
(
"authz"
,
data
),
$scope
.
menuItems
=
$scope
.
prepareMenu
({
other
:
$scope
.
allMenuItems
.
other
}),
$timeout
(
function
(){
sidebarmenu
.
metisMenu
()})}),
$scope
.
$on
(
"menuitems"
,
function
(
event
,
data
){
var
menu
=
{
other
:
$scope
.
allMenuItems
.
other
};
menu
[
data
]
=
$scope
.
allMenuItems
[
data
],
$scope
.
menuItems
=
$scope
.
prepareMenu
(
menu
),
$timeout
(
function
(){
sidebarmenu
.
metisMenu
()})}),
$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
=
1
)}),
$scope
.
selectedMenu
=
$location
.
path
(),
$scope
.
collapseVar
=
0
,
$scope
.
multiCollapseVar
=
0
,
$scope
.
check
=
function
(
x
){
x
===
$scope
.
collapseVar
?
$scope
.
collapseVar
=
0
:
$scope
.
collapseVar
=
x
},
$scope
.
breadcrumb
=
function
(
itemlist
,
$event
){
$rootScope
.
breadcrumblinks
=
itemlist
,
$rootScope
.
showSaveButton
=!
1
},
$scope
.
multiCheck
=
function
(
y
){
y
===
$scope
.
multiCollapseVar
?
$scope
.
multiCollapseVar
=
0
:
$scope
.
multiCollapseVar
=
y
}}}}]).
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
(
"sidebarSearch"
,
function
(){
return
{
templateUrl
:
"shared/templates/directives/sidebar-search.html"
,
restrict
:
"E"
,
replace
:
!
0
,
scope
:{},
controller
:
function
(
$scope
){
$scope
.
selectedMenu
=
"home"
}}});
var
auth
=
angular
.
module
(
"ulakbus.auth"
,[
"ngRoute"
,
"schemaForm"
,
"ngCookies"
]);
auth
.
controller
(
"LoginCtrl"
,
function
(
$scope
,
$q
,
$timeout
,
$routeParams
,
Generator
,
LoginService
){
$scope
.
url
=
"login"
,
$scope
.
form_params
=
{},
$scope
.
form_params
.
clear_wf
=
1
,
Generator
.
get_form
(
$scope
).
then
(
function
(
data
){
$scope
.
form
=
[{
key
:
"username"
,
type
:
"string"
,
title
:
"Kullanıcı Adı"
},{
key
:
"password"
,
type
:
"password"
,
title
:
"Şifre"
},{
type
:
"submit"
,
title
:
"Giriş Yap"
}]}),
$scope
.
onSubmit
=
function
(
form
){
$scope
.
$broadcast
(
"schemaFormValidate"
),
form
.
$valid
?
LoginService
.
login
(
$scope
.
url
,
$scope
.
model
).
error
(
function
(
data
){
$scope
.
message
=
data
.
title
}):
console
.
log
(
"not valid"
)}}),
auth
.
factory
(
"LoginService"
,
function
(
$http
,
$rootScope
,
$location
,
$log
,
Session
,
RESTURL
){
var
loginService
=
{};
return
loginService
.
login
=
function
(
url
,
credentials
){
return
credentials
.
cmd
=
"do"
,
$http
.
post
(
RESTURL
.
url
+
url
,
credentials
).
success
(
function
(
data
,
status
,
headers
,
config
){
$rootScope
.
loggedInUser
=!
0
}).
error
(
function
(
data
,
status
,
headers
,
config
){
return
data
})},
loginService
.
logout
=
function
(){
return
$log
.
info
(
"logout"
),
$http
.
post
(
RESTURL
.
url
+
"logout"
,{}).
success
(
function
(
data
){
$rootScope
.
loggedInUser
=!
1
,
$log
.
info
(
"loggedout"
),
$location
.
path
(
"/login"
)})},
loginService
.
isAuthenticated
=
function
(){
return
!!
Session
.
userId
},
loginService
.
isAuthorized
=
function
(
authorizedRoles
){
return
angular
.
isArray
(
authorizedRoles
)
||
(
authorizedRoles
=
[
authorizedRoles
]),
loginService
.
isAuthenticated
()
&&-
1
!==
loginService
.
indexOf
(
Session
.
userRole
)},
loginService
.
isValidEmail
=
function
(
email
){
var
re
=
/^
([\w
-
]
+
(?:\.[\w
-
]
+
)
*
)
@
((?:[\w
-
]
+
\.)
*
\w[\w
-
]{0,66})\.([
a-z
]{2,6}(?:\.[
a-z
]{2})?)
$/i
;
return
re
.
test
(
email
)},
loginService
}),
auth
.
service
(
"Session"
,
function
(){
this
.
create
=
function
(
sessionId
,
userId
,
userRole
){
this
.
id
=
sessionId
,
this
.
userId
=
userId
,
this
.
userRole
=
userRole
},
this
.
destroy
=
function
(){
this
.
id
=
null
,
this
.
userId
=
null
,
this
.
userRole
=
null
}}),
angular
.
module
(
"ulakbus.dashboard"
,[
"ngRoute"
]).
controller
(
"DashCtrl"
,
function
(
$scope
,
$rootScope
,
$timeout
,
$http
,
$cookies
,
RESTURL
){
$scope
.
section
=
function
(
section_index
){
$rootScope
.
section
=
section_index
},
$scope
.
$on
(
"authz"
,
function
(
event
,
data
){
$scope
.
menuitems
=
data
}),
$scope
.
student_kw
=
""
,
$scope
.
staff_kw
=
""
,
$scope
.
students
=
[],
$scope
.
staffs
=
[],
$scope
.
search
=
function
(
where
){
$timeout
(
function
(){
"personel"
===
where
&&
$scope
.
staff_kw
.
length
>
2
&&
$scope
.
getItems
(
where
,
$scope
.
staff_kw
).
success
(
function
(
data
){
$scope
.
staffs
=
data
.
results
}),
"ogrenci"
===
where
&&
$scope
.
student_kw
.
length
>
2
&&
$scope
.
getItems
(
where
,
$scope
.
student_kw
).
success
(
function
(
data
){
$scope
.
students
=
data
.
results
})})},
$scope
.
getItems
=
function
(
where
,
what
){
return
$http
.
get
(
RESTURL
.
url
+
"ara/"
+
where
+
"/"
+
what
)},
$scope
.
select
=
function
(
who
,
type
){
$rootScope
.
selectedUser
=
{
name
:
who
[
0
],
tcno
:
who
[
1
],
key
:
who
[
2
]},
$rootScope
.
$broadcast
(
"menuitems"
,
type
)},
$scope
.
$on
(
"notifications"
,
function
(
event
,
data
){
$scope
.
notifications
=
data
}),
$scope
.
markAsRead
=
function
(
items
){
$rootScope
.
$broadcast
(
"markasread"
,
items
)}}).
directive
(
"sidebarNotifications"
,
function
(){
return
{
templateUrl
:
"shared/templates/directives/sidebar-notification.html"
,
restrict
:
"E"
,
replace
:
!
0
,
link
:
function
(
$scope
){}}}),
angular
.
module
(
"ulakbus.crud"
,[
"ui.bootstrap"
,
"schemaForm"
,
"formService"
]).
service
(
"CrudUtility"
,
function
(
$log
){
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
},
scope
.
form_params
[
scope
.
param
]
=
scope
.
param_id
,
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
(
"formLocator"
,
function
(
event
){
$scope
.
formgenerated
=
event
.
targetScope
.
formgenerated
}),
$scope
.
onSubmit
=
function
(
form
){
$scope
.
$broadcast
(
"schemaFormValidate"
),
form
.
$valid
&&
Generator
.
submit
(
$scope
)},
$scope
.
do_action
=
function
(
key
,
cmd
,
mode
){
Generator
.
doItemAction
(
$scope
,
key
,
cmd
,
mode
||
"normal"
)},
$scope
.
getNumber
=
function
(
num
){
return
new
Array
(
num
)},
$timeout
(
function
(){
jQuery
(
".filterDate"
).
datepicker
({
changeMonth
:
!
0
,
changeYear
:
!
0
,
dateFormat
:
"dd.mm.yy"
,
onSelect
:
function
(
date
,
inst
){}}).
datepicker
(
"setDate"
,
new
Date
)}),
$scope
.
showCmd
=
function
(){
CrudUtility
.
generateParam
(
$scope
,
$routeParams
,
$routeParams
.
cmd
);
var
createListObjects
=
function
(){
angular
.
forEach
(
$scope
.
object
,
function
(
value
,
key
){
"object"
==
typeof
value
&&
(
$scope
.
listobjects
[
key
]
=
value
,
delete
$scope
.
object
[
key
])})};
$scope
.
listobjects
=
{};
var
pageData
=
Generator
.
getPageData
();
pageData
.
pageData
===!
0
?(
$scope
.
object
=
pageData
.
object
,
Generator
.
setPageData
({
pageData
:
!
1
})):
Generator
.
get_single_item
(
$scope
).
then
(
function
(
res
){
$scope
.
object
=
res
.
data
.
object
,
$scope
.
model
=
$routeParams
.
model
}),
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
)),(
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
(){
return
{
templateUrl
:
"components/crud/templates/filter.html"
,
restrict
:
"E"
,
replace
:
!
0
}}),
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.5.1"
),
angular
.
module
(
"ulakbus.version.interpolate-filter"
,[]).
filter
(
"interpolate"
,[
"version"
,
function
(
version
){
return
function
(
text
){
return
String
(
text
).
replace
(
/
\%
VERSION
\%
/gm
,
version
)}}]),
angular
.
module
(
"ulakbus.version.version-directive"
,[]).
directive
(
"appVersion"
,[
"version"
,
function
(
version
){
return
function
(
scope
,
elm
,
attrs
){
elm
.
text
(
version
)}}]);
\ No newline at end of file
/*! ulakbus-ui 2015-12-05 */
"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"
});
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
.
$on
(
"$routeChangeStart"
,
function
(
event
,
next
,
current
){})}).
config
([
"$httpProvider"
,
function
(
$httpProvider
){
$httpProvider
.
defaults
.
withCredentials
=!
0
}]).
run
(
function
(
gettextCatalog
){
gettextCatalog
.
setCurrentLanguage
(
"tr"
),
gettextCatalog
.
debug
=!
0
}).
config
([
"cfpLoadingBarProvider"
,
function
(
cfpLoadingBarProvider
){
cfpLoadingBarProvider
.
includeBar
=!
1
,
cfpLoadingBarProvider
.
parentSelector
=
"loaderdiv"
,
cfpLoadingBarProvider
.
spinnerTemplate
=
'<div class="loader">Loading...</div>'
}]),
app
.
config
([
"$httpProvider"
,
function
(
$httpProvider
){
$httpProvider
.
interceptors
.
push
(
function
(
$q
,
$rootScope
,
$location
,
$timeout
){
return
{
request
:
function
(
config
){
return
"POST"
===
config
.
method
&&
(
config
.
headers
[
"Content-Type"
]
=
"text/plain"
),
config
},
response
:
function
(
response
){
return
response
.
data
.
_debug_queries
&&
response
.
data
.
_debug_queries
.
length
>
0
&&
(
$rootScope
.
debug_queries
=
$rootScope
.
debug_queries
||
[],
$rootScope
.
debug_queries
.
push
({
url
:
response
.
config
.
url
,
queries
:
response
.
data
.
_debug_queries
})),
response
.
data
.
is_login
===!
1
&&
(
$rootScope
.
loggedInUser
=
response
.
data
.
is_login
,
$location
.
path
(
"/login"
)),
response
.
data
.
is_login
===!
0
&&
(
$rootScope
.
loggedInUser
=!
0
,
"/login"
===
$location
.
path
()
&&
$location
.
path
(
"/dashboard"
)),
response
},
responseError
:
function
(
rejection
){
var
errorModal
=
function
(){
var
codefield
=
""
;
rejection
.
data
.
error
&&
(
codefield
=
"<p><pre>"
+
rejection
.
data
.
error
+
"</pre></p>"
),
$
(
'<div class="modal"><div class="modal-dialog" style="width:1024px;" role="document"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</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">Close</button></div></div></div></div>'
).
modal
()};
return
-
1
===
rejection
.
status
&&
(
rejection
.
data
=
{
title
:
"error"
,
description
:
"connection failed"
},
errorModal
()),
400
===
rejection
.
status
&&
$location
.
reload
(),
401
===
rejection
.
status
&&
(
$location
.
path
(
"/login"
),
"/login"
===
$location
.
path
()
&&
console
.
log
(
"show errors on login form"
)),
403
===
rejection
.
status
&&
(
rejection
.
data
.
is_login
===!
0
&&
(
$rootScope
.
loggedInUser
=!
0
,
"/login"
===
$location
.
path
()
&&
$location
.
path
(
"/dashboard"
)),
errorModal
()),
$rootScope
.
$broadcast
(
"show_notifications"
,
rejection
.
data
),
404
===
rejection
.
status
&&
errorModal
(),
500
===
rejection
.
status
&&
errorModal
(),
$q
.
reject
(
rejection
)}}})}]),
angular
.
module
(
"formService"
,[
"ui.bootstrap"
]).
factory
(
"Generator"
,
function
(
$http
,
$q
,
$timeout
,
$location
,
$route
,
$compile
,
$log
,
RESTURL
,
$rootScope
){
var
generator
=
{};
return
generator
.
makeUrl
=
function
(
scope
){
var
getparams
=
scope
.
form_params
.
param
?
"?"
+
scope
.
form_params
.
param
+
"="
+
scope
.
form_params
.
id
:
""
;
return
RESTURL
.
url
+
scope
.
url
+
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
(
formObject
){
return
formObject
},
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
(
"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
),
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
&&
(
scope
.
form
[
scope
.
form
.
indexOf
(
k
)]
=
{
key
:
k
,
name
:
k
,
validationMessage
:{
dateNotValid
:
"Girdiğiniz tarih geçerli değildir. <i>orn: '01.01.2015'<i/>"
},
$asyncValidators
:{
dateNotValid
:
function
(
value
){
var
deferred
=
$q
.
defer
();
return
$timeout
(
function
(){
var
dateValue
=
d
=
value
.
split
(
"."
);
isNaN
(
Date
.
parse
([
d
[
1
],
d
[
0
],
d
[
2
]].
join
(
"."
)))
||
3
!==
dateValue
.
length
?
deferred
.
reject
():
deferred
.
resolve
()},
500
),
deferred
.
promise
}}},
v
.
type
=
"string"
,
scope
.
model
[
k
]
=
generator
.
dateformatter
(
scope
.
model
[
k
]),
$timeout
(
function
(){
jQuery
(
"#"
+
k
).
datepicker
({
changeMonth
:
!
0
,
changeYear
:
!
0
,
dateFormat
:
"dd.mm.yy"
,
onSelect
:
function
(
date
,
inst
){
scope
.
model
[
k
]
=
date
,
scope
.
modalElements
&&
(
scope
.
validateModalDate
(
k
),
scope
.
$broadcast
(
"schemaForm.error."
+
k
,
"tv4-302"
,
!
0
))}})},
1
e3
)),(
"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
,
form_params
:{
model
:
v
.
model_name
,
cmd
:
v
.
list_cmd
}};
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
}),
item
.
key
===
scope
.
model
[
k
]
&&
(
formitem
.
selected_item
=
{
value
:
item
.
key
,
name
:
item
.
value
})});
try
{
scope
.
$watch
(
document
.
querySelector
(
"input[name="
+
v
.
model_name
+
"]"
),
function
(){
angular
.
element
(
document
.
querySelector
(
"input[name="
+
v
.
model_name
+
"]"
)).
val
(
formitem
.
selected_item
.
name
)})}
catch
(
e
){
angular
.
element
(
document
.
querySelector
(
"input[name="
+
v
.
model_name
+
"]"
)).
val
(
formitem
.
selected_item
.
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
:
v
.
model_name
,
model_name
:
v
.
model_name
,
selected_item
:{},
titleMap
:
scope
.
generateTitleMap
(
modelScope
),
onSelect
:
function
(
item
){
scope
.
model
[
k
]
=
item
.
value
},
onDropdownSelect
:
function
(
item
,
inputname
){
scope
.
model
[
k
]
=
item
.
value
,
jQuery
(
"input[name="
+
inputname
+
"]"
).
val
(
item
.
name
)}},
scope
.
form
[
scope
.
form
.
indexOf
(
k
)]
=
formitem
}
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
,
form_params
:{
model
:
v
.
model_name
||
v
.
schema
[
0
].
model_name
,
cmd
:
v
.
list_cmd
||
"select_list"
}};
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
])})),
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
},
url
:
scope
.
url
}),
"ListNode"
===
v
.
type
&&
(
scope
[
v
.
type
][
k
].
items
=
angular
.
copy
(
scope
.
model
[
k
]
||
[])),
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
),
"date"
===
item
.
type
&&
(
scope
.
model
[
k
][
item
.
name
]
=
generator
.
dateformatter
(
scope
.
model
[
k
][
item
.
name
]))}),
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
),
scope
},
generator
.
dateformatter
=
function
(
formObject
){
var
ndate
=
new
Date
(
formObject
);
if
(
"Invalid Date"
==
ndate
)
return
""
;
var
newdatearray
=
[
ndate
.
getDate
(),
ndate
.
getMonth
()
+
1
,
ndate
.
getFullYear
()];
return
newdatearray
.
join
(
"."
)},
generator
.
doItemAction
=
function
(
$scope
,
key
,
cmd
,
mode
){
var
_do
=
{
normal
:
function
(){
return
$log
.
debug
(
"normal mode starts"
),
$scope
.
form_params
.
cmd
=
cmd
,
$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
){
var
datevalid
=
Date
.
parse
(
dateValue
)
===
Nan
?
!
1
:
!
0
;
return
datevalid
},
generator
.
asyncValidators
=
{
emailNotValid
:
function
(
value
){
var
deferred
=
$q
.
defer
();
return
$timeout
(
function
(){
generator
.
isValidEmail
(
value
)?
deferred
.
resolve
():
deferred
.
reject
()},
500
),
deferred
.
promise
},
tcNoNotValid
:
function
(
value
){
var
deferred
=
$q
.
defer
();
return
$timeout
(
function
(){
generator
.
isValidTCNo
(
value
)?
deferred
.
resolve
():
deferred
.
reject
()},
500
),
deferred
.
promise
}},
generator
.
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
,
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
=
{};
for
(
key
in
obj1
)
obj2
[
key
]
!=
obj1
[
key
]
&&
(
result
[
key
]
=
obj1
[
key
]),
"array"
==
typeof
obj2
[
key
]
&&
"array"
==
typeof
obj1
[
key
]
&&
(
result
[
key
]
=
arguments
.
callee
(
obj1
[
key
],
obj2
[
key
])),
"object"
==
typeof
obj2
[
key
]
&&
"object"
==
typeof
obj1
[
key
]
&&
(
result
[
key
]
=
arguments
.
callee
(
obj1
[
key
],
obj2
[
key
]));
return
result
},
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
.
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
};
return
$http
.
post
(
generator
.
makeUrl
(
$scope
),
data
).
success
(
function
(
data
){
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
=
{
url
:
scope
.
node
.
url
,
form_params
:{
model
:
scope
.
node
.
schema
.
model_name
},
edit
:
attribs
[
3
]};
return
Generator
.
generate
(
newscope
,{
forms
:
scope
.
node
}),
newscope
.
model
=
angular
.
copy
(
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
})})}),
childmodel
.
edit
?
listNodeItem
.
model
[
childmodel
.
edit
]
=
childmodel
.
model
:(
listNodeItem
.
model
.
push
(
angular
.
copy
(
childmodel
.
model
)),
listNodeItem
.
items
.
push
(
reformattedModel
)),
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
,
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
()},
5
e3
),
$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
){
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
:[
"searchbox"
]},
$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
,
param
:
"query"
,
id
:
$scope
.
searchModel
.
searchbox
}};
Generator
.
submit
(
searchparams
)}}}}}).
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;"
,
console
.
log
(
"style of header"
,
$location
.
path
())})}}}).
directive
(
"headerBreadcrumb"
,
function
(){
return
{
templateUrl
:
"shared/templates/directives/header-breadcrumb.html"
,
restrict
:
"E"
,
replace
:
!
0
}}).
directive
(
"selectedUser"
,
function
(){
return
{
templateUrl
:
"shared/templates/directives/selected-user.html"
,
restrict
:
"E"
,
replace
:
!
1
,
link
:
function
(
$scope
,
$rootScope
){
$scope
.
selectedUser
=
$rootScope
.
selectedUser
}}}).
directive
(
"sidebar"
,[
"$location"
,
function
(){
return
{
templateUrl
:
"shared/templates/directives/sidebar.html"
,
restrict
:
"E"
,
replace
:
!
0
,
scope
:{},
controller
:
function
(
$scope
,
$rootScope
,
$cookies
,
$route
,
$http
,
RESTURL
,
$location
,
$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"
);
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
){
$scope
.
allMenuItems
[
key
]
=
reGroupMenuItems
(
value
,
key
)}),
$rootScope
.
$broadcast
(
"authz"
,
data
),
$scope
.
menuItems
=
$scope
.
prepareMenu
({
other
:
$scope
.
allMenuItems
.
other
}),
$timeout
(
function
(){
sidebarmenu
.
metisMenu
()})}),
$scope
.
$on
(
"menuitems"
,
function
(
event
,
data
){
var
menu
=
{
other
:
$scope
.
allMenuItems
.
other
};
menu
[
data
]
=
$scope
.
allMenuItems
[
data
],
$scope
.
menuItems
=
$scope
.
prepareMenu
(
menu
),
$timeout
(
function
(){
sidebarmenu
.
metisMenu
()})}),
$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
=
1
)}),
$scope
.
selectedMenu
=
$location
.
path
(),
$scope
.
collapseVar
=
0
,
$scope
.
multiCollapseVar
=
0
,
$scope
.
check
=
function
(
x
){
x
===
$scope
.
collapseVar
?
$scope
.
collapseVar
=
0
:
$scope
.
collapseVar
=
x
},
$scope
.
breadcrumb
=
function
(
itemlist
,
$event
){
$rootScope
.
breadcrumblinks
=
itemlist
,
$rootScope
.
showSaveButton
=!
1
},
$scope
.
multiCheck
=
function
(
y
){
y
===
$scope
.
multiCollapseVar
?
$scope
.
multiCollapseVar
=
0
:
$scope
.
multiCollapseVar
=
y
}}}}]).
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
(
"sidebarSearch"
,
function
(){
return
{
templateUrl
:
"shared/templates/directives/sidebar-search.html"
,
restrict
:
"E"
,
replace
:
!
0
,
scope
:{},
controller
:
function
(
$scope
){
$scope
.
selectedMenu
=
"home"
}}});
var
auth
=
angular
.
module
(
"ulakbus.auth"
,[
"ngRoute"
,
"schemaForm"
,
"ngCookies"
]);
auth
.
controller
(
"LoginCtrl"
,
function
(
$scope
,
$q
,
$timeout
,
$routeParams
,
Generator
,
LoginService
){
$scope
.
url
=
"login"
,
$scope
.
form_params
=
{},
$scope
.
form_params
.
clear_wf
=
1
,
Generator
.
get_form
(
$scope
).
then
(
function
(
data
){
$scope
.
form
=
[{
key
:
"username"
,
type
:
"string"
,
title
:
"Kullanıcı Adı"
},{
key
:
"password"
,
type
:
"password"
,
title
:
"Şifre"
},{
type
:
"submit"
,
title
:
"Giriş Yap"
}]}),
$scope
.
onSubmit
=
function
(
form
){
$scope
.
$broadcast
(
"schemaFormValidate"
),
form
.
$valid
?
LoginService
.
login
(
$scope
.
url
,
$scope
.
model
).
error
(
function
(
data
){
$scope
.
message
=
data
.
title
}):
console
.
log
(
"not valid"
)}}),
auth
.
factory
(
"LoginService"
,
function
(
$http
,
$rootScope
,
$location
,
$log
,
Session
,
RESTURL
){
var
loginService
=
{};
return
loginService
.
login
=
function
(
url
,
credentials
){
return
credentials
.
cmd
=
"do"
,
$http
.
post
(
RESTURL
.
url
+
url
,
credentials
).
success
(
function
(
data
,
status
,
headers
,
config
){
$rootScope
.
loggedInUser
=!
0
}).
error
(
function
(
data
,
status
,
headers
,
config
){
return
data
})},
loginService
.
logout
=
function
(){
return
$log
.
info
(
"logout"
),
$http
.
post
(
RESTURL
.
url
+
"logout"
,{}).
success
(
function
(
data
){
$rootScope
.
loggedInUser
=!
1
,
$log
.
info
(
"loggedout"
),
$location
.
path
(
"/login"
)})},
loginService
.
isAuthenticated
=
function
(){
return
!!
Session
.
userId
},
loginService
.
isAuthorized
=
function
(
authorizedRoles
){
return
angular
.
isArray
(
authorizedRoles
)
||
(
authorizedRoles
=
[
authorizedRoles
]),
loginService
.
isAuthenticated
()
&&-
1
!==
loginService
.
indexOf
(
Session
.
userRole
)},
loginService
.
isValidEmail
=
function
(
email
){
var
re
=
/^
([\w
-
]
+
(?:\.[\w
-
]
+
)
*
)
@
((?:[\w
-
]
+
\.)
*
\w[\w
-
]{0,66})\.([
a-z
]{2,6}(?:\.[
a-z
]{2})?)
$/i
;
return
re
.
test
(
email
)},
loginService
}),
auth
.
service
(
"Session"
,
function
(){
this
.
create
=
function
(
sessionId
,
userId
,
userRole
){
this
.
id
=
sessionId
,
this
.
userId
=
userId
,
this
.
userRole
=
userRole
},
this
.
destroy
=
function
(){
this
.
id
=
null
,
this
.
userId
=
null
,
this
.
userRole
=
null
}}),
angular
.
module
(
"ulakbus.dashboard"
,[
"ngRoute"
]).
controller
(
"DashCtrl"
,
function
(
$scope
,
$rootScope
,
$timeout
,
$http
,
$cookies
,
RESTURL
){
$scope
.
section
=
function
(
section_index
){
$rootScope
.
section
=
section_index
},
$scope
.
$on
(
"authz"
,
function
(
event
,
data
){
$scope
.
menuitems
=
data
}),
$scope
.
student_kw
=
""
,
$scope
.
staff_kw
=
""
,
$scope
.
students
=
[],
$scope
.
staffs
=
[],
$scope
.
search
=
function
(
where
){
$timeout
(
function
(){
"personel"
===
where
&&
$scope
.
staff_kw
.
length
>
2
&&
$scope
.
getItems
(
where
,
$scope
.
staff_kw
).
success
(
function
(
data
){
$scope
.
staffs
=
data
.
results
}),
"ogrenci"
===
where
&&
$scope
.
student_kw
.
length
>
2
&&
$scope
.
getItems
(
where
,
$scope
.
student_kw
).
success
(
function
(
data
){
$scope
.
students
=
data
.
results
})})},
$scope
.
getItems
=
function
(
where
,
what
){
return
$http
.
get
(
RESTURL
.
url
+
"ara/"
+
where
+
"/"
+
what
)},
$scope
.
select
=
function
(
who
,
type
){
$rootScope
.
selectedUser
=
{
name
:
who
[
0
],
tcno
:
who
[
1
],
key
:
who
[
2
]},
$rootScope
.
$broadcast
(
"menuitems"
,
type
)},
$scope
.
$on
(
"notifications"
,
function
(
event
,
data
){
$scope
.
notifications
=
data
}),
$scope
.
markAsRead
=
function
(
items
){
$rootScope
.
$broadcast
(
"markasread"
,
items
)}}).
directive
(
"sidebarNotifications"
,
function
(){
return
{
templateUrl
:
"shared/templates/directives/sidebar-notification.html"
,
restrict
:
"E"
,
replace
:
!
0
,
link
:
function
(
$scope
){}}}),
angular
.
module
(
"ulakbus.crud"
,[
"ui.bootstrap"
,
"schemaForm"
,
"formService"
]).
service
(
"CrudUtility"
,
function
(
$log
){
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
},
scope
.
form_params
[
scope
.
param
]
=
scope
.
param_id
,
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
(
"formLocator"
,
function
(
event
){
$scope
.
formgenerated
=
event
.
targetScope
.
formgenerated
}),
$scope
.
onSubmit
=
function
(
form
){
$scope
.
$broadcast
(
"schemaFormValidate"
),
form
.
$valid
&&
Generator
.
submit
(
$scope
)},
$scope
.
filter
=
{},
$scope
.
addToFilter
=
function
(
field
,
filterValue
){},
$scope
.
filterSubmit
=
function
(){},
$scope
.
do_action
=
function
(
key
,
cmd
,
mode
){
Generator
.
doItemAction
(
$scope
,
key
,
cmd
,
mode
||
"normal"
)},
$scope
.
getNumber
=
function
(
num
){
return
new
Array
(
num
)},
$timeout
(
function
(){
jQuery
(
".filterDate"
).
datepicker
({
changeMonth
:
!
0
,
changeYear
:
!
0
,
dateFormat
:
"dd.mm.yy"
,
onSelect
:
function
(
date
,
inst
){}}).
datepicker
(
"setDate"
,
new
Date
)}),
$scope
.
showCmd
=
function
(){
CrudUtility
.
generateParam
(
$scope
,
$routeParams
,
$routeParams
.
cmd
);
var
createListObjects
=
function
(){
angular
.
forEach
(
$scope
.
object
,
function
(
value
,
key
){
"object"
==
typeof
value
&&
(
$scope
.
listobjects
[
key
]
=
value
,
delete
$scope
.
object
[
key
])})};
$scope
.
listobjects
=
{};
var
pageData
=
Generator
.
getPageData
();
pageData
.
pageData
===!
0
?(
$scope
.
object
=
pageData
.
object
,
Generator
.
setPageData
({
pageData
:
!
1
})):
Generator
.
get_single_item
(
$scope
).
then
(
function
(
res
){
$scope
.
object
=
res
.
data
.
object
,
$scope
.
model
=
$routeParams
.
model
}),
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
)),(
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
(){
return
{
templateUrl
:
"components/crud/templates/filter.html"
,
restrict
:
"E"
,
replace
:
!
0
}}),
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.5.1"
),
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
dist/bower_components/components.js
View file @
48409879
This source diff could not be displayed because it is too large. You can
view the blob
instead.
dist/css/app.css
View file @
48409879
...
...
@@ -1670,3 +1670,301 @@ table.dataTable thead .sorting:after {
* Font Awesome 4.3.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/
@font-face
{
font-family
:
'FontAwesome'
;
src
:
url('../fonts/fontawesome-webfont.eot?v=4.3.0')
;
src
:
url('../fonts/fontawesome-webfont.eot?#iefix&v=4.3.0')
format
(
'embedded-opentype'
),
url('../fonts/fontawesome-webfont.woff2?v=4.3.0')
format
(
'woff2'
),
url('../fonts/fontawesome-webfont.woff?v=4.3.0')
format
(
'woff'
),
url('../fonts/fontawesome-webfont.ttf?v=4.3.0')
format
(
'truetype'
),
url('../fonts/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular')
format
(
'svg'
);
font-weight
:
normal
;
font-style
:
normal
}
.fa
{
display
:
inline-block
;
font
:
normal
normal
normal
14px
/
1
FontAwesome
;
font-size
:
inherit
;
text-rendering
:
auto
;
-webkit-font-smoothing
:
antialiased
;
-moz-osx-font-smoothing
:
grayscale
;
transform
:
translate
(
0
,
0
)}
.fa-lg
{
font-size
:
1.33333333em
;
line-height
:
.75em
;
vertical-align
:
-15%
}
.fa-2x
{
font-size
:
2em
}
.fa-3x
{
font-size
:
3em
}
.fa-4x
{
font-size
:
4em
}
.fa-5x
{
font-size
:
5em
}
.fa-fw
{
width
:
1.28571429em
;
text-align
:
center
}
.fa-ul
{
padding-left
:
0
;
margin-left
:
2.14285714em
;
list-style-type
:
none
}
.fa-ul
>
li
{
position
:
relative
}
.fa-li
{
position
:
absolute
;
left
:
-2.14285714em
;
width
:
2.14285714em
;
top
:
.14285714em
;
text-align
:
center
}
.fa-li.fa-lg
{
left
:
-1.85714286em
}
.fa-border
{
padding
:
.2em
.25em
.15em
;
border
:
solid
.08em
#eee
;
border-radius
:
.1em
}
.pull-right
{
float
:
right
}
.pull-left
{
float
:
left
}
.fa.pull-left
{
margin-right
:
.3em
}
.fa.pull-right
{
margin-left
:
.3em
}
.fa-spin
{
-webkit-animation
:
fa-spin
2s
infinite
linear
;
animation
:
fa-spin
2s
infinite
linear
}
.fa-pulse
{
-webkit-animation
:
fa-spin
1s
infinite
steps
(
8
);
animation
:
fa-spin
1s
infinite
steps
(
8
)}
@-webkit-keyframes
fa-spin
{
0
%
{
-webkit-transform
:
rotate
(
0deg
);
transform
:
rotate
(
0deg
)}
100
%
{
-webkit-transform
:
rotate
(
359deg
);
transform
:
rotate
(
359deg
)}}
@keyframes
fa-spin
{
0
%
{
-webkit-transform
:
rotate
(
0deg
);
transform
:
rotate
(
0deg
)}
100
%
{
-webkit-transform
:
rotate
(
359deg
);
transform
:
rotate
(
359deg
)}}
.fa-rotate-90
{
filter
:
progid
:
DXImageTransform
.
Microsoft
.
BasicImage
(
rotation
=
1
);
-webkit-transform
:
rotate
(
90deg
);
-ms-transform
:
rotate
(
90deg
);
transform
:
rotate
(
90deg
)}
.fa-rotate-180
{
filter
:
progid
:
DXImageTransform
.
Microsoft
.
BasicImage
(
rotation
=
2
);
-webkit-transform
:
rotate
(
180deg
);
-ms-transform
:
rotate
(
180deg
);
transform
:
rotate
(
180deg
)}
.fa-rotate-270
{
filter
:
progid
:
DXImageTransform
.
Microsoft
.
BasicImage
(
rotation
=
3
);
-webkit-transform
:
rotate
(
270deg
);
-ms-transform
:
rotate
(
270deg
);
transform
:
rotate
(
270deg
)}
.fa-flip-horizontal
{
filter
:
progid
:
DXImageTransform
.
Microsoft
.
BasicImage
(
rotation
=
0
,
mirror
=
1
);
-webkit-transform
:
scale
(
-1
,
1
);
-ms-transform
:
scale
(
-1
,
1
);
transform
:
scale
(
-1
,
1
)}
.fa-flip-vertical
{
filter
:
progid
:
DXImageTransform
.
Microsoft
.
BasicImage
(
rotation
=
2
,
mirror
=
1
);
-webkit-transform
:
scale
(
1
,
-1
);
-ms-transform
:
scale
(
1
,
-1
);
transform
:
scale
(
1
,
-1
)}
:root
.fa-rotate-90
,
:root
.fa-rotate-180
,
:root
.fa-rotate-270
,
:root
.fa-flip-horizontal
,
:root
.fa-flip-vertical
{
filter
:
none
}
.fa-stack
{
position
:
relative
;
display
:
inline-block
;
width
:
2em
;
height
:
2em
;
line-height
:
2em
;
vertical-align
:
middle
}
.fa-stack-1x
,
.fa-stack-2x
{
position
:
absolute
;
left
:
0
;
width
:
100%
;
text-align
:
center
}
.fa-stack-1x
{
line-height
:
inherit
}
.fa-stack-2x
{
font-size
:
2em
}
.fa-inverse
{
color
:
#fff
}
.fa-glass
:before
{
content
:
"\f000"
}
.fa-music
:before
{
content
:
"\f001"
}
.fa-search
:before
{
content
:
"\f002"
}
.fa-envelope-o
:before
{
content
:
"\f003"
}
.fa-heart
:before
{
content
:
"\f004"
}
.fa-star
:before
{
content
:
"\f005"
}
.fa-star-o
:before
{
content
:
"\f006"
}
.fa-user
:before
{
content
:
"\f007"
}
.fa-film
:before
{
content
:
"\f008"
}
.fa-th-large
:before
{
content
:
"\f009"
}
.fa-th
:before
{
content
:
"\f00a"
}
.fa-th-list
:before
{
content
:
"\f00b"
}
.fa-check
:before
{
content
:
"\f00c"
}
.fa-remove
:before
,
.fa-close
:before
,
.fa-times
:before
{
content
:
"\f00d"
}
.fa-search-plus
:before
{
content
:
"\f00e"
}
.fa-search-minus
:before
{
content
:
"\f010"
}
.fa-power-off
:before
{
content
:
"\f011"
}
.fa-signal
:before
{
content
:
"\f012"
}
.fa-gear
:before
,
.fa-cog
:before
{
content
:
"\f013"
}
.fa-trash-o
:before
{
content
:
"\f014"
}
.fa-home
:before
{
content
:
"\f015"
}
.fa-file-o
:before
{
content
:
"\f016"
}
.fa-clock-o
:before
{
content
:
"\f017"
}
.fa-road
:before
{
content
:
"\f018"
}
.fa-download
:before
{
content
:
"\f019"
}
.fa-arrow-circle-o-down
:before
{
content
:
"\f01a"
}
.fa-arrow-circle-o-up
:before
{
content
:
"\f01b"
}
.fa-inbox
:before
{
content
:
"\f01c"
}
.fa-play-circle-o
:before
{
content
:
"\f01d"
}
.fa-rotate-right
:before
,
.fa-repeat
:before
{
content
:
"\f01e"
}
.fa-refresh
:before
{
content
:
"\f021"
}
.fa-list-alt
:before
{
content
:
"\f022"
}
.fa-lock
:before
{
content
:
"\f023"
}
.fa-flag
:before
{
content
:
"\f024"
}
.fa-headphones
:before
{
content
:
"\f025"
}
.fa-volume-off
:before
{
content
:
"\f026"
}
.fa-volume-down
:before
{
content
:
"\f027"
}
.fa-volume-up
:before
{
content
:
"\f028"
}
.fa-qrcode
:before
{
content
:
"\f029"
}
.fa-barcode
:before
{
content
:
"\f02a"
}
.fa-tag
:before
{
content
:
"\f02b"
}
.fa-tags
:before
{
content
:
"\f02c"
}
.fa-book
:before
{
content
:
"\f02d"
}
.fa-bookmark
:before
{
content
:
"\f02e"
}
.fa-print
:before
{
content
:
"\f02f"
}
.fa-camera
:before
{
content
:
"\f030"
}
.fa-font
:before
{
content
:
"\f031"
}
.fa-bold
:before
{
content
:
"\f032"
}
.fa-italic
:before
{
content
:
"\f033"
}
.fa-text-height
:before
{
content
:
"\f034"
}
.fa-text-width
:before
{
content
:
"\f035"
}
.fa-align-left
:before
{
content
:
"\f036"
}
.fa-align-center
:before
{
content
:
"\f037"
}
.fa-align-right
:before
{
content
:
"\f038"
}
.fa-align-justify
:before
{
content
:
"\f039"
}
.fa-list
:before
{
content
:
"\f03a"
}
.fa-dedent
:before
,
.fa-outdent
:before
{
content
:
"\f03b"
}
.fa-indent
:before
{
content
:
"\f03c"
}
.fa-video-camera
:before
{
content
:
"\f03d"
}
.fa-photo
:before
,
.fa-image
:before
,
.fa-picture-o
:before
{
content
:
"\f03e"
}
.fa-pencil
:before
{
content
:
"\f040"
}
.fa-map-marker
:before
{
content
:
"\f041"
}
.fa-adjust
:before
{
content
:
"\f042"
}
.fa-tint
:before
{
content
:
"\f043"
}
.fa-edit
:before
,
.fa-pencil-square-o
:before
{
content
:
"\f044"
}
.fa-share-square-o
:before
{
content
:
"\f045"
}
.fa-check-square-o
:before
{
content
:
"\f046"
}
.fa-arrows
:before
{
content
:
"\f047"
}
.fa-step-backward
:before
{
content
:
"\f048"
}
.fa-fast-backward
:before
{
content
:
"\f049"
}
.fa-backward
:before
{
content
:
"\f04a"
}
.fa-play
:before
{
content
:
"\f04b"
}
.fa-pause
:before
{
content
:
"\f04c"
}
.fa-stop
:before
{
content
:
"\f04d"
}
.fa-forward
:before
{
content
:
"\f04e"
}
.fa-fast-forward
:before
{
content
:
"\f050"
}
.fa-step-forward
:before
{
content
:
"\f051"
}
.fa-eject
:before
{
content
:
"\f052"
}
.fa-chevron-left
:before
{
content
:
"\f053"
}
.fa-chevron-right
:before
{
content
:
"\f054"
}
.fa-plus-circle
:before
{
content
:
"\f055"
}
.fa-minus-circle
:before
{
content
:
"\f056"
}
.fa-times-circle
:before
{
content
:
"\f057"
}
.fa-check-circle
:before
{
content
:
"\f058"
}
.fa-question-circle
:before
{
content
:
"\f059"
}
.fa-info-circle
:before
{
content
:
"\f05a"
}
.fa-crosshairs
:before
{
content
:
"\f05b"
}
.fa-times-circle-o
:before
{
content
:
"\f05c"
}
.fa-check-circle-o
:before
{
content
:
"\f05d"
}
.fa-ban
:before
{
content
:
"\f05e"
}
.fa-arrow-left
:before
{
content
:
"\f060"
}
.fa-arrow-right
:before
{
content
:
"\f061"
}
.fa-arrow-up
:before
{
content
:
"\f062"
}
.fa-arrow-down
:before
{
content
:
"\f063"
}
.fa-mail-forward
:before
,
.fa-share
:before
{
content
:
"\f064"
}
.fa-expand
:before
{
content
:
"\f065"
}
.fa-compress
:before
{
content
:
"\f066"
}
.fa-plus
:before
{
content
:
"\f067"
}
.fa-minus
:before
{
content
:
"\f068"
}
.fa-asterisk
:before
{
content
:
"\f069"
}
.fa-exclamation-circle
:before
{
content
:
"\f06a"
}
.fa-gift
:before
{
content
:
"\f06b"
}
.fa-leaf
:before
{
content
:
"\f06c"
}
.fa-fire
:before
{
content
:
"\f06d"
}
.fa-eye
:before
{
content
:
"\f06e"
}
.fa-eye-slash
:before
{
content
:
"\f070"
}
.fa-warning
:before
,
.fa-exclamation-triangle
:before
{
content
:
"\f071"
}
.fa-plane
:before
{
content
:
"\f072"
}
.fa-calendar
:before
{
content
:
"\f073"
}
.fa-random
:before
{
content
:
"\f074"
}
.fa-comment
:before
{
content
:
"\f075"
}
.fa-magnet
:before
{
content
:
"\f076"
}
.fa-chevron-up
:before
{
content
:
"\f077"
}
.fa-chevron-down
:before
{
content
:
"\f078"
}
.fa-retweet
:before
{
content
:
"\f079"
}
.fa-shopping-cart
:before
{
content
:
"\f07a"
}
.fa-folder
:before
{
content
:
"\f07b"
}
.fa-folder-open
:before
{
content
:
"\f07c"
}
.fa-arrows-v
:before
{
content
:
"\f07d"
}
.fa-arrows-h
:before
{
content
:
"\f07e"
}
.fa-bar-chart-o
:before
,
.fa-bar-chart
:before
{
content
:
"\f080"
}
.fa-twitter-square
:before
{
content
:
"\f081"
}
.fa-facebook-square
:before
{
content
:
"\f082"
}
.fa-camera-retro
:before
{
content
:
"\f083"
}
.fa-key
:before
{
content
:
"\f084"
}
.fa-gears
:before
,
.fa-cogs
:before
{
content
:
"\f085"
}
.fa-comments
:before
{
content
:
"\f086"
}
.fa-thumbs-o-up
:before
{
content
:
"\f087"
}
.fa-thumbs-o-down
:before
{
content
:
"\f088"
}
.fa-star-half
:before
{
content
:
"\f089"
}
.fa-heart-o
:before
{
content
:
"\f08a"
}
.fa-sign-out
:before
{
content
:
"\f08b"
}
.fa-linkedin-square
:before
{
content
:
"\f08c"
}
.fa-thumb-tack
:before
{
content
:
"\f08d"
}
.fa-external-link
:before
{
content
:
"\f08e"
}
.fa-sign-in
:before
{
content
:
"\f090"
}
.fa-trophy
:before
{
content
:
"\f091"
}
.fa-github-square
:before
{
content
:
"\f092"
}
.fa-upload
:before
{
content
:
"\f093"
}
.fa-lemon-o
:before
{
content
:
"\f094"
}
.fa-phone
:before
{
content
:
"\f095"
}
.fa-square-o
:before
{
content
:
"\f096"
}
.fa-bookmark-o
:before
{
content
:
"\f097"
}
.fa-phone-square
:before
{
content
:
"\f098"
}
.fa-twitter
:before
{
content
:
"\f099"
}
.fa-facebook-f
:before
,
.fa-facebook
:before
{
content
:
"\f09a"
}
.fa-github
:before
{
content
:
"\f09b"
}
.fa-unlock
:before
{
content
:
"\f09c"
}
.fa-credit-card
:before
{
content
:
"\f09d"
}
.fa-rss
:before
{
content
:
"\f09e"
}
.fa-hdd-o
:before
{
content
:
"\f0a0"
}
.fa-bullhorn
:before
{
content
:
"\f0a1"
}
.fa-bell
:before
{
content
:
"\f0f3"
}
.fa-certificate
:before
{
content
:
"\f0a3"
}
.fa-hand-o-right
:before
{
content
:
"\f0a4"
}
.fa-hand-o-left
:before
{
content
:
"\f0a5"
}
.fa-hand-o-up
:before
{
content
:
"\f0a6"
}
.fa-hand-o-down
:before
{
content
:
"\f0a7"
}
.fa-arrow-circle-left
:before
{
content
:
"\f0a8"
}
.fa-arrow-circle-right
:before
{
content
:
"\f0a9"
}
.fa-arrow-circle-up
:before
{
content
:
"\f0aa"
}
.fa-arrow-circle-down
:before
{
content
:
"\f0ab"
}
.fa-globe
:before
{
content
:
"\f0ac"
}
.fa-wrench
:before
{
content
:
"\f0ad"
}
.fa-tasks
:before
{
content
:
"\f0ae"
}
.fa-filter
:before
{
content
:
"\f0b0"
}
.fa-briefcase
:before
{
content
:
"\f0b1"
}
.fa-arrows-alt
:before
{
content
:
"\f0b2"
}
.fa-group
:before
,
.fa-users
:before
{
content
:
"\f0c0"
}
.fa-chain
:before
,
.fa-link
:before
{
content
:
"\f0c1"
}
.fa-cloud
:before
{
content
:
"\f0c2"
}
.fa-flask
:before
{
content
:
"\f0c3"
}
.fa-cut
:before
,
.fa-scissors
:before
{
content
:
"\f0c4"
}
.fa-copy
:before
,
.fa-files-o
:before
{
content
:
"\f0c5"
}
.fa-paperclip
:before
{
content
:
"\f0c6"
}
.fa-save
:before
,
.fa-floppy-o
:before
{
content
:
"\f0c7"
}
.fa-square
:before
{
content
:
"\f0c8"
}
.fa-navicon
:before
,
.fa-reorder
:before
,
.fa-bars
:before
{
content
:
"\f0c9"
}
.fa-list-ul
:before
{
content
:
"\f0ca"
}
.fa-list-ol
:before
{
content
:
"\f0cb"
}
.fa-strikethrough
:before
{
content
:
"\f0cc"
}
.fa-underline
:before
{
content
:
"\f0cd"
}
.fa-table
:before
{
content
:
"\f0ce"
}
.fa-magic
:before
{
content
:
"\f0d0"
}
.fa-truck
:before
{
content
:
"\f0d1"
}
.fa-pinterest
:before
{
content
:
"\f0d2"
}
.fa-pinterest-square
:before
{
content
:
"\f0d3"
}
.fa-google-plus-square
:before
{
content
:
"\f0d4"
}
.fa-google-plus
:before
{
content
:
"\f0d5"
}
.fa-money
:before
{
content
:
"\f0d6"
}
.fa-caret-down
:before
{
content
:
"\f0d7"
}
.fa-caret-up
:before
{
content
:
"\f0d8"
}
.fa-caret-left
:before
{
content
:
"\f0d9"
}
.fa-caret-right
:before
{
content
:
"\f0da"
}
.fa-columns
:before
{
content
:
"\f0db"
}
.fa-unsorted
:before
,
.fa-sort
:before
{
content
:
"\f0dc"
}
.fa-sort-down
:before
,
.fa-sort-desc
:before
{
content
:
"\f0dd"
}
.fa-sort-up
:before
,
.fa-sort-asc
:before
{
content
:
"\f0de"
}
.fa-envelope
:before
{
content
:
"\f0e0"
}
.fa-linkedin
:before
{
content
:
"\f0e1"
}
.fa-rotate-left
:before
,
.fa-undo
:before
{
content
:
"\f0e2"
}
.fa-legal
:before
,
.fa-gavel
:before
{
content
:
"\f0e3"
}
.fa-dashboard
:before
,
.fa-tachometer
:before
{
content
:
"\f0e4"
}
.fa-comment-o
:before
{
content
:
"\f0e5"
}
.fa-comments-o
:before
{
content
:
"\f0e6"
}
.fa-flash
:before
,
.fa-bolt
:before
{
content
:
"\f0e7"
}
.fa-sitemap
:before
{
content
:
"\f0e8"
}
.fa-umbrella
:before
{
content
:
"\f0e9"
}
.fa-paste
:before
,
.fa-clipboard
:before
{
content
:
"\f0ea"
}
.fa-lightbulb-o
:before
{
content
:
"\f0eb"
}
.fa-exchange
:before
{
content
:
"\f0ec"
}
.fa-cloud-download
:before
{
content
:
"\f0ed"
}
.fa-cloud-upload
:before
{
content
:
"\f0ee"
}
.fa-user-md
:before
{
content
:
"\f0f0"
}
.fa-stethoscope
:before
{
content
:
"\f0f1"
}
.fa-suitcase
:before
{
content
:
"\f0f2"
}
.fa-bell-o
:before
{
content
:
"\f0a2"
}
.fa-coffee
:before
{
content
:
"\f0f4"
}
.fa-cutlery
:before
{
content
:
"\f0f5"
}
.fa-file-text-o
:before
{
content
:
"\f0f6"
}
.fa-building-o
:before
{
content
:
"\f0f7"
}
.fa-hospital-o
:before
{
content
:
"\f0f8"
}
.fa-ambulance
:before
{
content
:
"\f0f9"
}
.fa-medkit
:before
{
content
:
"\f0fa"
}
.fa-fighter-jet
:before
{
content
:
"\f0fb"
}
.fa-beer
:before
{
content
:
"\f0fc"
}
.fa-h-square
:before
{
content
:
"\f0fd"
}
.fa-plus-square
:before
{
content
:
"\f0fe"
}
.fa-angle-double-left
:before
{
content
:
"\f100"
}
.fa-angle-double-right
:before
{
content
:
"\f101"
}
.fa-angle-double-up
:before
{
content
:
"\f102"
}
.fa-angle-double-down
:before
{
content
:
"\f103"
}
.fa-angle-left
:before
{
content
:
"\f104"
}
.fa-angle-right
:before
{
content
:
"\f105"
}
.fa-angle-up
:before
{
content
:
"\f106"
}
.fa-angle-down
:before
{
content
:
"\f107"
}
.fa-desktop
:before
{
content
:
"\f108"
}
.fa-laptop
:before
{
content
:
"\f109"
}
.fa-tablet
:before
{
content
:
"\f10a"
}
.fa-mobile-phone
:before
,
.fa-mobile
:before
{
content
:
"\f10b"
}
.fa-circle-o
:before
{
content
:
"\f10c"
}
.fa-quote-left
:before
{
content
:
"\f10d"
}
.fa-quote-right
:before
{
content
:
"\f10e"
}
.fa-spinner
:before
{
content
:
"\f110"
}
.fa-circle
:before
{
content
:
"\f111"
}
.fa-mail-reply
:before
,
.fa-reply
:before
{
content
:
"\f112"
}
.fa-github-alt
:before
{
content
:
"\f113"
}
.fa-folder-o
:before
{
content
:
"\f114"
}
.fa-folder-open-o
:before
{
content
:
"\f115"
}
.fa-smile-o
:before
{
content
:
"\f118"
}
.fa-frown-o
:before
{
content
:
"\f119"
}
.fa-meh-o
:before
{
content
:
"\f11a"
}
.fa-gamepad
:before
{
content
:
"\f11b"
}
.fa-keyboard-o
:before
{
content
:
"\f11c"
}
.fa-flag-o
:before
{
content
:
"\f11d"
}
.fa-flag-checkered
:before
{
content
:
"\f11e"
}
.fa-terminal
:before
{
content
:
"\f120"
}
.fa-code
:before
{
content
:
"\f121"
}
.fa-mail-reply-all
:before
,
.fa-reply-all
:before
{
content
:
"\f122"
}
.fa-star-half-empty
:before
,
.fa-star-half-full
:before
,
.fa-star-half-o
:before
{
content
:
"\f123"
}
.fa-location-arrow
:before
{
content
:
"\f124"
}
.fa-crop
:before
{
content
:
"\f125"
}
.fa-code-fork
:before
{
content
:
"\f126"
}
.fa-unlink
:before
,
.fa-chain-broken
:before
{
content
:
"\f127"
}
.fa-question
:before
{
content
:
"\f128"
}
.fa-info
:before
{
content
:
"\f129"
}
.fa-exclamation
:before
{
content
:
"\f12a"
}
.fa-superscript
:before
{
content
:
"\f12b"
}
.fa-subscript
:before
{
content
:
"\f12c"
}
.fa-eraser
:before
{
content
:
"\f12d"
}
.fa-puzzle-piece
:before
{
content
:
"\f12e"
}
.fa-microphone
:before
{
content
:
"\f130"
}
.fa-microphone-slash
:before
{
content
:
"\f131"
}
.fa-shield
:before
{
content
:
"\f132"
}
.fa-calendar-o
:before
{
content
:
"\f133"
}
.fa-fire-extinguisher
:before
{
content
:
"\f134"
}
.fa-rocket
:before
{
content
:
"\f135"
}
.fa-maxcdn
:before
{
content
:
"\f136"
}
.fa-chevron-circle-left
:before
{
content
:
"\f137"
}
.fa-chevron-circle-right
:before
{
content
:
"\f138"
}
.fa-chevron-circle-up
:before
{
content
:
"\f139"
}
.fa-chevron-circle-down
:before
{
content
:
"\f13a"
}
.fa-html5
:before
{
content
:
"\f13b"
}
.fa-css3
:before
{
content
:
"\f13c"
}
.fa-anchor
:before
{
content
:
"\f13d"
}
.fa-unlock-alt
:before
{
content
:
"\f13e"
}
.fa-bullseye
:before
{
content
:
"\f140"
}
.fa-ellipsis-h
:before
{
content
:
"\f141"
}
.fa-ellipsis-v
:before
{
content
:
"\f142"
}
.fa-rss-square
:before
{
content
:
"\f143"
}
.fa-play-circle
:before
{
content
:
"\f144"
}
.fa-ticket
:before
{
content
:
"\f145"
}
.fa-minus-square
:before
{
content
:
"\f146"
}
.fa-minus-square-o
:before
{
content
:
"\f147"
}
.fa-level-up
:before
{
content
:
"\f148"
}
.fa-level-down
:before
{
content
:
"\f149"
}
.fa-check-square
:before
{
content
:
"\f14a"
}
.fa-pencil-square
:before
{
content
:
"\f14b"
}
.fa-external-link-square
:before
{
content
:
"\f14c"
}
.fa-share-square
:before
{
content
:
"\f14d"
}
.fa-compass
:before
{
content
:
"\f14e"
}
.fa-toggle-down
:before
,
.fa-caret-square-o-down
:before
{
content
:
"\f150"
}
.fa-toggle-up
:before
,
.fa-caret-square-o-up
:before
{
content
:
"\f151"
}
.fa-toggle-right
:before
,
.fa-caret-square-o-right
:before
{
content
:
"\f152"
}
.fa-euro
:before
,
.fa-eur
:before
{
content
:
"\f153"
}
.fa-gbp
:before
{
content
:
"\f154"
}
.fa-dollar
:before
,
.fa-usd
:before
{
content
:
"\f155"
}
.fa-rupee
:before
,
.fa-inr
:before
{
content
:
"\f156"
}
.fa-cny
:before
,
.fa-rmb
:before
,
.fa-yen
:before
,
.fa-jpy
:before
{
content
:
"\f157"
}
.fa-ruble
:before
,
.fa-rouble
:before
,
.fa-rub
:before
{
content
:
"\f158"
}
.fa-won
:before
,
.fa-krw
:before
{
content
:
"\f159"
}
.fa-bitcoin
:before
,
.fa-btc
:before
{
content
:
"\f15a"
}
.fa-file
:before
{
content
:
"\f15b"
}
.fa-file-text
:before
{
content
:
"\f15c"
}
.fa-sort-alpha-asc
:before
{
content
:
"\f15d"
}
.fa-sort-alpha-desc
:before
{
content
:
"\f15e"
}
.fa-sort-amount-asc
:before
{
content
:
"\f160"
}
.fa-sort-amount-desc
:before
{
content
:
"\f161"
}
.fa-sort-numeric-asc
:before
{
content
:
"\f162"
}
.fa-sort-numeric-desc
:before
{
content
:
"\f163"
}
.fa-thumbs-up
:before
{
content
:
"\f164"
}
.fa-thumbs-down
:before
{
content
:
"\f165"
}
.fa-youtube-square
:before
{
content
:
"\f166"
}
.fa-youtube
:before
{
content
:
"\f167"
}
.fa-xing
:before
{
content
:
"\f168"
}
.fa-xing-square
:before
{
content
:
"\f169"
}
.fa-youtube-play
:before
{
content
:
"\f16a"
}
.fa-dropbox
:before
{
content
:
"\f16b"
}
.fa-stack-overflow
:before
{
content
:
"\f16c"
}
.fa-instagram
:before
{
content
:
"\f16d"
}
.fa-flickr
:before
{
content
:
"\f16e"
}
.fa-adn
:before
{
content
:
"\f170"
}
.fa-bitbucket
:before
{
content
:
"\f171"
}
.fa-bitbucket-square
:before
{
content
:
"\f172"
}
.fa-tumblr
:before
{
content
:
"\f173"
}
.fa-tumblr-square
:before
{
content
:
"\f174"
}
.fa-long-arrow-down
:before
{
content
:
"\f175"
}
.fa-long-arrow-up
:before
{
content
:
"\f176"
}
.fa-long-arrow-left
:before
{
content
:
"\f177"
}
.fa-long-arrow-right
:before
{
content
:
"\f178"
}
.fa-apple
:before
{
content
:
"\f179"
}
.fa-windows
:before
{
content
:
"\f17a"
}
.fa-android
:before
{
content
:
"\f17b"
}
.fa-linux
:before
{
content
:
"\f17c"
}
.fa-dribbble
:before
{
content
:
"\f17d"
}
.fa-skype
:before
{
content
:
"\f17e"
}
.fa-foursquare
:before
{
content
:
"\f180"
}
.fa-trello
:before
{
content
:
"\f181"
}
.fa-female
:before
{
content
:
"\f182"
}
.fa-male
:before
{
content
:
"\f183"
}
.fa-gittip
:before
,
.fa-gratipay
:before
{
content
:
"\f184"
}
.fa-sun-o
:before
{
content
:
"\f185"
}
.fa-moon-o
:before
{
content
:
"\f186"
}
.fa-archive
:before
{
content
:
"\f187"
}
.fa-bug
:before
{
content
:
"\f188"
}
.fa-vk
:before
{
content
:
"\f189"
}
.fa-weibo
:before
{
content
:
"\f18a"
}
.fa-renren
:before
{
content
:
"\f18b"
}
.fa-pagelines
:before
{
content
:
"\f18c"
}
.fa-stack-exchange
:before
{
content
:
"\f18d"
}
.fa-arrow-circle-o-right
:before
{
content
:
"\f18e"
}
.fa-arrow-circle-o-left
:before
{
content
:
"\f190"
}
.fa-toggle-left
:before
,
.fa-caret-square-o-left
:before
{
content
:
"\f191"
}
.fa-dot-circle-o
:before
{
content
:
"\f192"
}
.fa-wheelchair
:before
{
content
:
"\f193"
}
.fa-vimeo-square
:before
{
content
:
"\f194"
}
.fa-turkish-lira
:before
,
.fa-try
:before
{
content
:
"\f195"
}
.fa-plus-square-o
:before
{
content
:
"\f196"
}
.fa-space-shuttle
:before
{
content
:
"\f197"
}
.fa-slack
:before
{
content
:
"\f198"
}
.fa-envelope-square
:before
{
content
:
"\f199"
}
.fa-wordpress
:before
{
content
:
"\f19a"
}
.fa-openid
:before
{
content
:
"\f19b"
}
.fa-institution
:before
,
.fa-bank
:before
,
.fa-university
:before
{
content
:
"\f19c"
}
.fa-mortar-board
:before
,
.fa-graduation-cap
:before
{
content
:
"\f19d"
}
.fa-yahoo
:before
{
content
:
"\f19e"
}
.fa-google
:before
{
content
:
"\f1a0"
}
.fa-reddit
:before
{
content
:
"\f1a1"
}
.fa-reddit-square
:before
{
content
:
"\f1a2"
}
.fa-stumbleupon-circle
:before
{
content
:
"\f1a3"
}
.fa-stumbleupon
:before
{
content
:
"\f1a4"
}
.fa-delicious
:before
{
content
:
"\f1a5"
}
.fa-digg
:before
{
content
:
"\f1a6"
}
.fa-pied-piper
:before
{
content
:
"\f1a7"
}
.fa-pied-piper-alt
:before
{
content
:
"\f1a8"
}
.fa-drupal
:before
{
content
:
"\f1a9"
}
.fa-joomla
:before
{
content
:
"\f1aa"
}
.fa-language
:before
{
content
:
"\f1ab"
}
.fa-fax
:before
{
content
:
"\f1ac"
}
.fa-building
:before
{
content
:
"\f1ad"
}
.fa-child
:before
{
content
:
"\f1ae"
}
.fa-paw
:before
{
content
:
"\f1b0"
}
.fa-spoon
:before
{
content
:
"\f1b1"
}
.fa-cube
:before
{
content
:
"\f1b2"
}
.fa-cubes
:before
{
content
:
"\f1b3"
}
.fa-behance
:before
{
content
:
"\f1b4"
}
.fa-behance-square
:before
{
content
:
"\f1b5"
}
.fa-steam
:before
{
content
:
"\f1b6"
}
.fa-steam-square
:before
{
content
:
"\f1b7"
}
.fa-recycle
:before
{
content
:
"\f1b8"
}
.fa-automobile
:before
,
.fa-car
:before
{
content
:
"\f1b9"
}
.fa-cab
:before
,
.fa-taxi
:before
{
content
:
"\f1ba"
}
.fa-tree
:before
{
content
:
"\f1bb"
}
.fa-spotify
:before
{
content
:
"\f1bc"
}
.fa-deviantart
:before
{
content
:
"\f1bd"
}
.fa-soundcloud
:before
{
content
:
"\f1be"
}
.fa-database
:before
{
content
:
"\f1c0"
}
.fa-file-pdf-o
:before
{
content
:
"\f1c1"
}
.fa-file-word-o
:before
{
content
:
"\f1c2"
}
.fa-file-excel-o
:before
{
content
:
"\f1c3"
}
.fa-file-powerpoint-o
:before
{
content
:
"\f1c4"
}
.fa-file-photo-o
:before
,
.fa-file-picture-o
:before
,
.fa-file-image-o
:before
{
content
:
"\f1c5"
}
.fa-file-zip-o
:before
,
.fa-file-archive-o
:before
{
content
:
"\f1c6"
}
.fa-file-sound-o
:before
,
.fa-file-audio-o
:before
{
content
:
"\f1c7"
}
.fa-file-movie-o
:before
,
.fa-file-video-o
:before
{
content
:
"\f1c8"
}
.fa-file-code-o
:before
{
content
:
"\f1c9"
}
.fa-vine
:before
{
content
:
"\f1ca"
}
.fa-codepen
:before
{
content
:
"\f1cb"
}
.fa-jsfiddle
:before
{
content
:
"\f1cc"
}
.fa-life-bouy
:before
,
.fa-life-buoy
:before
,
.fa-life-saver
:before
,
.fa-support
:before
,
.fa-life-ring
:before
{
content
:
"\f1cd"
}
.fa-circle-o-notch
:before
{
content
:
"\f1ce"
}
.fa-ra
:before
,
.fa-rebel
:before
{
content
:
"\f1d0"
}
.fa-ge
:before
,
.fa-empire
:before
{
content
:
"\f1d1"
}
.fa-git-square
:before
{
content
:
"\f1d2"
}
.fa-git
:before
{
content
:
"\f1d3"
}
.fa-hacker-news
:before
{
content
:
"\f1d4"
}
.fa-tencent-weibo
:before
{
content
:
"\f1d5"
}
.fa-qq
:before
{
content
:
"\f1d6"
}
.fa-wechat
:before
,
.fa-weixin
:before
{
content
:
"\f1d7"
}
.fa-send
:before
,
.fa-paper-plane
:before
{
content
:
"\f1d8"
}
.fa-send-o
:before
,
.fa-paper-plane-o
:before
{
content
:
"\f1d9"
}
.fa-history
:before
{
content
:
"\f1da"
}
.fa-genderless
:before
,
.fa-circle-thin
:before
{
content
:
"\f1db"
}
.fa-header
:before
{
content
:
"\f1dc"
}
.fa-paragraph
:before
{
content
:
"\f1dd"
}
.fa-sliders
:before
{
content
:
"\f1de"
}
.fa-share-alt
:before
{
content
:
"\f1e0"
}
.fa-share-alt-square
:before
{
content
:
"\f1e1"
}
.fa-bomb
:before
{
content
:
"\f1e2"
}
.fa-soccer-ball-o
:before
,
.fa-futbol-o
:before
{
content
:
"\f1e3"
}
.fa-tty
:before
{
content
:
"\f1e4"
}
.fa-binoculars
:before
{
content
:
"\f1e5"
}
.fa-plug
:before
{
content
:
"\f1e6"
}
.fa-slideshare
:before
{
content
:
"\f1e7"
}
.fa-twitch
:before
{
content
:
"\f1e8"
}
.fa-yelp
:before
{
content
:
"\f1e9"
}
.fa-newspaper-o
:before
{
content
:
"\f1ea"
}
.fa-wifi
:before
{
content
:
"\f1eb"
}
.fa-calculator
:before
{
content
:
"\f1ec"
}
.fa-paypal
:before
{
content
:
"\f1ed"
}
.fa-google-wallet
:before
{
content
:
"\f1ee"
}
.fa-cc-visa
:before
{
content
:
"\f1f0"
}
.fa-cc-mastercard
:before
{
content
:
"\f1f1"
}
.fa-cc-discover
:before
{
content
:
"\f1f2"
}
.fa-cc-amex
:before
{
content
:
"\f1f3"
}
.fa-cc-paypal
:before
{
content
:
"\f1f4"
}
.fa-cc-stripe
:before
{
content
:
"\f1f5"
}
.fa-bell-slash
:before
{
content
:
"\f1f6"
}
.fa-bell-slash-o
:before
{
content
:
"\f1f7"
}
.fa-trash
:before
{
content
:
"\f1f8"
}
.fa-copyright
:before
{
content
:
"\f1f9"
}
.fa-at
:before
{
content
:
"\f1fa"
}
.fa-eyedropper
:before
{
content
:
"\f1fb"
}
.fa-paint-brush
:before
{
content
:
"\f1fc"
}
.fa-birthday-cake
:before
{
content
:
"\f1fd"
}
.fa-area-chart
:before
{
content
:
"\f1fe"
}
.fa-pie-chart
:before
{
content
:
"\f200"
}
.fa-line-chart
:before
{
content
:
"\f201"
}
.fa-lastfm
:before
{
content
:
"\f202"
}
.fa-lastfm-square
:before
{
content
:
"\f203"
}
.fa-toggle-off
:before
{
content
:
"\f204"
}
.fa-toggle-on
:before
{
content
:
"\f205"
}
.fa-bicycle
:before
{
content
:
"\f206"
}
.fa-bus
:before
{
content
:
"\f207"
}
.fa-ioxhost
:before
{
content
:
"\f208"
}
.fa-angellist
:before
{
content
:
"\f209"
}
.fa-cc
:before
{
content
:
"\f20a"
}
.fa-shekel
:before
,
.fa-sheqel
:before
,
.fa-ils
:before
{
content
:
"\f20b"
}
.fa-meanpath
:before
{
content
:
"\f20c"
}
.fa-buysellads
:before
{
content
:
"\f20d"
}
.fa-connectdevelop
:before
{
content
:
"\f20e"
}
.fa-dashcube
:before
{
content
:
"\f210"
}
.fa-forumbee
:before
{
content
:
"\f211"
}
.fa-leanpub
:before
{
content
:
"\f212"
}
.fa-sellsy
:before
{
content
:
"\f213"
}
.fa-shirtsinbulk
:before
{
content
:
"\f214"
}
.fa-simplybuilt
:before
{
content
:
"\f215"
}
.fa-skyatlas
:before
{
content
:
"\f216"
}
.fa-cart-plus
:before
{
content
:
"\f217"
}
.fa-cart-arrow-down
:before
{
content
:
"\f218"
}
.fa-diamond
:before
{
content
:
"\f219"
}
.fa-ship
:before
{
content
:
"\f21a"
}
.fa-user-secret
:before
{
content
:
"\f21b"
}
.fa-motorcycle
:before
{
content
:
"\f21c"
}
.fa-street-view
:before
{
content
:
"\f21d"
}
.fa-heartbeat
:before
{
content
:
"\f21e"
}
.fa-venus
:before
{
content
:
"\f221"
}
.fa-mars
:before
{
content
:
"\f222"
}
.fa-mercury
:before
{
content
:
"\f223"
}
.fa-transgender
:before
{
content
:
"\f224"
}
.fa-transgender-alt
:before
{
content
:
"\f225"
}
.fa-venus-double
:before
{
content
:
"\f226"
}
.fa-mars-double
:before
{
content
:
"\f227"
}
.fa-venus-mars
:before
{
content
:
"\f228"
}
.fa-mars-stroke
:before
{
content
:
"\f229"
}
.fa-mars-stroke-v
:before
{
content
:
"\f22a"
}
.fa-mars-stroke-h
:before
{
content
:
"\f22b"
}
.fa-neuter
:before
{
content
:
"\f22c"
}
.fa-facebook-official
:before
{
content
:
"\f230"
}
.fa-pinterest-p
:before
{
content
:
"\f231"
}
.fa-whatsapp
:before
{
content
:
"\f232"
}
.fa-server
:before
{
content
:
"\f233"
}
.fa-user-plus
:before
{
content
:
"\f234"
}
.fa-user-times
:before
{
content
:
"\f235"
}
.fa-hotel
:before
,
.fa-bed
:before
{
content
:
"\f236"
}
.fa-viacoin
:before
{
content
:
"\f237"
}
.fa-train
:before
{
content
:
"\f238"
}
.fa-subway
:before
{
content
:
"\f239"
}
.fa-medium
:before
{
content
:
"\f23a"
}
.introjs-overlay
{
position
:
absolute
;
z-index
:
999999
;
background
:
#181818
;
opacity
:
0
;
-webkit-transition
:
all
0.3s
ease-out
;
-moz-transition
:
all
0.3s
ease-out
;
-ms-transition
:
all
0.3s
ease-out
;
-o-transition
:
all
0.3s
ease-out
;
transition
:
all
0.3s
ease-out
;
}
.introjs-fixParent
{
z-index
:
auto
!important
;
opacity
:
1.0
!important
;
}
.introjs-showElement
{
z-index
:
9999999
!important
;
}
.introjs-relativePosition
{
position
:
relative
;
}
.introjs-helperLayer
{
position
:
absolute
;
z-index
:
9999998
;
background-color
:
#FFF
;
background-color
:
rgba
(
255
,
255
,
255
,
.9
);
border
:
1px
solid
#777
;
border
:
2px
solid
rgba
(
117
,
117
,
117
,
1
);
border-radius
:
4px
;
box-shadow
:
0
5px
8px
-3px
rgba
(
0
,
0
,
0
,
.6
);
-webkit-transition
:
all
0.3s
ease-out
;
-moz-transition
:
all
0.3s
ease-out
;
-ms-transition
:
all
0.3s
ease-out
;
-o-transition
:
all
0.3s
ease-out
;
transition
:
all
0.3s
ease-out
;
}
.introjs-helperNumberLayer
{
position
:
absolute
;
top
:
-16px
;
left
:
-9px
;
z-index
:
9999999999
!important
;
padding
:
2px
;
font-family
:
Arial
,
verdana
,
tahoma
;
font-size
:
13px
;
font-weight
:
bold
;
color
:
#fff
;
/* Old browsers */
/* Chrome10+,Safari5.1+ */
background
:
#DA4433
;
width
:
20px
;
box-shadow
:
0
1px
1px
rgba
(
0
,
0
,
0
,
.35
);
height
:
20px
;
text-align
:
center
;
line-height
:
20px
;
border
:
2px
solid
#DA4433
;
border-radius
:
0
;
/* IE6-9 */
/* IE10 text shadows */
}
.introjs-helperNumberLayer
:after
{
content
:
""
;
width
:
0
;
height
:
0
;
position
:
absolute
;
content
:
0
;
left
:
-3px
;
bottom
:
-10px
;
border
:
4px
solid
transparent
;
border-right-color
:
#900
;
border-top-color
:
#900
;
}
.introjs-arrow
{
border
:
5px
solid
white
;
content
:
''
;
position
:
absolute
;
}
.introjs-arrow.top
{
top
:
-10px
;
border-top-color
:
transparent
;
border-right-color
:
transparent
;
border-bottom-color
:
#ecf0f1
;
border-left-color
:
transparent
;
}
.introjs-arrow.right
{
right
:
-10px
;
top
:
10px
;
border-top-color
:
transparent
;
border-right-color
:
transparent
;
border-bottom-color
:
transparent
;
border-left-color
:
#ecf0f1
;
}
.introjs-arrow.bottom
{
bottom
:
-10px
;
border-top-color
:
#ecf0f1
;
border-right-color
:
transparent
;
border-bottom-color
:
transparent
;
border-left-color
:
transparent
;
}
.introjs-arrow.left
{
left
:
-10px
;
top
:
10px
;
border-top-color
:
transparent
;
border-right-color
:
#ecf0f1
;
border-bottom-color
:
transparent
;
border-left-color
:
transparent
;
}
.introjs-tooltip
{
position
:
absolute
;
padding
:
10px
10px
;
background-color
:
#ecf0f1
;
min-width
:
200px
;
max-width
:
300px
;
border-radius
:
3px
;
/* border-radius: 3px; */
/* box-shadow: 0 6px 7px -4px rgba(0,0,0,.4); */
-webkit-transition
:
opacity
0.1s
ease-out
;
-moz-transition
:
opacity
0.1s
ease-out
;
-ms-transition
:
opacity
0.1s
ease-out
;
-o-transition
:
opacity
0.1s
ease-out
;
transition
:
opacity
0.1s
ease-out
;
/* border: 5px double #0787AF; */
}
.introjs-tooltiptext
{
margin-left
:
-10px
;
margin-right
:
-10px
;
/* border-top: 1px solid #FFFFFF; */
/* background: #FAFAFA; */
color
:
#2c3e50
;
padding
:
25px
30px
15px
;
/* border-bottom: 1px solid #FFFFFF; */
}
.introjs-tooltipbuttons
{
text-align
:
center
;
/* background: rgba(0, 0, 0, 0.06); */
border-radius
:
0
0
8px
8px
;
padding-bottom
:
10px
;
}
/*
Buttons style by http://nicolasgallagher.com/lab/css3-github-buttons/
Changed by Afshin Mehrabani
*/
.introjs-button
{
position
:
relative
;
overflow
:
visible
;
display
:
inline-block
;
padding
:
0.5em
0.8em
;
/* box-shadow: 0 2px 0px -0px #306588; */
margin
:
0
;
outline
:
none
;
border
:
2px
solid
;
background
:
transparent
;
text-decoration
:
none
;
font
:
11px
/
normal
sans-serif
;
color
:
#2980b9
!important
;
white-space
:
nowrap
;
cursor
:
pointer
;
outline
:
none
!important
;
-webkit-background-clip
:
padding
;
-moz-background-clip
:
padding
;
-o-background-clip
:
padding-box
;
/*background-clip: padding-box;*/
/* commented out due to Opera 11.10 bug */
-webkit-border-radius
:
0.2em
;
-moz-border-radius
:
0.2em
;
border-radius
:
0.2em
;
/* IE hacks */
zoom
:
1
;
*
display
:
inline
;
margin-top
:
10px
;
transition
:
all
0.25s
ease
;
-webkit-transition
:
all
0.25s
ease
;
-moz-transition
:
all
0.25s
ease
;
-ms-transition
:
all
0.25s
ease
;
-o-transition
:
all
0.25s
ease
;
}
.introjs-button
:hover
{
color
:
#fff
;
background
:
#2671A2
;
text-decoration
:
none
;
border-color
:
#235677
;
}
.introjs-button
:focus
,
.introjs-button
:active
{
background
:
#23587A
;
text-decoration
:
none
;
color
:
#fff
;
/* bottom: -1px; */
box-shadow
:
none
;
border-color
:
#173B53
;
}
/* overrides extra padding on button elements in Firefox */
.introjs-button
::-moz-focus-inner
{
padding
:
0
;
border
:
0
;
}
.introjs-skipbutton
{
margin-right
:
5px
;
color
:
#c00
;
background
:
transparent
;
}
.introjs-skipbutton
:hover
{
background
:
#EB1540
;
border-color
:
#B91D0D
;
}
.introjs-skipbutton
:active
,
.introjs-skipbutton
:focus
{
background
:
#C02312
;
/* box-shadow: 0 1px 0px -0px #6F1309; */
}
.introjs-prevbutton
{
-webkit-border-radius
:
0.2em
0
0
0.2em
;
-moz-border-radius
:
0.2em
0
0
0.2em
;
border-radius
:
0.2em
0
0
0.2em
;
border-right
:
none
;
}
.introjs-nextbutton
{
-webkit-border-radius
:
0
0.2em
0.2em
0
;
-moz-border-radius
:
0
0.2em
0.2em
0
;
border-radius
:
0
0.2em
0.2em
0
;
}
.introjs-disabled
,
.introjs-disabled
:hover
,
.introjs-disabled
:focus
{
color
:
#C2C2C2
!important
;
border-color
:
#d4d4d4
;
cursor
:
default
;
/* box-shadow: 0 2px 0px -0px #CACED1; */
background-color
:
#E6E6E6
;
background-image
:
none
;
text-decoration
:
none
;
}
.introjs-bullets
{
text-align
:
center
;
position
:
absolute
;
left
:
0
;
right
:
0
;
top
:
-5px
;
}
.introjs-bullets
ul
{
clear
:
both
;
margin
:
15px
auto
0
;
padding
:
0
;
display
:
inline-block
;
}
.introjs-bullets
ul
li
{
list-style
:
none
;
float
:
left
;
margin
:
0
2px
;
}
.introjs-bullets
ul
li
a
{
display
:
block
;
width
:
6px
;
height
:
6px
;
background
:
#ccc
;
border-radius
:
10px
;
-moz-border-radius
:
10px
;
-webkit-border-radius
:
10px
;
text-decoration
:
none
;
}
.introjs-bullets
ul
li
a
:hover
{
background
:
#999
;
}
.introjs-bullets
ul
li
a
.active
{
background
:
#999
;
}
.introjs-progress
{
background-color
:
#FAFAFA
;
margin
:
5px
20px
;
}
.introjs-progressbar
{
background-color
:
#2980b9
;
}
.introjsFloatingElement
{
position
:
absolute
;
height
:
0
;
width
:
0
;
left
:
50%
;
top
:
50%
;
}
dist/templates.js
View file @
48409879
...
...
@@ -36,12 +36,27 @@ angular.module("components/crud/templates/filter.html", []).run(["$templateCache
$templateCache
.
put
(
"components/crud/templates/filter.html"
,
"<div>
\n
"
+
" <h2>Filtrele</h2>
\n
"
+
" <div class=
\"
right-sidebar-box
\"
>
\n
"
+
" <div class=
\"
right-sidebar-messages
\"
>
\n
"
+
" <div class=
\"
right-sidebar-title clearfix
\"
>
\n
"
+
" <h3>Tarİh Aralığı</h3>
\n
"
+
" <div ng-repeat=
\"
filter in list_filters
\"
>
\n
"
+
" <div>
\n
"
+
" <div class=
\"
clearfix
\"
>
\n
"
+
" <h3>{{filter.verbose_name}}</h3>
\n
"
+
" </div>
\n
"
+
"
\n
"
+
" <div ng-if=
\"
filter.type==='check' || !filter.type
\"
>
\n
"
+
" <div class=
\"
checkbox
\"
ng-repeat=
\"
filterItem in filter.values
\"
>
\n
"
+
" <input type=
\"
checkbox
\"
name=
\"
filter_group[]
\"
value=
\"
{{filterItem.value}}
\"
/>{{filterItem.name}}<br />
\n
"
+
" </div>
\n
"
+
" </div>
\n
"
+
"
\n
"
+
" <div ng-if=
\"
filter.type==='select'
\"
>
\n
"
+
" <div class=
\"
col-md-12
\"
>
\n
"
+
" <select name=
\"
filterSelect
\"
id=
\"
filterSelect
\"
class=
\"
form-control
\"
>
\n
"
+
" <option ng-repeat=
\"
filterItem in filter.values
\"
value=
\"
{{filterItem.value}}
\"
>{{filterItem.name}}</option>
\n
"
+
" </select>
\n
"
+
" </div>
\n
"
+
" <div class=
\"
right-sidebar-message-block
\"
>
\n
"
+
" </div>
\n
"
+
"
\n
"
+
" <div ng-if=
\"
filter.type==='date'
\"
>
\n
"
+
" <div class=
\"
col-md-6
\"
>
\n
"
+
" <br>
\n
"
+
" <label class=
\"
control-label
\"
for=
\"
startDate
\"
>Başlangıç</label>
\n
"
+
...
...
@@ -58,31 +73,8 @@ angular.module("components/crud/templates/filter.html", []).run(["$templateCache
"
\n
"
+
" <div class=
\"
clearfix
\"
></div>
\n
"
+
"
\n
"
+
" <div class=
\"
right-sidebar-box
\"
>
\n
"
+
" <div class=
\"
right-sidebar-messages
\"
>
\n
"
+
" <div class=
\"
right-sidebar-title clearfix
\"
>
\n
"
+
" <br><br>
\n
"
+
" <h3>Fİltre başlığı</h3>
\n
"
+
" </div>
\n
"
+
" <div class=
\"
right-sidebar-message-block
\"
>
\n
"
+
" <div class=
\"
col-md-12
\"
>
\n
"
+
" <br>
\n
"
+
" <label class=
\"
control-label
\"
for=
\"
filterSelect
\"
>Seçim</label>
\n
"
+
" <select name=
\"
filterSelect
\"
id=
\"
filterSelect
\"
>
\n
"
+
" <option value=
\"
1
\"
>opsiyon 1</option>
\n
"
+
" <option value=
\"
2
\"
>opsiyon 2</option>
\n
"
+
" <option value=
\"
3
\"
>opsiyon 3</option>
\n
"
+
" <option value=
\"
4
\"
>opsiyon 4</option>
\n
"
+
" </select>
\n
"
+
" </div>
\n
"
+
" </div>
\n
"
+
" </div>
\n
"
+
" </div>
\n
"
+
"
\n
"
+
" <div class=
\"
clearfix
\"
></div>
\n
"
+
"
\n
"
+
" <div style=
\"
margin-top: 40px;
\"
>
\n
"
+
" <button type=
\"
button
\"
class=
\"
btn btn-
primary
\"
>Filtrele</button>
\n
"
+
" <button type=
\"
button
\"
class=
\"
btn btn-
warning
\"
ng-click=
\"
filterSubmit()
\"
>Filtrele</button>
\n
"
+
" </div>
\n
"
+
"</div>"
);
}]);
...
...
@@ -133,7 +125,7 @@ angular.module("components/crud/templates/form.html", []).run(["$templateCache",
angular
.
module
(
"components/crud/templates/list.html"
,
[]).
run
([
"$templateCache"
,
function
(
$templateCache
)
{
$templateCache
.
put
(
"components/crud/templates/list.html"
,
"<div class=
\"
starter-template
container
\"
>
\n
"
+
"<div class=
\"
starter-template
\"
>
\n
"
+
" <sort-directive ng-if=
\"
meta['allow_sort']===true
\"
></sort-directive>
\n
"
+
" <search-directive ng-if=
\"
meta['allow_search']===true
\"
></search-directive>
\n
"
+
" <div class=
\"
clearfix
\"
></div>
\n
"
+
...
...
@@ -148,7 +140,7 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache",
" <thead>
\n
"
+
" <tr>
\n
"
+
" <td colspan=
\"
2
\"
>
\n
"
+
" <label>
\n
"
+
" <label
ng-if=
\"
meta.allow_selection === true
\"
>
\n
"
+
" <input type=
\"
checkbox
\"
style=
\"
zoom:1.5; margin:5px 0 0 8px;
\"
>
\n
"
+
" Hepsini Seç
\n
"
+
" </label>
\n
"
+
...
...
@@ -161,7 +153,7 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache",
" <tbody>
\n
"
+
" <tr ng-repeat=
\"
object in objects
\"
ng-if=
\"
$index>0
\"
>
\n
"
+
" <td width=
\"
60
\"
>
\n
"
+
" <label>
\n
"
+
" <label
ng-if=
\"
meta.allow_selection === true
\"
>
\n
"
+
" <input type=
\"
checkbox
\"
style=
\"
zoom:1.5; margin:5px 0 0 8px;
\"
>
\n
"
+
" </label>
\n
"
+
" </td>
\n
"
+
...
...
@@ -175,7 +167,7 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache",
" </td>
\n
"
+
"
\n
"
+
" <td>
\n
"
+
" <button class=
\"
btn btn-
primary
\"
style=
\"
margin-right: 5px;
\"
ng-repeat=
\"
action in object.actions
\"\n
"
+
" <button class=
\"
btn btn-
info
\"
style=
\"
margin-right: 5px;
\"
ng-repeat=
\"
action in object.actions
\"\n
"
+
" ng-if=
\"
action.show_as==='button'
\"\n
"
+
" ng-click=
\"
do_action(object.key, action.cmd, action.mode)
\"
>{{action
\n
"
+
" .name}}
\n
"
+
...
...
@@ -190,7 +182,7 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache",
" <hr/>
\n
"
+
"
\n
"
+
" <div class=
\"
btn-group
\"
ng-if=
\"
objects[1]
\"
>
\n
"
+
" <button type=
\"
button
\"
class=
\"
btn btn-
default
dropdown-toggle
\"
data-toggle=
\"
dropdown
\"
aria-haspopup=
\"
true
\"\n
"
+
" <button type=
\"
button
\"
class=
\"
btn btn-
info
dropdown-toggle
\"
data-toggle=
\"
dropdown
\"
aria-haspopup=
\"
true
\"\n
"
+
" aria-expanded=
\"
false
\"
>
\n
"
+
" İşlemler <span class=
\"
caret
\"
></span>
\n
"
+
" </button>
\n
"
+
...
...
@@ -1511,9 +1503,9 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu
angular
.
module
(
"shared/templates/linkedModelModalContent.html"
,
[]).
run
([
"$templateCache"
,
function
(
$templateCache
)
{
$templateCache
.
put
(
"shared/templates/linkedModelModalContent.html"
,
"<div class=
\"
modal-body
\"
>
\n
"
+
"<div class=
\"
modal-body
\"
style=
\"
overflow: auto;
\"
>
\n
"
+
" <h3>{{schema.title}}</h3>
\n
"
+
" <div class=
\"
buttons-on-top-modal
\"
></div>
\n
"
+
" <div class=
\"
buttons-on-top-modal
{{formName}}
\"
></div>
\n
"
+
" <hr>
\n
"
+
" <form name=
\"
linkedModelForm
\"
sf-schema=
\"
schema
\"
sf-form=
\"
form
\"
sf-model=
\"
model
\"
modal-form-locator></form>
\n
"
+
" <div ng-repeat=
\"
node in Node
\"
>
\n
"
+
...
...
@@ -1545,7 +1537,7 @@ angular.module("shared/templates/linkedModelModalContent.html", []).run(["$templ
" <hr>
\n
"
+
" </div>
\n
"
+
" <hr>
\n
"
+
" <div class=
\"
buttons-on-bottom-modal
\"
></div>
\n
"
+
" <div class=
\"
buttons-on-bottom-modal
{{formName}}
\"
></div>
\n
"
+
"</div>
\n
"
+
"<div class=
\"
modal-footer
\"
>
\n
"
+
"
\n
"
+
...
...
@@ -1652,12 +1644,12 @@ angular.module("shared/templates/nodeTable.html", []).run(["$templateCache", fun
" </tr>
\n
"
+
" <tr ng-if=
\"
node.schema.formType=='ListNode'
\"
>
\n
"
+
" <th colspan=
\"
2
\"
>
\n
"
+
" <
label
>
\n
"
+
" <
input type=
\"
checkbox
\"
style=
\"
zoom:1.5; margin:5px 0 0 8px;
\"
>
\n
"
+
"
Hepsini Seç
\n
"
+
" <
/label
>
\n
"
+
" <
!--<label>--
>
\n
"
+
" <
!--<input type=
\"
checkbox
\"
style=
\"
zoom:1.5; margin:5px 0 0 8px;
\"
>--
>
\n
"
+
"
<!--Hepsini Seç-->
\n
"
+
" <
!--</label>--
>
\n
"
+
" </th>
\n
"
+
" <th ng-repeat=
\"
(key,value) in node.
model track by $index
\"
>{{ key
}}</th>
\n
"
+
" <th ng-repeat=
\"
(key,value) in node.
items track by $index
\"
ng-if=
\"
key!=='idx' && $index === 0
\"
>{{ value.verbose_name
}}</th>
\n
"
+
" <th>İşlem</th>
\n
"
+
" </tr>
\n
"
+
" </thead>
\n
"
+
...
...
@@ -1673,21 +1665,21 @@ angular.module("shared/templates/nodeTable.html", []).run(["$templateCache", fun
" <td ng-repeat=
\"
value in node.model track by $index
\"
>{{ value }}</td>
\n
"
+
" <td>
\n
"
+
" <button modal-for-nodes=
\"
{{node.schema.model_name}},{{node.schema.formType}},edit
\"
>Düzenle</button><br>
\n
"
+
" <button>Sil</button>
\n
"
+
" <button
ng-click=
\"
remove(node)
\"
>Sil</button>
\n
"
+
" </td>
\n
"
+
" </tr>
\n
"
+
"
\n
"
+
" <tr ng-repeat=
\"
listnodemodel in node.items track by $index
\"
ng-if=
\"
node.schema.formType=='ListNode'
\"
>
\n
"
+
" <td width=
\"
60
\"
>
\n
"
+
" <
label
>
\n
"
+
" <
input type=
\"
checkbox
\"
style=
\"
zoom:1.5; margin:5px 0 0 8px;
\"
>
\n
"
+
" <
/label
>
\n
"
+
" <
!--<label>--
>
\n
"
+
" <
!--<input type=
\"
checkbox
\"
style=
\"
zoom:1.5; margin:5px 0 0 8px;
\"
>--
>
\n
"
+
" <
!--</label>--
>
\n
"
+
" </td>
\n
"
+
" <th scope=
\"
row
\"
style=
\"
text-align:center
\"
>{{$index+1}}</th>
\n
"
+
" <td ng-repeat=
\"
(k, v) in listnodemodel track by $index
\"
>{{ v
}}</td>
\n
"
+
" <td ng-repeat=
\"
(k, v) in listnodemodel track by $index
\"
ng-if=
\"
k!=='idx'
\"
>{{ v.unicode
}}</td>
\n
"
+
" <td>
\n
"
+
" <button modal-for-nodes=
\"
{{node.schema.model_name}},{{node.schema.formType}},edit,{{$index}}
\"
>Düzenle</button><br>
\n
"
+
" <button>Sil</button>
\n
"
+
" <button
ng-click=
\"
remove(listnodemodel)
\"
>Sil</button>
\n
"
+
" </td>
\n
"
+
" </tr>
\n
"
+
"
\n
"
+
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment