Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
376e9602
authored
Sep 26, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add available objects list to group detail
parent
cc9dee43
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
circle/dashboard/templates/dashboard/group-detail.html
+30
-0
circle/dashboard/views/group.py
+10
-0
No files found.
circle/dashboard/templates/dashboard/group-detail.html
View file @
376e9602
...
...
@@ -52,6 +52,36 @@
<hr
/>
<h3>
{% trans "Available objects for this group" %}
</h3>
<ul
class=
"dashboard-profile-vm-list fa-ul"
>
{% for i in vm_objects %}
<li>
<a
href=
"{{ i.get_absolute_url }}"
>
<i
class=
"fa fa-li {{ i.get_status_icon }}"
></i>
{{ i }}
</a>
</li>
{% endfor %}
{% for t in template_objects %}
<li>
<a
href=
"{{ t.get_absolute_url }}"
>
<i
class=
"fa fa-li fa-puzzle-piece"
></i>
{{ t }}
</a>
</li>
{% endfor %}
{% for g in group_objects %}
<li>
<a
href=
"{{ g.get_absolute_url }}"
>
<i
class=
"fa fa-li fa-users"
></i>
{{ g }}
</a>
</li>
{% endfor %}
</ul>
<hr
/>
<h3>
{% trans "User list"|capfirst %}
{% if perms.auth.add_user %}
<a
href=
"{% url "
dashboard
.
views
.
create-user
"
group
.
pk
%}"
class=
"btn btn-success pull-right"
>
{% trans "Create user" %}
</a>
...
...
circle/dashboard/views/group.py
View file @
376e9602
...
...
@@ -39,6 +39,7 @@ from ..forms import (
GroupCreateForm
,
GroupProfileUpdateForm
,
)
from
..models
import
FutureMember
,
GroupProfile
from
vm.models
import
Instance
,
InstanceTemplate
from
..tables
import
GroupListTable
from
.util
import
CheckedDetailView
,
AclUpdateView
,
search_user
,
saml_available
...
...
@@ -100,6 +101,15 @@ class GroupDetailView(CheckedDetailView):
context
[
'group_profile_form'
]
=
GroupProfileUpdate
.
get_form_object
(
self
.
request
,
self
.
object
.
profile
)
context
.
update
({
'group_objects'
:
GroupProfile
.
get_objects_with_group_level
(
"operator"
,
self
.
get_object
()),
'vm_objects'
:
Instance
.
get_objects_with_group_level
(
"user"
,
self
.
get_object
()),
'template_objects'
:
InstanceTemplate
.
get_objects_with_group_level
(
"user"
,
self
.
get_object
()),
})
if
self
.
request
.
user
.
is_superuser
:
context
[
'group_perm_form'
]
=
GroupPermissionForm
(
instance
=
self
.
object
)
...
...
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