Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
32f4e1c2
authored
Feb 20, 2014
by
Oláh István Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: remove group user in view and template
parent
bee83c92
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
14 deletions
+21
-14
circle/dashboard/templates/dashboard/group-detail.html
+1
-1
circle/dashboard/urls.py
+18
-11
circle/dashboard/views.py
+2
-2
No files found.
circle/dashboard/templates/dashboard/group-detail.html
View file @
32f4e1c2
...
...
@@ -39,7 +39,7 @@
<thead><tr><th></th><th>
{% trans "Who" %}
</th><th></th><th></th></tr></thead>
{% for i in users %}
<tr><td><i
class=
"icon-user"
></i></td><td>
{{i.username}}
</td>
<td><a
data-group
-pk=
"{{ i.pk }}"
href=
"#"
class=
"real-link groupus
er-delete btn btn-link btn-xs"
><i
class=
"icon-remove"
><span
class=
"sr-only"
>
{% trans "remove" %}
</span></i></a></td></tr>
<td><a
data-group
member-pk=
"{{i.pk}}"
href=
"{% url "
dashboard
.
views
.
remove-groupmember
"
user_pk=
i.pk
group_pk=
group.pk
%}?
next=
{{
request
.
path
}}"
class=
"real-link groupmemb
er-delete btn btn-link btn-xs"
><i
class=
"icon-remove"
><span
class=
"sr-only"
>
{% trans "remove" %}
</span></i></a></td></tr>
{% endfor %}
<tr><td><i
class=
"icon-plus"
></i></td>
<td><input
type=
"text"
class=
"form-control"
name=
"perm-new-name"
...
...
circle/dashboard/urls.py
View file @
32f4e1c2
from
django.conf.urls
import
patterns
,
url
from
vm.models
import
Instance
from
.views
import
(
AclUpdateView
,
DiskAddView
,
FavouriteView
,
GroupAclUpdateView
,
GroupDelete
,
GroupDetailView
,
GroupList
,
GroupUserDelete
,
IndexView
,
LeaseCreate
,
LeaseDelete
,
LeaseDetail
,
MyPreferencesView
,
NodeAddTraitView
,
NodeCreate
,
NodeDelete
,
NodeDetailView
,
NodeFlushView
,
NodeGraphView
,
NodeList
,
NodeStatus
,
NotificationView
,
PortDelete
,
TemplateAclUpdateView
,
TemplateCreate
,
TemplateDelete
,
TemplateDetail
,
TemplateList
,
TransferOwnershipConfirmView
,
TransferOwnershipView
,
vm_activity
,
VmCreate
,
VmDelete
,
VmDetailView
,
VmDetailVncTokenView
,
VmGraphView
,
VmList
,
VmMassDelete
,
VmMigrateView
,
VmRenewView
,
AclUpdateView
,
DiskAddView
,
FavouriteView
,
GroupAclUpdateView
,
GroupDelete
,
GroupDetailView
,
GroupList
,
GroupUserDelete
,
IndexView
,
LeaseCreate
,
LeaseDelete
,
LeaseDetail
,
MyPreferencesView
,
NodeAddTraitView
,
NodeCreate
,
NodeDelete
,
NodeDetailView
,
NodeFlushView
,
NodeGraphView
,
NodeList
,
NodeStatus
,
NotificationView
,
PortDelete
,
TemplateAclUpdateView
,
TemplateCreate
,
TemplateDelete
,
TemplateDetail
,
TemplateList
,
TransferOwnershipConfirmView
,
TransferOwnershipView
,
vm_activity
,
VmCreate
,
VmDelete
,
VmDetailView
,
VmDetailVncTokenView
,
VmGraphView
,
VmList
,
VmMassDelete
,
VmMigrateView
,
VmRenewView
,
GroupAclRemoveView
,
GroupMemberRemoveView
)
from
vm.models
import
Instance
urlpatterns
=
patterns
(
''
,
...
...
@@ -93,7 +95,6 @@ urlpatterns = patterns(
name
=
'dashboard.views.group-acl'
),
url
(
r'^groupuser/delete/(?P<pk>\d+)/$'
,
GroupUserDelete
.
as_view
(),
name
=
"dashboard.views.delete-groupuser"
),
url
(
r'^notifications/$'
,
NotificationView
.
as_view
(),
name
=
"dashboard.views.notifications"
),
...
...
@@ -101,4 +102,10 @@ urlpatterns = patterns(
name
=
"dashboard.views.disk-add"
),
url
(
r'^profile/$'
,
MyPreferencesView
.
as_view
(),
name
=
"dashboard.views.profile"
),
url
(
r'^group/(?P<group_pk>\d+)/remove/acl/(?P<user_pk>\d+)/$'
,
GroupAclRemoveView
.
as_view
(),
name
=
"dashboard.views.remove-groupaclmember"
),
url
(
r'^group/(?P<group_pk>\d+)/remove/member/(?P<user_pk>\d+)/$'
,
GroupMemberRemoveView
.
as_view
(),
name
=
"dashboard.views.remove-groupmember"
),
)
circle/dashboard/views.py
View file @
32f4e1c2
...
...
@@ -986,7 +986,7 @@ class GroupUserDelete(LoginRequiredMixin, SuperuserRequiredMixin, DeleteView):
return
reverse_lazy
(
'dashboard.index'
)
class
Group
Us
erRemoveView
(
LoginRequiredMixin
,
DeleteView
):
class
Group
Memb
erRemoveView
(
LoginRequiredMixin
,
DeleteView
):
model
=
Group
slug_field
=
'pk'
slug_url_kwarg
=
'group_pk'
...
...
@@ -1026,7 +1026,7 @@ class GroupUserRemoveView(LoginRequiredMixin, DeleteView):
return
HttpResponseRedirect
(
success_url
)
class
GroupAclRemoveView
(
Group
Us
erRemoveView
):
class
GroupAclRemoveView
(
Group
Memb
erRemoveView
):
def
remove_user
(
self
,
userpk
):
container
=
self
.
get_object
()
.
profile
...
...
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