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
Hide 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 @@
...
@@ -39,7 +39,7 @@
<thead><tr><th></th><th>
{% trans "Who" %}
</th><th></th><th></th></tr></thead>
<thead><tr><th></th><th>
{% trans "Who" %}
</th><th></th><th></th></tr></thead>
{% for i in users %}
{% for i in users %}
<tr><td><i
class=
"icon-user"
></i></td><td>
{{i.username}}
</td>
<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 %}
{% endfor %}
<tr><td><i
class=
"icon-plus"
></i></td>
<tr><td><i
class=
"icon-plus"
></i></td>
<td><input
type=
"text"
class=
"form-control"
name=
"perm-new-name"
<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
django.conf.urls
import
patterns
,
url
from
vm.models
import
Instance
from
.views
import
(
from
.views
import
(
AclUpdateView
,
DiskAddView
,
FavouriteView
,
GroupAclUpdateView
,
GroupDelete
,
AclUpdateView
,
DiskAddView
,
FavouriteView
,
GroupAclUpdateView
,
GroupDetailView
,
GroupList
,
GroupUserDelete
,
IndexView
,
LeaseCreate
,
GroupDelete
,
GroupDetailView
,
GroupList
,
GroupUserDelete
,
LeaseDelete
,
LeaseDetail
,
MyPreferencesView
,
NodeAddTraitView
,
NodeCreate
,
IndexView
,
LeaseCreate
,
LeaseDelete
,
LeaseDetail
,
MyPreferencesView
,
NodeDelete
,
NodeDetailView
,
NodeFlushView
,
NodeGraphView
,
NodeList
,
NodeAddTraitView
,
NodeCreate
,
NodeDelete
,
NodeDetailView
,
NodeFlushView
,
NodeStatus
,
NotificationView
,
PortDelete
,
TemplateAclUpdateView
,
NodeGraphView
,
NodeList
,
NodeStatus
,
NotificationView
,
PortDelete
,
TemplateCreate
,
TemplateDelete
,
TemplateDetail
,
TemplateList
,
TemplateAclUpdateView
,
TemplateCreate
,
TemplateDelete
,
TemplateDetail
,
TransferOwnershipConfirmView
,
TransferOwnershipView
,
vm_activity
,
VmCreate
,
TemplateList
,
TransferOwnershipConfirmView
,
TransferOwnershipView
,
VmDelete
,
VmDetailView
,
VmDetailVncTokenView
,
VmGraphView
,
VmList
,
vm_activity
,
VmCreate
,
VmDelete
,
VmDetailView
,
VmDetailVncTokenView
,
VmMassDelete
,
VmMigrateView
,
VmRenewView
,
VmGraphView
,
VmList
,
VmMassDelete
,
VmMigrateView
,
VmRenewView
,
GroupAclRemoveView
,
GroupMemberRemoveView
)
)
from
vm.models
import
Instance
urlpatterns
=
patterns
(
urlpatterns
=
patterns
(
''
,
''
,
...
@@ -93,7 +95,6 @@ urlpatterns = patterns(
...
@@ -93,7 +95,6 @@ urlpatterns = patterns(
name
=
'dashboard.views.group-acl'
),
name
=
'dashboard.views.group-acl'
),
url
(
r'^groupuser/delete/(?P<pk>\d+)/$'
,
GroupUserDelete
.
as_view
(),
url
(
r'^groupuser/delete/(?P<pk>\d+)/$'
,
GroupUserDelete
.
as_view
(),
name
=
"dashboard.views.delete-groupuser"
),
name
=
"dashboard.views.delete-groupuser"
),
url
(
r'^notifications/$'
,
NotificationView
.
as_view
(),
url
(
r'^notifications/$'
,
NotificationView
.
as_view
(),
name
=
"dashboard.views.notifications"
),
name
=
"dashboard.views.notifications"
),
...
@@ -101,4 +102,10 @@ urlpatterns = patterns(
...
@@ -101,4 +102,10 @@ urlpatterns = patterns(
name
=
"dashboard.views.disk-add"
),
name
=
"dashboard.views.disk-add"
),
url
(
r'^profile/$'
,
MyPreferencesView
.
as_view
(),
url
(
r'^profile/$'
,
MyPreferencesView
.
as_view
(),
name
=
"dashboard.views.profile"
),
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):
...
@@ -986,7 +986,7 @@ class GroupUserDelete(LoginRequiredMixin, SuperuserRequiredMixin, DeleteView):
return
reverse_lazy
(
'dashboard.index'
)
return
reverse_lazy
(
'dashboard.index'
)
class
Group
Us
erRemoveView
(
LoginRequiredMixin
,
DeleteView
):
class
Group
Memb
erRemoveView
(
LoginRequiredMixin
,
DeleteView
):
model
=
Group
model
=
Group
slug_field
=
'pk'
slug_field
=
'pk'
slug_url_kwarg
=
'group_pk'
slug_url_kwarg
=
'group_pk'
...
@@ -1026,7 +1026,7 @@ class GroupUserRemoveView(LoginRequiredMixin, DeleteView):
...
@@ -1026,7 +1026,7 @@ class GroupUserRemoveView(LoginRequiredMixin, DeleteView):
return
HttpResponseRedirect
(
success_url
)
return
HttpResponseRedirect
(
success_url
)
class
GroupAclRemoveView
(
Group
Us
erRemoveView
):
class
GroupAclRemoveView
(
Group
Memb
erRemoveView
):
def
remove_user
(
self
,
userpk
):
def
remove_user
(
self
,
userpk
):
container
=
self
.
get_object
()
.
profile
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