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
fa7bf3af
Commit
fa7bf3af
authored
Dec 01, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
listnode fix
parent
9c28d279
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
57 deletions
+119
-57
crud_controller.js
app/components/crud/crud_controller.js
+1
-0
nodeTable.html
app/shared/templates/nodeTable.html
+3
-2
form_service.js
app/zetalib/form_service.js
+35
-24
app.js
dist/app.js
+1
-1
components.js
dist/bower_components/components.js
+18
-13
templates.js
dist/templates.js
+61
-17
No files found.
app/components/crud/crud_controller.js
View file @
fa7bf3af
...
...
@@ -46,6 +46,7 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
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
;
...
...
app/shared/templates/nodeTable.html
View file @
fa7bf3af
<!--<div class="tablescroll">-->
<div
class=
"tablescroll"
>
{{node.model}}
<!--<table class="table table-bordered" style="background-color:#fff;">-->
<!--<thead>-->
<!--<tr ng-if="node.schema.formType=='Node'">-->
...
...
@@ -54,4 +55,4 @@
<!--</tbody>-->
<!--</table>-->
<!--</div>-->
\ No newline at end of file
</div>
\ No newline at end of file
app/zetalib/form_service.js
View file @
fa7bf3af
...
...
@@ -250,12 +250,18 @@ angular.module('formService', ['ui.bootstrap'])
formitem
.
selected_item
=
{
value
:
item
.
key
,
name
:
item
.
value
};
}
});
// after rendering change input value to model value
scope
.
$watch
(
document
.
querySelector
(
'input[name='
+
v
.
model_name
+
']'
),
function
()
{
angular
.
element
(
document
.
querySelector
(
'input[name='
+
v
.
model_name
+
']'
)).
val
(
formitem
.
selected_item
.
name
);
}
);
try
{
// after rendering change input value to model value
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
);
}
})
};
...
...
@@ -369,7 +375,8 @@ angular.module('formService', ['ui.bootstrap'])
scope
[
v
.
type
]
=
scope
[
v
.
type
]
||
{};
scope
[
v
.
type
][
k
]
=
{
// no pass by reference
scope
[
v
.
type
][
k
]
=
angular
.
copy
({
title
:
v
.
title
,
form
:
[],
schema
:
{
...
...
@@ -381,13 +388,16 @@ angular.module('formService', ['ui.bootstrap'])
model_name
:
k
},
url
:
scope
.
url
};
}
)
;
if
(
scope
.
model
[
k
]
===
null
)
{
scope
[
v
.
type
][
k
].
model
=
v
.
type
===
'Node'
?
{}
:
[];
}
else
{
scope
[
v
.
type
][
k
].
model
=
scope
.
model
[
k
];
}
//if (scope.model[k] === null) {
// scope[v.type][k].model = v.type === 'Node' ? {} : [];
//} else {
// scope[v.type][k].model = scope.model[k];
//}
scope
[
v
.
type
][
k
].
model
=
angular
.
copy
(
scope
.
model
[
k
])
||
{};
if
(
v
.
type
===
'ListNode'
)
{
scope
[
v
.
type
][
k
].
items
=
[];}
angular
.
forEach
(
v
.
schema
,
function
(
item
)
{
scope
[
v
.
type
][
k
].
schema
.
properties
[
item
.
name
]
=
item
;
...
...
@@ -761,6 +771,7 @@ angular.module('formService', ['ui.bootstrap'])
};
Generator
.
generate
(
newscope
,
{
forms
:
scope
.
node
});
scope
.
model
=
{};
return
scope
.
node
;
}
}
...
...
@@ -768,17 +779,17 @@ angular.module('formService', ['ui.bootstrap'])
modalInstance
.
result
.
then
(
function
(
childmodel
,
key
)
{
if
(
childmodel
.
schema
.
formType
===
'Node'
)
{
scope
.
$parent
[
childmodel
.
schema
.
formType
][
childmodel
.
schema
.
model_name
].
model
=
childmodel
.
model
;
}
if
(
childmodel
.
schema
.
formType
===
'ListNode'
)
{
if
(
childmodel
.
edit
)
{
scope
.
$parent
[
childmodel
.
schema
.
formType
][
childmodel
.
schema
.
model_name
].
model
[
childmodel
.
edit
]
=
childmodel
.
model
;
}
else
{
scope
.
$parent
[
childmodel
.
schema
.
formType
][
childmodel
.
schema
.
model_name
].
model
.
push
(
childmodel
.
model
);
}
}
//
if (childmodel.schema.formType === 'Node') {
// scope.$parent.model[childmodel.schema.model_name]
= childmodel.model;
//
}
//
//
if (childmodel.schema.formType === 'ListNode') {
//
if (childmodel.edit) {
//
scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].model[childmodel.edit] = childmodel.model;
//
} else {
//
scope.$parent[childmodel.schema.formType][childmodel.schema.model_name].model.push(childmodel.model);
//
}
//
}
scope
.
$parent
[
childmodel
.
schema
.
formType
][
childmodel
.
schema
.
model_name
].
lengthModels
+=
1
;
});
...
...
dist/app.js
View file @
fa7bf3af
This diff is collapsed.
Click to expand it.
dist/bower_components/components.js
View file @
fa7bf3af
This diff is collapsed.
Click to expand it.
dist/templates.js
View file @
fa7bf3af
...
...
@@ -134,7 +134,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
"
+
" <sort-directive></sort-directive>
\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
"
+
" <!--<h1>{{form_params.model || form_params.wf}}</h1>-->
\n
"
+
...
...
@@ -1481,7 +1481,7 @@ angular.module("shared/templates/foreignKey.html", []).run(["$templateCache", fu
" </span>
\n
"
+
" <input type=
\"
text
\"\n
"
+
" ng-model=
\"
$$value$$
\"\n
"
+
"
typeahead=
\"
item.name for item in form.titleMap
\"\n
"
+
"
uib-typeahead=
\"
item as item.name for item in form.titleMap | filter:{name:$viewValue}
\"\n
"
+
" typeahead-on-select=
\"
form.onSelect($item)
\"\n
"
+
" placeholder=
\"
{{form.title}}
\"\n
"
+
" ng-model-options=
\"
form.ngModelOptions
\"\n
"
+
...
...
@@ -1549,23 +1549,67 @@ angular.module("shared/templates/modalContent.html", []).run(["$templateCache",
angular
.
module
(
"shared/templates/multiselect.html"
,
[]).
run
([
"$templateCache"
,
function
(
$templateCache
)
{
$templateCache
.
put
(
"shared/templates/multiselect.html"
,
"<div class=
\"
form-group {{form.htmlClass}} schema-form-select
\"\n
"
+
"<div class=
\"
form-group {{form.htmlClass}} schema-form-select
col-md-12
\"\n
"
+
" ng-class=
\"
{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess(), 'has-feedback': form.feedback !== false}
\"
>
\n
"
+
" <label class=
\"
control-label {{form.labelHtmlClass}}
\"
ng-show=
\"
showTitle()
\"
>
\n
"
+
" {{form.title}}
\n
"
+
" </label>
\n
"
+
" <select ng-model=
\"
$$value$$
\"\n
"
+
" ng-model-options=
\"
form.ngModelOptions
\"\n
"
+
" ng-disabled=
\"
form.readonly
\"\n
"
+
" sf-changed=
\"
form
\"\n
"
+
" class=
\"
form-control {{form.fieldHtmlClass}}
\"\n
"
+
" schema-validate=
\"
form
\"\n
"
+
" ng-options=
\"
item.value as item.name for item in form.titleMap
\"\n
"
+
" name=
\"
{{form.key.slice(-1)[0]}}
\"\n
"
+
" id=
\"
{{form.key.slice(-1)[0]}}
\"
multiple>
\n
"
+
" </select>
\n
"
+
" <div class=
\"
col-md-8
\"
>
\n
"
+
" <label class=
\"
control-label {{form.labelHtmlClass}}
\"
ng-show=
\"
showTitle()
\"
>
\n
"
+
" {{form.title}}
\n
"
+
" </label>
\n
"
+
"
\n
"
+
" <div class=
\"
help-block
\"
sf-message=
\"
form.description
\"
></div>
\n
"
+
" <div class=
\"
row
\"
>
\n
"
+
" <div class=
\"
form-group input-group
\"
>
\n
"
+
" <input type=
\"
text
\"\n
"
+
" placeholder=
\"
{{form.title}} filtrele
\"\n
"
+
" class=
\"
form-control {{form.fieldHtmlClass}}
\"\n
"
+
" name=
\"
filter-interface
\"\n
"
+
" ng-model=
\"
form.filterValue
\"\n
"
+
" ng-keyup=
\"
form.appendFiltered(form.filterValue)
\"\n
"
+
" />
\n
"
+
" </div>
\n
"
+
" </div>
\n
"
+
" <div class=
\"
row
\"
>
\n
"
+
" <div class=
\"
col-md-5
\"
>
\n
"
+
" <label for=
\"
filterItems
\"
>{{form.title}} Liste</label>
\n
"
+
" <select ng-model=
\"
selectedItemsModel
\"\n
"
+
" value=
\"
$$value$$
\"\n
"
+
" ng-model-options=
\"
form.ngModelOptions
\"\n
"
+
" ng-disabled=
\"
form.readonly
\"\n
"
+
" sf-changed=
\"
form
\"\n
"
+
" class=
\"
form-control {{form.fieldHtmlClass}}
\"\n
"
+
" schema-validate=
\"
form
\"\n
"
+
" ng-options=
\"
item as item.name for item in form.filteredItems
\"\n
"
+
" name=
\"
filterItems
\"
multiple>
\n
"
+
" </select>
\n
"
+
" </div>
\n
"
+
"
\n
"
+
"
\n
"
+
" <div class=
\"
col-md-1
\"
>
\n
"
+
" <a href=
\"
javascript:void(0)
\"
ng-click=
\"
form.select(selectedItemsModel)
\"
><i class=
\"
fa fa-arrow-right fa-fw
\"
></i></a><br>
\n
"
+
" <a href=
\"
javascript:void(0)
\"
ng-click=
\"
form.deselect(selectedFilteredItemsModel)
\"
><i class=
\"
fa fa-arrow-left fa-fw
\"
></i></a>
\n
"
+
" </div>
\n
"
+
"
\n
"
+
" <div class=
\"
col-md-5
\"
>
\n
"
+
" <label for=
\"
selectedItems
\"
>Seçilenler</label>
\n
"
+
" <select ng-model=
\"
selectedFilteredItemsModel
\"\n
"
+
" value=
\"
$$value$$
\"\n
"
+
" ng-model-options=
\"
form.ngModelOptions
\"\n
"
+
" ng-disabled=
\"
form.readonly
\"\n
"
+
" sf-changed=
\"
form
\"\n
"
+
" class=
\"
form-control {{form.fieldHtmlClass}}
\"\n
"
+
" schema-validate=
\"
form
\"\n
"
+
" ng-options=
\"
item as item.name for item in form.selectedFilteredItems
\"\n
"
+
" name=
\"
selectedItems
\"
multiple>
\n
"
+
" </select>
\n
"
+
" </div>
\n
"
+
" </div>
\n
"
+
"
\n
"
+
" <div class=
\"
help-block
\"
sf-message=
\"
form.description
\"
></div>
\n
"
+
" </div>
\n
"
+
" <div class=
\"
col-md-4
\"
>
\n
"
+
" <a href=
\"
javascript:void(0);
\"
add-modal-for-linked-model>
\n
"
+
" <i class=
\"
fa fa-plus-circle fa-fw
\"
></i>
\n
"
+
" </a>
\n
"
+
" </div>
\n
"
+
"</div>"
);
}]);
...
...
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