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
299b8a16
Commit
299b8a16
authored
Dec 15, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Feature/issue67'
parents
73d325c1
6faeed33
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
93 additions
and
59 deletions
+93
-59
app.js
app/app.js
+11
-8
main.js
app/main.js
+16
-8
directives.js
app/shared/directives.js
+0
-1
foreignKey.html
app/shared/templates/foreignKey.html
+10
-3
form_service.js
app/zetalib/form_service.js
+41
-19
app.js
dist/app.js
+3
-3
components.js
dist/bower_components/components.js
+1
-1
templates.js
dist/templates.js
+11
-16
No files found.
app/app.js
View file @
299b8a16
...
@@ -62,14 +62,17 @@ constant("USER_ROLES", {
...
@@ -62,14 +62,17 @@ constant("USER_ROLES", {
staff
:
"staff"
,
staff
:
"staff"
,
dean
:
"dean"
dean
:
"dean"
}).
}).
constant
(
'AUTH_EVENTS'
,
{
constant
(
'AUTH_EVENTS'
,
{
loginSuccess
:
'auth-login-success'
,
loginSuccess
:
'auth-login-success'
,
loginFailed
:
'auth-login-failed'
,
loginFailed
:
'auth-login-failed'
,
logoutSuccess
:
'auth-logout-success'
,
logoutSuccess
:
'auth-logout-success'
,
sessionTimeout
:
'auth-session-timeout'
,
sessionTimeout
:
'auth-session-timeout'
,
notAuthenticated
:
'auth-not-authenticated'
,
notAuthenticated
:
'auth-not-authenticated'
,
notAuthorized
:
'auth-not-authorized'
notAuthorized
:
'auth-not-authorized'
});
})
.
config
(
function
(
$logProvider
)
{
$logProvider
.
debugEnabled
(
true
);
});
// test the code with strict di mode to see if it works when minified
// test the code with strict di mode to see if it works when minified
...
...
app/main.js
View file @
299b8a16
...
@@ -67,14 +67,22 @@ constant("USER_ROLES", {
...
@@ -67,14 +67,22 @@ constant("USER_ROLES", {
staff
:
"staff"
,
staff
:
"staff"
,
dean
:
"dean"
dean
:
"dean"
}).
}).
constant
(
'AUTH_EVENTS'
,
{
constant
(
'AUTH_EVENTS'
,
{
loginSuccess
:
'auth-login-success'
,
loginSuccess
:
'auth-login-success'
,
loginFailed
:
'auth-login-failed'
,
loginFailed
:
'auth-login-failed'
,
logoutSuccess
:
'auth-logout-success'
,
logoutSuccess
:
'auth-logout-success'
,
sessionTimeout
:
'auth-session-timeout'
,
sessionTimeout
:
'auth-session-timeout'
,
notAuthenticated
:
'auth-not-authenticated'
,
notAuthenticated
:
'auth-not-authenticated'
,
notAuthorized
:
'auth-not-authorized'
notAuthorized
:
'auth-not-authorized'
});
})
.
config
(
function
(
$logProvider
)
{
// @if NODE_ENV='PRODUCTION'
$logProvider
.
debugEnabled
(
false
);
// @endif
// @if NODE_ENV='DEVELOPMENT'
$logProvider
.
debugEnabled
(
true
);
// @endif
});
// test the code with strict di mode to see if it works when minified
// test the code with strict di mode to see if it works when minified
...
...
app/shared/directives.js
View file @
299b8a16
...
@@ -235,7 +235,6 @@ app.directive('logout', function ($http, $location, RESTURL) {
...
@@ -235,7 +235,6 @@ app.directive('logout', function ($http, $location, RESTURL) {
$scope
.
style
=
'width:calc(100% - 300px);'
;
$scope
.
style
=
'width:calc(100% - 300px);'
;
$scope
.
$on
(
'$routeChangeStart'
,
function
()
{
$scope
.
$on
(
'$routeChangeStart'
,
function
()
{
$scope
.
style
=
$location
.
path
()
===
'/dashboard'
?
'width:calc(100% - 300px);'
:
'width:%100 !important;'
;
$scope
.
style
=
$location
.
path
()
===
'/dashboard'
?
'width:calc(100% - 300px);'
:
'width:%100 !important;'
;
console
.
log
(
'style of header'
,
$location
.
path
())
});
});
}
}
};
};
...
...
app/shared/templates/foreignKey.html
View file @
299b8a16
...
@@ -8,11 +8,12 @@
...
@@ -8,11 +8,12 @@
<div
class=
"form-group input-group"
>
<div
class=
"form-group input-group"
>
<span
class=
"input-group-btn"
>
<span
class=
"input-group-btn"
>
<button
class=
"btn btn-default dropdown-toggle"
type=
"button"
data-toggle=
"dropdown"
>
<button
class=
"btn btn-default dropdown-toggle"
type=
"button"
ng-click=
"form.getDropdownTitleMap()"
data-toggle=
"dropdown"
>
<span
class=
"caret"
></span>
<span
class=
"caret"
></span>
</button>
</button>
<ul
class=
"dropdown-menu"
>
<ul
class=
"dropdown-menu"
>
<li
class=
"text-center"
><a><span
class=
"loader"
></span></a></li>
<li
class=
"text-center"
ng-if=
"form.gettingTitleMap"
><a><span
class=
"loader"
></span></a></li>
<li
ng-repeat=
"item in form.titleMap"
>
<li
ng-repeat=
"item in form.titleMap"
>
<a
ng-click=
"form.onDropdownSelect(item, form.model_name)"
>
{{item
<a
ng-click=
"form.onDropdownSelect(item, form.model_name)"
>
{{item
.name}}
</a>
.name}}
</a>
...
@@ -21,8 +22,10 @@
...
@@ -21,8 +22,10 @@
</span>
</span>
<input
type=
"text"
<input
type=
"text"
ng-model=
"$$value$$"
ng-model=
"$$value$$"
uib-typeahead=
"item as item.name for item in form.getTitleMap($viewValue)
| filter:{name:$viewValue}
"
uib-typeahead=
"item as item.name for item in form.getTitleMap($viewValue)"
typeahead-on-select=
"form.onSelect($item)"
typeahead-on-select=
"form.onSelect($item)"
typeahead-loading=
"loadingTitleMap"
typeahead-no-results=
"noResults"
typeahead-wait-ms=
"500"
placeholder=
"{{form.title}}"
placeholder=
"{{form.title}}"
ng-model-options=
"form.ngModelOptions"
ng-model-options=
"form.ngModelOptions"
ng-disabled=
"form.readonly"
ng-disabled=
"form.readonly"
...
@@ -31,6 +34,10 @@
...
@@ -31,6 +34,10 @@
schema-validate=
"form"
schema-validate=
"form"
name=
"{{form.model_name}}"
/>
name=
"{{form.model_name}}"
/>
</div>
</div>
<div
ng-show=
"loadingTitleMap"
class=
"loader"
></div>
<div
ng-show=
"noResults"
>
<i
class=
"fa fa-close"
></i>
bulunamadı
</div>
<!--<select ng-model="$$value$$"-->
<!--<select ng-model="$$value$$"-->
<!--value="$$value$$"-->
<!--value="$$value$$"-->
...
...
app/zetalib/form_service.js
View file @
299b8a16
...
@@ -259,7 +259,7 @@ angular.module('formService', ['ui.bootstrap'])
...
@@ -259,7 +259,7 @@ angular.module('formService', ['ui.bootstrap'])
//});
//});
scope
.
generateTitleMap
=
function
(
modelScope
)
{
scope
.
generateTitleMap
=
function
(
modelScope
)
{
generator
.
get_list
(
modelScope
).
then
(
function
(
res
)
{
return
generator
.
get_list
(
modelScope
).
then
(
function
(
res
)
{
formitem
.
titleMap
=
[];
formitem
.
titleMap
=
[];
angular
.
forEach
(
res
.
data
.
objects
,
function
(
item
)
{
angular
.
forEach
(
res
.
data
.
objects
,
function
(
item
)
{
if
(
item
!==
"-1"
)
{
if
(
item
!==
"-1"
)
{
...
@@ -268,26 +268,31 @@ angular.module('formService', ['ui.bootstrap'])
...
@@ -268,26 +268,31 @@ angular.module('formService', ['ui.bootstrap'])
"name"
:
item
.
value
"name"
:
item
.
value
});
});
}
}
// get selected item from titleMap using model value
if
(
item
.
key
===
scope
.
model
[
k
])
{
formitem
.
selected_item
=
{
value
:
item
.
key
,
name
:
item
.
value
};
}
});
});
try
{
// after rendering change input value to model value
return
formitem
.
titleMap
;
});
};
// get selected item from titleMap using model value
if
(
scope
.
model
[
k
])
{
generator
.
get_list
({
url
:
'crud'
,
form_params
:
{
model
:
v
.
model_name
,
object_id
:
scope
.
model
[
k
],
cmd
:
'show'
}})
.
then
(
function
(
data
)
{
try
{
scope
.
$watch
(
document
.
querySelector
(
'input[name='
+
v
.
model_name
+
']'
),
scope
.
$watch
(
document
.
querySelector
(
'input[name='
+
v
.
model_name
+
']'
),
function
()
{
function
()
{
angular
.
element
(
document
.
querySelector
(
'input[name='
+
v
.
model_name
+
']'
)).
val
(
formitem
.
selected_item
.
nam
e
);
angular
.
element
(
document
.
querySelector
(
'input[name='
+
v
.
model_name
+
']'
)).
val
(
data
.
data
.
object
.
unicod
e
);
}
}
);
);
}
}
catch
(
e
)
{
catch
(
e
)
{
angular
.
element
(
document
.
querySelector
(
'input[name='
+
v
.
model_name
+
']'
)).
val
(
formitem
.
selected_item
.
nam
e
);
angular
.
element
(
document
.
querySelector
(
'input[name='
+
v
.
model_name
+
']'
)).
val
(
data
.
data
.
object
.
unicod
e
);
$log
.
debug
(
'exception'
,
e
);
$log
.
debug
(
'exception'
,
e
);
}
}
})
});
}
;
}
formitem
=
{
formitem
=
{
type
:
"template"
,
type
:
"template"
,
...
@@ -300,13 +305,30 @@ angular.module('formService', ['ui.bootstrap'])
...
@@ -300,13 +305,30 @@ angular.module('formService', ['ui.bootstrap'])
name
:
v
.
model_name
,
name
:
v
.
model_name
,
model_name
:
v
.
model_name
,
model_name
:
v
.
model_name
,
selected_item
:
{},
selected_item
:
{},
titleMap
:
scope
.
generateTitleMap
(
modelScope
)
,
titleMap
:
[]
,
onSelect
:
function
(
item
)
{
onSelect
:
function
(
item
)
{
scope
.
model
[
k
]
=
item
.
value
;
scope
.
model
[
k
]
=
item
.
value
;
},
},
onDropdownSelect
:
function
(
item
,
inputname
)
{
onDropdownSelect
:
function
(
item
,
inputname
)
{
scope
.
model
[
k
]
=
item
.
value
;
scope
.
model
[
k
]
=
item
.
value
;
jQuery
(
'input[name='
+
inputname
+
']'
).
val
(
item
.
name
);
jQuery
(
'input[name='
+
inputname
+
']'
).
val
(
item
.
name
);
},
getTitleMap
:
function
(
viewValue
)
{
modelScope
.
form_params
.
query
=
viewValue
;
return
scope
.
generateTitleMap
(
modelScope
);
},
getDropdownTitleMap
:
function
()
{
formitem
.
gettingTitleMap
=
true
;
if
(
formitem
.
titleMap
.
length
>
0
)
{
formitem
.
gettingTitleMap
=
false
;
}
else
{
scope
.
generateTitleMap
(
modelScope
)
.
then
(
function
(
data
)
{
formitem
.
titleMap
=
data
;
formitem
.
gettingTitleMap
=
false
;
});
}
}
}
};
};
...
...
dist/app.js
View file @
299b8a16
This diff is collapsed.
Click to expand it.
dist/bower_components/components.js
View file @
299b8a16
This diff is collapsed.
Click to expand it.
dist/templates.js
View file @
299b8a16
angular
.
module
(
'templates-prod'
,
[
'components/auth/fieldset.html'
,
'components/auth/login.html'
,
'components/crud/templates/crud.html'
,
'components/crud/templates/filter.html'
,
'components/crud/templates/form.html'
,
'components/crud/templates/list.html'
,
'components/crud/templates/show.html'
,
'components/dashboard/dashboard.html'
,
'components/debug/debug.html'
,
'components/devSettings/devSettings.html'
,
'components/error_pages/404.html'
,
'components/error_pages/500.html'
,
'components/uitemplates/404.html'
,
'components/uitemplates/500.html'
,
'shared/templates/add.html'
,
'shared/templates/datefield.html'
,
'shared/templates/directives/alert.html'
,
'shared/templates/directives/chat.html'
,
'shared/templates/directives/header-breadcrumb.html'
,
'shared/templates/directives/header-notification.html'
,
'shared/templates/directives/header-sub-menu.html'
,
'shared/templates/directives/menuCollapse.html'
,
'shared/templates/directives/msgbox.html'
,
'shared/templates/directives/notifications.html'
,
'shared/templates/directives/search.html'
,
'shared/templates/directives/selected-user.html'
,
'shared/templates/directives/selectedUserPopover.html'
,
'shared/templates/directives/sidebar-notification.html'
,
'shared/templates/directives/sidebar-search.html'
,
'shared/templates/directives/sidebar.html'
,
'shared/templates/directives/sort.html'
,
'shared/templates/directives/stats.html'
,
'shared/templates/directives/timeline.html'
,
'shared/templates/fieldset.html'
,
'shared/templates/foreignKey.html'
,
'shared/templates/linkedModelModalContent.html'
,
'shared/templates/listnodeModalContent.html'
,
'shared/templates/modalContent.html'
,
'shared/templates/multiselect.html'
,
'shared/templates/nodeTable.html'
,
'shared/templates/select.html'
]);
angular
.
module
(
'templates-prod'
,
[
'components/auth/login.html'
,
'components/crud/templates/crud.html'
,
'components/crud/templates/filter.html'
,
'components/crud/templates/form.html'
,
'components/crud/templates/list.html'
,
'components/crud/templates/show.html'
,
'components/dashboard/dashboard.html'
,
'components/debug/debug.html'
,
'components/devSettings/devSettings.html'
,
'components/error_pages/404.html'
,
'components/error_pages/500.html'
,
'components/uitemplates/404.html'
,
'components/uitemplates/500.html'
,
'shared/templates/add.html'
,
'shared/templates/datefield.html'
,
'shared/templates/directives/alert.html'
,
'shared/templates/directives/chat.html'
,
'shared/templates/directives/header-breadcrumb.html'
,
'shared/templates/directives/header-notification.html'
,
'shared/templates/directives/header-sub-menu.html'
,
'shared/templates/directives/menuCollapse.html'
,
'shared/templates/directives/msgbox.html'
,
'shared/templates/directives/notifications.html'
,
'shared/templates/directives/search.html'
,
'shared/templates/directives/selected-user.html'
,
'shared/templates/directives/selectedUserPopover.html'
,
'shared/templates/directives/sidebar-notification.html'
,
'shared/templates/directives/sidebar-search.html'
,
'shared/templates/directives/sidebar.html'
,
'shared/templates/directives/sort.html'
,
'shared/templates/directives/stats.html'
,
'shared/templates/directives/timeline.html'
,
'shared/templates/fieldset.html'
,
'shared/templates/foreignKey.html'
,
'shared/templates/linkedModelModalContent.html'
,
'shared/templates/listnodeModalContent.html'
,
'shared/templates/modalContent.html'
,
'shared/templates/multiselect.html'
,
'shared/templates/nodeTable.html'
,
'shared/templates/select.html'
]);
angular
.
module
(
"components/auth/fieldset.html"
,
[]).
run
([
"$templateCache"
,
function
(
$templateCache
)
{
$templateCache
.
put
(
"components/auth/fieldset.html"
,
"<div ng-app=
\"
ulakbus.fieldset
\"
class=
\"\"
>
\n
"
+
" <div style=
\"
margin-top: 50px;
\"
>
\n
"
+
" <span class=
\"
label label-warning
\"
>{{message}}</span>
\n
"
+
"
\n
"
+
" <form name=
\"
loginForm
\"
sf-schema=
\"
schema
\"
sf-form=
\"
form
\"
sf-model=
\"
model
\"\n
"
+
" ng-submit=
\"
onSubmit(loginForm)
\"
></form>
\n
"
+
" </div>
\n
"
+
"</div>"
);
}]);
angular
.
module
(
"components/auth/login.html"
,
[]).
run
([
"$templateCache"
,
function
(
$templateCache
)
{
angular
.
module
(
"components/auth/login.html"
,
[]).
run
([
"$templateCache"
,
function
(
$templateCache
)
{
$templateCache
.
put
(
"components/auth/login.html"
,
$templateCache
.
put
(
"components/auth/login.html"
,
...
@@ -1466,11 +1454,12 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu
...
@@ -1466,11 +1454,12 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu
"
\n
"
+
"
\n
"
+
" <div class=
\"
form-group input-group
\"
>
\n
"
+
" <div class=
\"
form-group input-group
\"
>
\n
"
+
" <span class=
\"
input-group-btn
\"
>
\n
"
+
" <span class=
\"
input-group-btn
\"
>
\n
"
+
" <button class=
\"
btn btn-default dropdown-toggle
\"
type=
\"
button
\"
data-toggle=
\"
dropdown
\"
>
\n
"
+
" <button class=
\"
btn btn-default dropdown-toggle
\"
type=
\"
button
\"
ng-click=
\"
form.getDropdownTitleMap()
\"\n
"
+
" data-toggle=
\"
dropdown
\"
>
\n
"
+
" <span class=
\"
caret
\"
></span>
\n
"
+
" <span class=
\"
caret
\"
></span>
\n
"
+
" </button>
\n
"
+
" </button>
\n
"
+
" <ul class=
\"
dropdown-menu
\"
>
\n
"
+
" <ul class=
\"
dropdown-menu
\"
>
\n
"
+
" <li class=
\"
text-center
\"
><a><span class=
\"
loader
\"
></span></a></li>
\n
"
+
" <li class=
\"
text-center
\"
ng-if=
\"
form.gettingTitleMap
\"
><a><span class=
\"
loader
\"
></span></a></li>
\n
"
+
" <li ng-repeat=
\"
item in form.titleMap
\"
>
\n
"
+
" <li ng-repeat=
\"
item in form.titleMap
\"
>
\n
"
+
" <a ng-click=
\"
form.onDropdownSelect(item, form.model_name)
\"
>{{item
\n
"
+
" <a ng-click=
\"
form.onDropdownSelect(item, form.model_name)
\"
>{{item
\n
"
+
" .name}}</a>
\n
"
+
" .name}}</a>
\n
"
+
...
@@ -1479,8 +1468,10 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu
...
@@ -1479,8 +1468,10 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu
" </span>
\n
"
+
" </span>
\n
"
+
" <input type=
\"
text
\"\n
"
+
" <input type=
\"
text
\"\n
"
+
" ng-model=
\"
$$value$$
\"\n
"
+
" ng-model=
\"
$$value$$
\"\n
"
+
" uib-typeahead=
\"
item as item.name for item in form.getTitleMap($viewValue)
| filter:{name:$viewValue}
\"\n
"
+
" uib-typeahead=
\"
item as item.name for item in form.getTitleMap($viewValue)
\"\n
"
+
" typeahead-on-select=
\"
form.onSelect($item)
\"\n
"
+
" typeahead-on-select=
\"
form.onSelect($item)
\"\n
"
+
" typeahead-loading=
\"
loadingTitleMap
\"
typeahead-no-results=
\"
noResults
\"\n
"
+
" typeahead-wait-ms=
\"
500
\"\n
"
+
" placeholder=
\"
{{form.title}}
\"\n
"
+
" placeholder=
\"
{{form.title}}
\"\n
"
+
" ng-model-options=
\"
form.ngModelOptions
\"\n
"
+
" ng-model-options=
\"
form.ngModelOptions
\"\n
"
+
" ng-disabled=
\"
form.readonly
\"\n
"
+
" ng-disabled=
\"
form.readonly
\"\n
"
+
...
@@ -1489,6 +1480,10 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu
...
@@ -1489,6 +1480,10 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu
" schema-validate=
\"
form
\"\n
"
+
" schema-validate=
\"
form
\"\n
"
+
" name=
\"
{{form.model_name}}
\"
/>
\n
"
+
" name=
\"
{{form.model_name}}
\"
/>
\n
"
+
" </div>
\n
"
+
" </div>
\n
"
+
" <div ng-show=
\"
loadingTitleMap
\"
class=
\"
loader
\"
></div>
\n
"
+
" <div ng-show=
\"
noResults
\"
>
\n
"
+
" <i class=
\"
fa fa-close
\"
></i> bulunamadı
\n
"
+
" </div>
\n
"
+
"
\n
"
+
"
\n
"
+
" <!--<select ng-model=
\"
$$value$$
\"
-->
\n
"
+
" <!--<select ng-model=
\"
$$value$$
\"
-->
\n
"
+
" <!--value=
\"
$$value$$
\"
-->
\n
"
+
" <!--value=
\"
$$value$$
\"
-->
\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