Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
eced9a46
Commit
eced9a46
authored
Nov 13, 2020
by
Ryan Herbert
Browse files
my account: pass group_ids by json from group list
parent
b9e1a5bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
browser/js/database.js
View file @
eced9a46
...
...
@@ -291,6 +291,34 @@ Database.prototype = {
});
},
callUrlJson
:
function
(
url
,
args
)
{
var
self
=
this
;
$
.
ajax
({
type
:
"
POST
"
,
crossDomain
:
true
,
url
:
url
,
data
:
{
'
data
'
:
JSON
.
stringify
(
args
)},
timeout
:
DB_TIMEOUT_CALL
,
xhrFields
:
{
withCredentials
:
true
},
success
:
function
(
result
)
{
self
.
display_result
(
result
,
url
,
args
)
self
.
connected
=
true
;
},
error
:
function
(
request
,
status
,
error
)
{
self
.
connected
=
false
;
if
(
status
===
"
timeout
"
)
{
console
.
log
({
"
type
"
:
"
flash
"
,
"
default
"
:
"
database_timeout
"
,
"
priority
"
:
2
});
}
else
{
self
.
check_cert
()
}
self
.
warn
(
"
callUrlJson:
"
+
status
+
"
-
"
+
url
.
replace
(
self
.
db_address
,
''
)
+
"
?
"
+
self
.
argsToStr
(
args
))
}
});
},
callLinkable
:
function
(
linkable
)
{
var
href
=
linkable
.
attr
(
'
href
'
);
var
type
=
linkable
.
data
(
'
linkable-type
'
);
...
...
@@ -1231,17 +1259,17 @@ Database.prototype = {
callGroupStats
:
function
()
{
var
group_ids
=
[];
$
(
'
[name^="group_ids"]:checked
'
).
each
(
function
()
{
group_ids
.
push
(
"
group_ids=
"
+
$
(
this
).
val
());
group_ids
.
push
(
$
(
this
).
val
());
});
this
.
call
(
'
my_account/index
?
'
+
group_ids
.
join
(
"
&
"
)
);
this
.
call
UrlJson
(
DB_ADDRESS
+
'
my_account/index
'
,
{
'
group_ids
'
:
group_ids
}
);
},
callJobStats
:
function
()
{
var
group_ids
=
[];
$
(
'
[name^="group_ids"]:checked
'
).
each
(
function
()
{
group_ids
.
push
(
"
group_ids=
"
+
$
(
this
).
val
());
group_ids
.
push
(
$
(
this
).
val
());
});
this
.
call
(
'
my_account/jobs?
'
+
group_ids
.
join
(
"
&
"
)
);
this
.
call
UrlJson
(
DB_ADDRESS
+
'
my_account/index
'
,
{
'
group_ids
'
:
group_ids
}
);
},
stopGroupPropagate
:
function
(
e
)
{
...
...
server/web2py/applications/vidjil/controllers/my_account.py
View file @
eced9a46
...
...
@@ -100,14 +100,13 @@ def get_most_used_tags(group_list):
)
def
index
():
import
json
start
=
time
.
time
()
since
=
datetime
.
today
()
-
timedelta
(
days
=
30
)
if
auth
.
is_admin
()
and
'group_ids'
in
request
.
vars
and
request
.
vars
[
'group_ids'
]
is
not
None
:
group_list
=
request
.
vars
[
'group_ids'
]
if
isinstance
(
group_list
,
types
.
StringTypes
):
group_list
=
[
group_list
]
if
auth
.
is_admin
()
and
'data'
in
request
.
vars
:
group_list
=
json
.
loads
(
request
.
vars
[
'data'
])[
'group_ids'
]
else
:
group_list
=
[
int
(
g
.
id
)
for
g
in
auth
.
get_user_groups
()
+
auth
.
get_user_group_parents
()]
...
...
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