Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
vidjil
vidjil
Commits
37efef02
Commit
37efef02
authored
Nov 23, 2016
by
HERBERT Ryan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sample_set * add basic pagination
parent
50bf2dbd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
3 deletions
+28
-3
server/web2py/applications/vidjil/controllers/sample_set.py
server/web2py/applications/vidjil/controllers/sample_set.py
+11
-2
server/web2py/applications/vidjil/models/sample_set_list.py
server/web2py/applications/vidjil/models/sample_set_list.py
+7
-1
server/web2py/applications/vidjil/views/sample_set/all.html
server/web2py/applications/vidjil/views/sample_set/all.html
+10
-0
No files found.
server/web2py/applications/vidjil/controllers/sample_set.py
View file @
37efef02
...
@@ -158,7 +158,14 @@ def all():
...
@@ -158,7 +158,14 @@ def all():
else
:
else
:
type
=
'generic'
type
=
'generic'
list
=
SampleSetList
(
type
)
step
=
None
page
=
None
is_not_filtered
=
"sort"
not
in
request
.
vars
and
"filter"
not
in
request
.
vars
if
request
.
vars
[
'page'
]
is
not
None
and
is_not_filtered
:
page
=
int
(
request
.
vars
[
'page'
])
step
=
50
list
=
SampleSetList
(
type
,
page
,
step
)
list
.
load_creator_names
()
list
.
load_creator_names
()
list
.
load_sample_information
()
list
.
load_sample_information
()
list
.
load_config_information
()
list
.
load_config_information
()
...
@@ -192,7 +199,9 @@ def all():
...
@@ -192,7 +199,9 @@ def all():
fields
=
fields
,
fields
=
fields
,
type
=
type
,
type
=
type
,
isAdmin
=
isAdmin
,
isAdmin
=
isAdmin
,
reverse
=
False
)
reverse
=
False
,
step
=
step
,
page
=
page
)
## return form to create new generic sample_set
## return form to create new generic sample_set
...
...
server/web2py/applications/vidjil/models/sample_set_list.py
View file @
37efef02
class
SampleSetList
():
class
SampleSetList
():
def
__init__
(
self
,
type
):
def
__init__
(
self
,
type
,
page
=
None
,
step
=
None
):
self
.
type
=
type
self
.
type
=
type
limitby
=
None
if
page
is
not
None
and
step
is
not
None
:
limitby
=
(
page
*
step
,
(
page
+
1
)
*
step
+
1
)
# one more element to indicate if another page exists
query_gss
=
db
(
query_gss
=
db
(
(
auth
.
vidjil_accessible_query
(
PermissionEnum
.
read
.
value
,
db
[
type
]))
(
auth
.
vidjil_accessible_query
(
PermissionEnum
.
read
.
value
,
db
[
type
]))
).
select
(
).
select
(
db
[
type
].
ALL
,
db
[
type
].
ALL
,
limitby
=
limitby
,
orderby
=
~
db
[
type
].
id
orderby
=
~
db
[
type
].
id
)
)
...
...
server/web2py/applications/vidjil/views/sample_set/all.html
View file @
37efef02
...
@@ -10,6 +10,16 @@
...
@@ -10,6 +10,16 @@
search
search
<input
id=
"db_filter_input"
type=
"text"
value=
"{{=request.vars["
filter
"]}}"
onchange=
"db.call('sample_set/all', {'type': '{{=type}}', 'filter' : this.value} )"
>
<input
id=
"db_filter_input"
type=
"text"
value=
"{{=request.vars["
filter
"]}}"
onchange=
"db.call('sample_set/all', {'type': '{{=type}}', 'filter' : this.value} )"
>
</div>
</div>
<div
class=
"db_block_right"
>
page:
{{ if page > 0: }}
<div
class=
"button"
onclick=
"db.call('sample_set/all', {'type': '{{=type}}', 'page': {{=page-1}}})"
><
</
div
>
{{ pass }}
{{= page + 1 }}
{{if len(query) > step : }}
<div
class=
"button"
onclick=
"db.call('sample_set/all', {'type': '{{=type}}', 'page': {{=page+1}}})"
>
>
</div>
{{ pass }}
</div>
</div>
</div>
<div
id=
"db_table_container"
>
<div
id=
"db_table_container"
>
...
...
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