Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ab55fbae
authored
Apr 29, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: make abort view more generic
parent
2e3d4c2d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html
+2
-2
circle/dashboard/views.py
+2
-2
No files found.
circle/dashboard/templates/dashboard/vm-detail/_activity-timeline.html
View file @
ab55fbae
...
...
@@ -12,9 +12,9 @@
{% if user.is_superuser and a.is_abortable %}
<form
action=
""
method=
"POST"
class=
"pull-right"
>
{% csrf_token %}
<input
type=
"hidden"
name=
"abort_
shutdow
n"
/>
<input
type=
"hidden"
name=
"abort_
operatio
n"
/>
<input
type=
"hidden"
name=
"activity"
value=
"{{ a.pk }}"
/>
<button
class=
"btn btn-danger btn-xs"
><i
class=
"icon-bolt"
></i>
{% trans "Abort
shutdown
" %}
</button>
<button
class=
"btn btn-danger btn-xs"
><i
class=
"icon-bolt"
></i>
{% trans "Abort" %}
</button>
</form>
{% endif %}
{% if a.children.count > 0 %}
...
...
circle/dashboard/views.py
View file @
ab55fbae
...
...
@@ -243,7 +243,7 @@ class VmDetailView(CheckedDetailView):
'to_remove'
:
self
.
__remove_tag
,
'port'
:
self
.
__add_port
,
'new_network_vlan'
:
self
.
__new_network
,
'abort_
shutdown'
:
self
.
__abort_shutdow
n
,
'abort_
operation'
:
self
.
__abort_operatio
n
,
}
for
k
,
v
in
options
.
iteritems
():
if
request
.
POST
.
get
(
k
)
is
not
None
:
...
...
@@ -429,7 +429,7 @@ class VmDetailView(CheckedDetailView):
return
redirect
(
"
%
s#network"
%
reverse_lazy
(
"dashboard.views.detail"
,
kwargs
=
{
'pk'
:
self
.
object
.
pk
}))
def
__abort_
shutdow
n
(
self
,
request
):
def
__abort_
operatio
n
(
self
,
request
):
self
.
object
=
self
.
get_object
()
if
not
request
.
user
.
is_superuser
:
raise
PermissionDenied
()
...
...
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