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
98a05366
Commit
98a05366
authored
Nov 24, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Feature/issue18'
parents
b5a1fd90
2112496b
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
22 deletions
+43
-22
Gruntfile.js
Gruntfile.js
+1
-1
crud_controller.js
app/components/crud/crud_controller.js
+18
-17
list.html
app/components/crud/templates/list.html
+20
-1
form_service.js
app/zetalib/form_service.js
+2
-2
app.js
dist/app.js
+2
-1
No files found.
Gruntfile.js
View file @
98a05366
...
...
@@ -330,7 +330,7 @@ module.exports = function (grunt) {
grunt
.
loadNpmTasks
(
'grunt-preprocess'
);
grunt
.
loadNpmTasks
(
'grunt-env'
);
grunt
.
registerTask
(
'dev'
,
[
'env:dev'
,
'preprocess:dev'
,
'html2js:dev'
,
'default'
,
'watch:dev'
]);
grunt
.
registerTask
(
'dev'
,
[
'env:dev'
,
'preprocess:dev'
,
'html2js:dev'
,
'default'
]);
grunt
.
registerTask
(
'test'
,
[
'bower'
,
'karma:continuous'
]);
grunt
.
registerTask
(
'i18n'
,
[
'nggettext_extract'
,
'nggettext_compile'
]);
grunt
.
registerTask
(
'local_prod'
,
[
'bower'
,
'env:prod'
,
'preprocess:prod'
,
'nggettext_compile'
,
'concat:js'
,
'concat:css'
,
'concat:components'
,
'copy:local_prod'
,
'html2js:prod'
,
'uglify:dist'
,
'connect:prod_server'
,
'watch:local_prod'
]);
...
...
app/components/crud/crud_controller.js
View file @
98a05366
...
...
@@ -66,12 +66,12 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
});
angular
.
forEach
(
scope
.
objects
,
function
(
value
,
key
)
{
if
(
value
!==
'-1'
)
{
var
linkIndexes
=
[]
;
var
linkIndexes
=
{}
;
angular
.
forEach
(
value
.
actions
,
function
(
v
,
k
)
{
if
(
v
.
show_as
===
'link'
)
{
linkIndexes
=
v
.
fields
}
if
(
v
.
show_as
===
'link'
)
{
linkIndexes
=
v
}
});
angular
.
forEach
(
value
.
fields
,
function
(
v
,
k
)
{
scope
.
objects
[
key
].
fields
[
k
]
=
{
type
:
linkIndexes
.
indexOf
(
k
)
>
-
1
?
'link'
:
'str'
,
content
:
v
};
scope
.
objects
[
key
].
fields
[
k
]
=
{
type
:
linkIndexes
.
fields
.
indexOf
(
k
)
>
-
1
?
'link'
:
'str'
,
content
:
v
,
cmd
:
linkIndexes
.
cmd
};
});
}
});
...
...
@@ -178,22 +178,23 @@ angular.module('ulakbus.crud', ['ui.bootstrap', 'schemaForm', 'formService'])
}
};
$scope
.
do_action
=
function
(
key
,
action
)
{
Generator
.
doItemAction
(
$scope
,
key
,
action
);
$scope
.
do_action
=
function
(
key
,
cmd
)
{
Generator
.
doItemAction
(
$scope
,
key
,
cmd
);
};
//$scope.searchForm = ['searchbox', {type: "submit", title: "Ara"}];
//$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(form.$valid) {
// Generator.submit({url: 'search', model: $scope.searchModel, form_params: {}});
// }
//}
$scope
.
pagination
=
{
page
:
1
,
total_pages
:
8
};
$scope
.
getNumber
=
function
(
num
)
{
return
new
Array
(
num
);
};
// reloadData must be a json object
$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
);
};
}
if
(
$routeParams
.
cmd
===
'reload'
)
{
...
...
app/components/crud/templates/list.html
View file @
98a05366
...
...
@@ -34,7 +34,7 @@
<td
ng-repeat=
"field in object.fields track by $index"
>
<a
ng-href=
"javascript:void(0)"
ng-if=
"field.type==='link'"
ng-click=
"do_action(object.key,
action
)"
>
{{field.content}}
</a>
ng-click=
"do_action(object.key,
field.cmd
)"
>
{{field.content}}
</a>
<span
ng-if=
"field.type==='str'"
>
{{field.content}}
</span>
</td>
...
...
@@ -66,6 +66,25 @@
</ul>
</div>
<nav
ng-if=
"pagination"
class=
"text-center"
>
<ul
class=
"pagination"
>
<li
ng-class=
"{disabled:pagination.page===1}"
>
<a
href=
"javascript:void(0)"
aria-label=
"Önceki"
ng-click=
"reload({page:pagination.page-1})"
>
<span
aria-hidden=
"true"
>
«
</span>
</a>
</li>
<li
ng-repeat=
"page in getNumber(pagination.total_pages) track by $index"
ng-class=
"{active:$index+1===pagination.page}"
>
<a
href=
"javascript:void(0)"
ng-click=
"reload({page:$index+1})"
>
{{$index+1}}
</a>
</li>
<li
ng-class=
"{disabled:pagination.page===pagination.total_pages}"
>
<a
href=
"javascript:void(0)"
aria-label=
"Sonraki"
ng-click=
"reload({page:pagination.page+1})"
>
<span
aria-hidden=
"true"
>
»
</span>
</a>
</li>
</ul>
</nav>
<hr>
</div>
\ No newline at end of file
app/zetalib/form_service.js
View file @
98a05366
...
...
@@ -294,8 +294,8 @@ angular.module('formService', [])
return
newdatearray
.
join
(
'.'
);
}
};
generator
.
doItemAction
=
function
(
$scope
,
key
,
action
)
{
$scope
.
form_params
.
cmd
=
action
.
cmd
;
generator
.
doItemAction
=
function
(
$scope
,
key
,
cmd
)
{
$scope
.
form_params
.
cmd
=
cmd
;
$scope
.
form_params
.
object_id
=
key
;
$scope
.
form_params
.
param
=
$scope
.
param
;
$scope
.
form_params
.
id
=
$scope
.
param_id
;
...
...
dist/app.js
View file @
98a05366
This diff is collapsed.
Click to expand it.
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