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
5bbee45f
Commit
5bbee45f
authored
Mar 22, 2016
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
selective listing implementation
parent
0377c148
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
3 deletions
+36
-3
crud_controller.js
app/components/crud/crud_controller.js
+13
-0
list.html
app/components/crud/templates/list.html
+11
-1
app.js
dist/app.js
+1
-1
templates.js
dist/templates.js
+11
-1
No files found.
app/components/crud/crud_controller.js
View file @
5bbee45f
...
@@ -245,6 +245,13 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
...
@@ -245,6 +245,13 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
}
}
$scope
.
createListObjects
();
$scope
.
createListObjects
();
};
};
// selective listing for list page todo: add to documentation
$scope
.
selective_list_key
=
0
;
$scope
.
update_selective_list
=
function
()
{
$scope
.
objects
=
$scope
.
all_objects
[
$scope
.
selective_list_key
][
"objects"
];
};
// end of selective listing
$scope
.
listFormCmd
=
function
()
{
$scope
.
listFormCmd
=
function
()
{
// function to set scope objects
// function to set scope objects
var
setpageobjects
=
function
(
data
)
{
var
setpageobjects
=
function
(
data
)
{
...
@@ -274,6 +281,12 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
...
@@ -274,6 +281,12 @@ angular.module('ulakbus.crud', ['schemaForm', 'ui.bootstrap', 'ulakbus.formServi
if
(
$scope
.
object
)
{
if
(
$scope
.
object
)
{
$scope
.
createListObjects
();
$scope
.
createListObjects
();
}
}
// if selective listing then change objects key to its first item
if
(
$scope
.
meta
.
selective_listing
)
{
$scope
.
all_objects
=
angular
.
copy
(
$scope
.
objects
);
$scope
.
objects
=
$scope
.
all_objects
[
0
][
"objects"
];
}
};
};
$scope
.
reloadCmd
=
function
()
{
$scope
.
reloadCmd
=
function
()
{
var
pageData
=
Generator
.
getPageData
();
var
pageData
=
Generator
.
getPageData
();
...
...
app/components/crud/templates/list.html
View file @
5bbee45f
...
@@ -3,11 +3,21 @@
...
@@ -3,11 +3,21 @@
<search-directive
ng-if=
"meta['allow_search']===true"
></search-directive>
<search-directive
ng-if=
"meta['allow_search']===true"
></search-directive>
<div
class=
"clearfix"
></div>
<div
class=
"clearfix"
></div>
<!--<h1>{{form_params.model || form_params.wf}}</h1>-->
<!--<h1>{{form_params.model || form_params.wf}}</h1>-->
<div
class=
"row"
ng-if=
"
!objects[1]
"
>
<div
class=
"row"
ng-if=
"
(!meta.selective_listing && !objects[1])
"
>
<div
class=
"col-md-12"
>
<div
class=
"col-md-12"
>
<p
class=
"no-content"
>
Listelenecek içerik yok.
</p>
<p
class=
"no-content"
>
Listelenecek içerik yok.
</p>
</div>
</div>
</div>
</div>
<!-- todo: add `selective_list` to documentation -->
<div
ng-if=
"meta.selective_listing === true"
>
<label
for=
"selective_list"
>
{{meta.selective_listing_label || "Sayfa içinde filtrelemek için seçim yapınız."}}
</label>
<select
name=
"selective_list"
id=
"selective_list"
ng-change=
"update_selective_list()"
ng-model=
"selective_list_key"
class=
"form-control"
>
<option
ng-repeat=
"item in all_objects"
value=
"{{$index}}"
>
{{item.key}}
</option>
</select>
</div>
<div
class=
"tablescroll"
ng-if=
"objects[1]"
>
<div
class=
"tablescroll"
ng-if=
"objects[1]"
>
<table
class=
"table table-bordered"
style=
"background-color:#fff;"
>
<table
class=
"table table-bordered"
style=
"background-color:#fff;"
>
<thead>
<thead>
...
...
dist/app.js
View file @
5bbee45f
This diff is collapsed.
Click to expand it.
dist/templates.js
View file @
5bbee45f
...
@@ -245,11 +245,21 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache",
...
@@ -245,11 +245,21 @@ angular.module("components/crud/templates/list.html", []).run(["$templateCache",
" <search-directive ng-if=
\"
meta['allow_search']===true
\"
></search-directive>
\n
"
+
" <search-directive ng-if=
\"
meta['allow_search']===true
\"
></search-directive>
\n
"
+
" <div class=
\"
clearfix
\"
></div>
\n
"
+
" <div class=
\"
clearfix
\"
></div>
\n
"
+
" <!--<h1>{{form_params.model || form_params.wf}}</h1>-->
\n
"
+
" <!--<h1>{{form_params.model || form_params.wf}}</h1>-->
\n
"
+
" <div class=
\"
row
\"
ng-if=
\"
!objects[1]
\"
>
\n
"
+
" <div class=
\"
row
\"
ng-if=
\"
(!meta.selective_listing && !objects[1])
\"
>
\n
"
+
" <div class=
\"
col-md-12
\"
>
\n
"
+
" <div class=
\"
col-md-12
\"
>
\n
"
+
" <p class=
\"
no-content
\"
>Listelenecek içerik yok.</p>
\n
"
+
" <p class=
\"
no-content
\"
>Listelenecek içerik yok.</p>
\n
"
+
" </div>
\n
"
+
" </div>
\n
"
+
" </div>
\n
"
+
" </div>
\n
"
+
" <!-- todo: add `selective_list` to documentation -->
\n
"
+
" <div ng-if=
\"
meta.selective_listing === true
\"
>
\n
"
+
" <label for=
\"
selective_list
\"
>{{meta.selective_listing_label ||
\"
Sayfa içinde filtrelemek için seçim yapınız.
\"
}}</label>
\n
"
+
" <select name=
\"
selective_list
\"
id=
\"
selective_list
\"\n
"
+
" ng-change=
\"
update_selective_list()
\"\n
"
+
" ng-model=
\"
selective_list_key
\"\n
"
+
" class=
\"
form-control
\"
>
\n
"
+
" <option ng-repeat=
\"
item in all_objects
\"
value=
\"
{{$index}}
\"
>{{item.key}}</option>
\n
"
+
" </select>
\n
"
+
" </div>
\n
"
+
" <div class=
\"
tablescroll
\"
ng-if=
\"
objects[1]
\"
>
\n
"
+
" <div class=
\"
tablescroll
\"
ng-if=
\"
objects[1]
\"
>
\n
"
+
" <table class=
\"
table table-bordered
\"
style=
\"
background-color:#fff;
\"
>
\n
"
+
" <table class=
\"
table table-bordered
\"
style=
\"
background-color:#fff;
\"
>
\n
"
+
" <thead>
\n
"
+
" <thead>
\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