Commit 376e9602 by Kálmán Viktor

dashboard: add available objects list to group detail

parent cc9dee43
...@@ -52,6 +52,36 @@ ...@@ -52,6 +52,36 @@
<hr /> <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 %} <h3>{% trans "User list"|capfirst %}
{% if perms.auth.add_user %} {% if perms.auth.add_user %}
<a href="{% url "dashboard.views.create-user" group.pk %}" class="btn btn-success pull-right">{% trans "Create user" %}</a> <a href="{% url "dashboard.views.create-user" group.pk %}" class="btn btn-success pull-right">{% trans "Create user" %}</a>
......
...@@ -39,6 +39,7 @@ from ..forms import ( ...@@ -39,6 +39,7 @@ from ..forms import (
GroupCreateForm, GroupProfileUpdateForm, GroupCreateForm, GroupProfileUpdateForm,
) )
from ..models import FutureMember, GroupProfile from ..models import FutureMember, GroupProfile
from vm.models import Instance, InstanceTemplate
from ..tables import GroupListTable from ..tables import GroupListTable
from .util import CheckedDetailView, AclUpdateView, search_user, saml_available from .util import CheckedDetailView, AclUpdateView, search_user, saml_available
...@@ -100,6 +101,15 @@ class GroupDetailView(CheckedDetailView): ...@@ -100,6 +101,15 @@ class GroupDetailView(CheckedDetailView):
context['group_profile_form'] = GroupProfileUpdate.get_form_object( context['group_profile_form'] = GroupProfileUpdate.get_form_object(
self.request, self.object.profile) 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: if self.request.user.is_superuser:
context['group_perm_form'] = GroupPermissionForm( context['group_perm_form'] = GroupPermissionForm(
instance=self.object) instance=self.object)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment