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
5ab352e5
Commit
5ab352e5
authored
Dec 20, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolves #69
parent
f14492e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
129 additions
and
55 deletions
+129
-55
directives.js
app/shared/directives.js
+33
-3
filefield.html
app/shared/templates/filefield.html
+21
-0
nodeTable.html
app/shared/templates/nodeTable.html
+56
-48
form_service.js
app/zetalib/form_service.js
+19
-4
No files found.
app/shared/directives.js
View file @
5ab352e5
...
...
@@ -86,7 +86,12 @@ 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"
,
style
:
"btn-info"
,
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
:
{
...
...
@@ -138,7 +143,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
link
:
function
(
$scope
)
{
// titleMap will be list
$scope
.
titleMap
=
[{
value
:
"artan"
,
name
:
"Artan"
},
{
value
:
"azalan"
,
name
:
"Azalan"
}];
$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"
}];
...
...
@@ -283,7 +288,7 @@ app.directive('logout', function ($http, $location, RESTURL) {
$scope
.
$on
(
'selectedUserTrigger'
,
function
(
$event
,
data
)
{
var
postToApi
=
{
model
:
'Personel'
,
cmd
:
'show'
,
id
:
data
[
1
]};
//postToApi[data[0]]=data[1];
$http
.
get
(
RESTURL
.
url
+
'ara/personel/'
+
data
[
1
]).
success
(
$http
.
get
(
RESTURL
.
url
+
'ara/personel/'
+
data
[
1
]).
success
(
function
(
data
)
{
}
);
...
...
@@ -519,6 +524,31 @@ app.directive('logout', function ($http, $location, RESTURL) {
$scope
.
selectedMenu
=
'home'
;
}
};
})
.
directive
(
"fileread"
,
function
(
$timeout
)
{
return
{
scope
:
{
fileread
:
"="
},
link
:
function
(
scope
,
element
,
attributes
)
{
element
.
bind
(
"change"
,
function
(
changeEvent
)
{
var
reader
=
new
FileReader
();
reader
.
onload
=
function
(
loadEvent
)
{
scope
.
$apply
(
function
()
{
scope
.
fileread
=
loadEvent
.
target
.
result
;
});
$timeout
(
function
()
{
scope
.
$parent
.
model
[
changeEvent
.
target
.
name
]
=
{
file_name
:
changeEvent
.
target
.
files
[
0
].
name
,
file_content
:
scope
.
$parent
.
model
[
changeEvent
.
target
.
name
]
}
});
}
reader
.
readAsDataURL
(
changeEvent
.
target
.
files
[
0
]);
});
}
}
});
//app.directive('timeline', function () {
...
...
app/shared/templates/filefield.html
0 → 100644
View file @
5ab352e5
<div
class=
"form-group {{form.htmlClass}} schema-form-select col-md-12"
ng-class=
"{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess(), 'has-feedback': form.feedback !== false}"
>
<label
class=
"control-label {{form.labelHtmlClass}}"
ng-show=
"showTitle()"
>
{{form.title}}
</label>
<div
class=
"form-group input-group"
>
<input
type=
"file"
ng-model=
"$$value$$"
fileread=
"$$value$$"
placeholder=
"dosya/imaj seçiniz"
ng-model-options=
"form.ngModelOptions"
ng-disabled=
"form.readonly"
sf-changed=
"form"
class=
"form-control {{form.fieldHtmlClass}}"
schema-validate=
"form"
name=
"{{form.name}}"
/>
</div>
<div
class=
"help-block"
sf-message=
"form.description"
></div>
</div>
\ No newline at end of file
app/shared/templates/nodeTable.html
View file @
5ab352e5
<div
class=
"tablescroll"
>
<table
class=
"table table-bordered"
style=
"background-color:#fff;"
>
<thead>
<tr
ng-if=
"node.schema.formType=='Node'"
>
<!--<th colspan="2">-->
<table
class=
"table table-bordered"
style=
"background-color:#fff;"
>
<thead>
<tr
ng-if=
"node.schema.formType=='Node'"
>
<!--<th colspan="2">-->
<!--<label>-->
<!--<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">-->
<!--Hepsini Seç-->
<!--<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>
İşlem
</th>
</tr>
<tr
ng-if=
"node.schema.formType=='ListNode'"
>
<th
colspan=
"2"
>
<!--<label>-->
<!--</th>-->
<th
ng-repeat=
"(key,value) in node.model track by $index"
>
{{ key }}
</th>
<th>
İşlem
</th>
</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>-->
</th>
<th
ng-repeat=
"(key,value) in node.items[0] track by $index"
ng-if=
"key!=='idx'"
>
<span
ng-if=
"value.verbose_name"
>
{{ value.verbose_name }}
</span>
<span
ng-if=
"!value.verbose_name"
>
{{key}}
</span>
</th>
<th>
İşlem
</th>
</tr>
</thead>
<tbody
ng-class=
"{hidden: node.lengthModels < 1}"
>
<!--</label>-->
</th>
<th
ng-repeat=
"(key,value) in node.items[0] track by $index"
ng-if=
"key!=='idx'"
>
<span
ng-if=
"value.verbose_name"
>
{{ value.verbose_name }}
</span>
<span
ng-if=
"!value.verbose_name"
>
{{key}}
</span>
</th>
<th>
İşlem
</th>
</tr>
</thead>
<tbody
ng-class=
"{hidden: node.lengthModels < 1}"
>
<tr
ng-if=
"node.schema.formType=='Node'"
>
<!--<td width="60">-->
<tr
ng-if=
"node.schema.formType=='Node'"
>
<!--<td width="60">-->
<!--<label>-->
<!--<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">-->
<!--<input type="checkbox" style="zoom:1.5; margin:5px 0 0 8px;">-->
<!--</label>-->
<!--</td>-->
<!--<th scope="row" style="text-align:center">1</th>-->
<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
ng-click=
"remove(node, 'Node', $index)"
>
Sil
</button>
</td>
</tr>
<!--</td>-->
<!--<th scope="row" style="text-align:center">1</th>-->
<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
ng-click=
"remove(node, 'Node', $index)"
>
Sil
</button>
</td>
</tr>
<tr
ng-repeat=
"listnodemodel in node.items track by
$index"
ng-if=
"node.schema.formType=='ListNode'"
>
<td
width=
"60"
>
<!--<label>-->
<tr
ng-repeat=
"listnodemodel in node.items track by $index"
ng-init=
"outerIndex=
$index"
ng-if=
"node.schema.formType=='ListNode'"
>
<td
width=
"60"
>
<!--<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"
ng-if=
"k!=='idx'"
>
{{ v.unicode || v }}
</td>
<td>
<button
modal-for-nodes=
"{{node.schema.model_name}},{{node.schema.formType}},edit,{{$index}}"
>
Düzenle
</button><br>
<button
ng-click=
"remove(node, 'ListNode', $index)"
>
Sil
</button>
</td>
</tr>
<!--</label>-->
</td>
<th
scope=
"row"
style=
"text-align:center"
>
{{$index+1}}
</th>
<td
ng-repeat=
"(k, v) in listnodemodel track by $index"
ng-init=
"innerIndex=$index"
ng-if=
"k!=='idx'"
>
<span
ng-if=
"!node.schema.inline_edit || node.schema.inline_edit.indexOf(k) < 0"
>
{{ v.unicode || v }}
</span>
<input
type=
"node.schema.formType"
ng-if=
"node.schema.inline_edit.indexOf(k) > -1"
ng-model=
"node.model[outerIndex][k]"
ng-change=
"nodeModelChange(this)"
>
</td>
<td>
<button
modal-for-nodes=
"{{node.schema.model_name}},{{node.schema.formType}},edit,{{$index}}"
>
Düzenle
</button>
<br>
<button
ng-click=
"remove(node, 'ListNode', $index)"
>
Sil
</button>
</td>
</tr>
</tbody>
</table>
</tbody>
</table>
</div>
\ No newline at end of file
app/zetalib/form_service.js
View file @
5ab352e5
...
...
@@ -206,6 +206,18 @@ angular.module('formService', ['ui.bootstrap'])
}
}
if
(
v
.
type
===
'file'
)
{
scope
.
form
[
scope
.
form
.
indexOf
(
k
)]
=
{
type
:
"template"
,
title
:
v
.
title
,
templateUrl
:
"shared/templates/filefield.html"
,
name
:
k
,
key
:
k
,
titleMap
:
v
.
titleMap
};
v
.
type
=
'string'
;
}
if
(
v
.
type
===
'select'
)
{
scope
.
form
[
scope
.
form
.
indexOf
(
k
)]
=
{
type
:
"template"
,
...
...
@@ -217,7 +229,6 @@ angular.module('formService', ['ui.bootstrap'])
};
}
if
(
v
.
type
===
'submit'
||
v
.
type
===
'button'
)
{
var
buttonPositions
=
scope
.
modalElements
?
scope
.
modalElements
.
buttonPositions
:
{
bottom
:
'move-to-bottom'
,
...
...
@@ -528,7 +539,6 @@ 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
]
||
{};
...
...
@@ -542,10 +552,15 @@ angular.module('formService', ['ui.bootstrap'])
title
:
v
.
title
,
type
:
"object"
,
formType
:
v
.
type
,
model_name
:
k
model_name
:
k
,
inline_edit
:
scope
.
inline_edit
},
url
:
scope
.
url
,
wf
:
scope
.
wf
wf
:
scope
.
wf
,
nodeModelChange
:
function
(
item
)
{
debugger
;
}
});
if
(
v
.
type
===
'ListNode'
)
{
...
...
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