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
itminedu
synnefo
Commits
aaf6059c
Commit
aaf6059c
authored
Dec 04, 2012
by
Olga Brani
Browse files
- Flag is_active_member to group_details
parent
e1d529f0
Changes
1
Show whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/views.py
View file @
aaf6059c
...
...
@@ -981,6 +981,11 @@ def group_detail(request, group_id):
WHERE astakosgroup_id = im_astakosgroup.group_ptr_id
AND astakosuser_id = %s)
THEN 1 ELSE 0 END"""
%
request
.
user
.
id
,
'is_active_member'
:
"""SELECT CASE WHEN(
SELECT date_joined FROM im_membership
WHERE group_id = im_astakosgroup.group_ptr_id
AND person_id = %s) IS NULL
THEN 0 ELSE 1 END"""
%
request
.
user
.
id
,
'kindname'
:
"""SELECT name FROM im_groupkind
WHERE id = im_astakosgroup.kind_id"""
})
...
...
@@ -1279,6 +1284,7 @@ def resource_usage(request):
entry
[
'load_class'
]
=
'red'
max_value
=
float
(
entry
[
'maxValue'
])
curr_value
=
float
(
entry
[
'currValue'
])
entry
[
'ratio_limited'
]
=
0
if
max_value
>
0
:
entry
[
'ratio'
]
=
(
curr_value
/
max_value
)
*
100
else
:
...
...
@@ -1287,6 +1293,13 @@ def resource_usage(request):
entry
[
'load_class'
]
=
'yellow'
if
entry
[
'ratio'
]
<
33
:
entry
[
'load_class'
]
=
'green'
if
entry
[
'ratio'
]
<
0
:
entry
[
'ratio'
]
=
0
if
entry
[
'ratio'
]
>
100
:
entry
[
'ratio_limited'
]
=
100
else
:
entry
[
'ratio_limited'
]
=
entry
[
'ratio'
]
return
entry
def
pluralize
(
entry
):
...
...
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