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
b722b632
authored
Mar 18, 2014
by
Oláh István Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix node flush templates, check is None to post flush
parent
39f2c65c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
circle/dashboard/templates/dashboard/confirm/ajax-node-flush.html
+8
-3
circle/dashboard/templates/dashboard/confirm/node-flush.html
+2
-3
circle/dashboard/views.py
+1
-2
No files found.
circle/dashboard/templates/dashboard/confirm/ajax-node-flush.html
View file @
b722b632
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<div
class=
"modal-dialog"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-content"
>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
{% if text %}
{% if text %}
{{ text }}
{{ text }}
{% else %}
{% else %}
...
@@ -10,12 +11,16 @@
...
@@ -10,12 +11,16 @@
Are you sure you want to flush
<strong>
{{ object }}
</strong>
?
Are you sure you want to flush
<strong>
{{ object }}
</strong>
?
{%endblocktrans%}
{%endblocktrans%}
{% endif %}
{% endif %}
<br
/>
<div
class=
"pull-right"
>
<div
class=
"pull-right"
style=
"margin-top: 15px;"
>
<form
action=
""
method=
"POST"
>
{% csrf_token %}
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
{% trans "Cancel" %}
</button>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
{% trans "Cancel" %}
</button>
<button
id=
"confirmation-modal-button"
type=
"button"
class=
"btn btn-warning"
>
{% trans "Flush" %}
</button>
<input
type=
"hidden"
name=
"flush"
value=
""
/>
<button
class=
"btn btn-warning"
>
{% trans "Yes" %}
</button>
</form>
</div>
</div>
<div
class=
"clearfix"
></div>
<div
class=
"clearfix"
></div>
</div>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal-dialog -->
...
...
circle/dashboard/templates/dashboard/confirm/node-flush.html
View file @
b722b632
{% extends "dashboard/base.html" %}
{% extends "dashboard/base.html" %}
{% load i18n %}
{% load i18n %}
{% block content %}
{% block content %}
<div
class=
"body-content"
>
<div
class=
"body-content"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel panel-default"
>
...
@@ -25,8 +24,8 @@
...
@@ -25,8 +24,8 @@
<form
action=
""
method=
"POST"
>
<form
action=
""
method=
"POST"
>
{% csrf_token %}
{% csrf_token %}
<a
class=
"btn btn-default"
>
{% trans "Back" %}
</a>
<a
class=
"btn btn-default"
>
{% trans "Back" %}
</a>
<input
type=
"hidden"
name=
"next"
value=
"{{ request.GET.next }}
"
/>
<input
type=
"hidden"
name=
"flush"
value=
"
"
/>
<button
class=
"btn btn-warning"
>
{% trans "Yes
, flush
" %}
</button>
<button
class=
"btn btn-warning"
>
{% trans "Yes" %}
</button>
</form>
</form>
</div>
</div>
</div>
</div>
...
...
circle/dashboard/views.py
View file @
b722b632
...
@@ -497,14 +497,13 @@ class NodeDetailView(LoginRequiredMixin, SuperuserRequiredMixin, DetailView):
...
@@ -497,14 +497,13 @@ class NodeDetailView(LoginRequiredMixin, SuperuserRequiredMixin, DetailView):
return
context
return
context
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
print
request
.
POST
if
request
.
POST
.
get
(
'new_name'
):
if
request
.
POST
.
get
(
'new_name'
):
return
self
.
__set_name
(
request
)
return
self
.
__set_name
(
request
)
if
request
.
POST
.
get
(
'change_status'
)
is
not
None
:
if
request
.
POST
.
get
(
'change_status'
)
is
not
None
:
return
self
.
__set_status
(
request
)
return
self
.
__set_status
(
request
)
if
request
.
POST
.
get
(
'to_remove'
):
if
request
.
POST
.
get
(
'to_remove'
):
return
self
.
__remove_trait
(
request
)
return
self
.
__remove_trait
(
request
)
if
request
.
POST
.
get
(
'flush'
):
if
request
.
POST
.
get
(
'flush'
)
is
not
None
:
return
self
.
__flush
(
request
)
return
self
.
__flush
(
request
)
return
redirect
(
reverse_lazy
(
"dashboard.views.node-detail"
,
return
redirect
(
reverse_lazy
(
"dashboard.views.node-detail"
,
kwargs
=
{
'pk'
:
self
.
get_object
()
.
pk
}))
kwargs
=
{
'pk'
:
self
.
get_object
()
.
pk
}))
...
...
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