Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
01de801b
Commit
01de801b
authored
Mar 13, 2015
by
Mathieu Giraud
Committed by
Vidjil Team
Mar 13, 2015
Browse files
controllers/user.py, views/user: access and groups in the user table
parent
73c1a24a
Changes
2
Hide whitespace changes
Inline
Side-by-side
server/web2py/applications/vidjil/controllers/user.py
View file @
01de801b
...
...
@@ -8,10 +8,19 @@ if request.env.http_origin:
def
index
():
query
=
db
(
db
.
auth_user
).
select
()
for
row
in
query
:
row
.
created
=
db
(
db
.
patient
.
creator
==
row
.
id
).
count
()
row
.
access
=
''
if
auth
.
has_permission
(
'create'
,
'patient'
,
0
,
row
.
id
):
row
.
access
+=
'c'
if
auth
.
has_permission
(
'upload'
,
'sequence_file'
,
0
,
row
.
id
):
row
.
access
+=
'u'
if
auth
.
has_permission
(
'run'
,
'results_file'
,
0
,
row
.
id
):
row
.
access
+=
'r'
q
=
[
g
.
group_id
for
g
in
db
(
db
.
auth_membership
.
user_id
==
row
.
id
).
select
()]
q
.
sort
()
row
.
groups
=
' '
.
join
([
str
(
g
)
for
g
in
q
])
row
.
size
=
0
row
.
files
=
0
query_size
=
db
(
db
.
sequence_file
.
provider
==
row
.
id
).
select
()
...
...
server/web2py/applications/vidjil/views/user/index.html
View file @
01de801b
...
...
@@ -7,11 +7,13 @@
<div
id=
"db_table_container"
>
<table
class=
"db_table"
id=
"table"
>
<thead>
<tr><td
class=
"column_
10
0"
>
id
</td>
<tr><td
class=
"column_
5
0"
>
id
</td>
<td
class=
"column_200"
>
name
</td>
<td>
@
</td>
<td
class=
"colum1"
>
patients created
</td>
<td
class=
"colum1"
>
files uploaded
</td>
<td
class=
"column_200"
>
@
</td>
<td
class=
"column_50"
>
access
</td>
<td
class=
"column_100"
>
groups
</td>
<td
class=
"column_50"
>
patients created
</td>
<td
class=
"column_100"
>
files uploaded
</td>
</tr>
</thead>
...
...
@@ -20,6 +22,8 @@
<td>
{{=row.id}}
</td>
<td>
{{=row.first_name}} {{=row.last_name}}
</td>
<td>
{{=row.email}}
</td>
<td>
{{=row.access}}
</td>
<td>
{{=row.groups}}
</td>
<td>
{{=row.created}}
</td>
<td>
{{=row.files}} ({{=vidjil_utils.format_size(row.size)}})
</td>
</tr>
...
...
Write
Preview
Supports
Markdown
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