Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
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
73536165
authored
Nov 14, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: response after mass delete
parent
776c0d14
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
4 deletions
+15
-4
circle/dashboard/static/dashboard/dashboard.js
+10
-0
circle/dashboard/static/dashboard/vm-list.js
+2
-1
circle/dashboard/templates/dashboard/base.html
+2
-2
circle/dashboard/views.py
+1
-1
No files found.
circle/dashboard/static/dashboard/dashboard.js
View file @
73536165
...
@@ -63,6 +63,16 @@ function refreshSliders() {
...
@@ -63,6 +63,16 @@ function refreshSliders() {
});
});
}
}
function
addMessage
(
text
,
type
)
{
div
=
'<div style="display: none;" class="alert alert-'
+
type
+
'">'
+
text
+
'</div>'
;
$
(
'.messagelist'
).
html
(
''
).
append
(
div
);
$
(
'.messagelist div'
).
fadeIn
();
}
function
addConfirmationModal
(
text
,
func
)
{
}
// for AJAX calls
// for AJAX calls
/**
/**
...
...
circle/dashboard/static/dashboard/vm-list.js
View file @
73536165
...
@@ -101,13 +101,14 @@ $(function() {
...
@@ -101,13 +101,14 @@ $(function() {
// reset group buttons
// reset group buttons
selected
=
[]
selected
=
[]
$
(
'.vm-list-group-control .btn'
).
attr
(
'disabled'
,
true
);
$
(
'.vm-list-group-control .btn'
).
attr
(
'disabled'
,
true
);
addMessage
(
data
[
'message'
],
'success'
);
});
});
console
.
log
(
data
);
},
},
error
:
function
(
xhr
,
textStatus
,
error
)
{
error
:
function
(
xhr
,
textStatus
,
error
)
{
// TODO this
// TODO this
}
}
});
});
return
false
;
});
});
});
});
...
...
circle/dashboard/templates/dashboard/base.html
View file @
73536165
...
@@ -30,16 +30,16 @@
...
@@ -30,16 +30,16 @@
<div
class=
"container"
>
<div
class=
"container"
>
{% block messages %}
{% block messages %}
{% if messages %}
<div
class=
"messagelist"
>
<div
class=
"messagelist"
>
{% if messages %}
{% for message in messages %}
{% for message in messages %}
<div
class=
"alert
<div
class=
"alert
{% if message.tags %} alert-{% if message.tags == "
error
"
%}
danger
{%
else
%}{{
message
.
tags
}}{%
endif
%}{%
endif
%}"
>
{% if message.tags %} alert-{% if message.tags == "
error
"
%}
danger
{%
else
%}{{
message
.
tags
}}{%
endif
%}{%
endif
%}"
>
{{ message }}
{{ message }}
</div>
</div>
{% endfor %}
{% endfor %}
</div>
{% endif %}
{% endif %}
</div>
{% endblock messages %}
{% endblock messages %}
{% block content %}
{% block content %}
<h1
class=
"alert alert-error"
>
Please override "content" block.
</h1>
<h1
class=
"alert alert-error"
>
Please override "content" block.
</h1>
...
...
circle/dashboard/views.py
View file @
73536165
...
@@ -299,7 +299,7 @@ def mass_delete_vm(request, **kwargs):
...
@@ -299,7 +299,7 @@ def mass_delete_vm(request, **kwargs):
names
.
append
(
i
.
name
)
names
.
append
(
i
.
name
)
success_message
=
_
(
"Mass delete complete, the following VMs were "
+
success_message
=
_
(
"Mass delete complete, the following VMs were "
+
"deleted:
%
s"
%
u', '
.
join
(
names
))
"deleted:
%
s
!
"
%
u', '
.
join
(
names
))
# we can get this only via AJAX ...
# we can get this only via AJAX ...
if
request
.
is_ajax
():
if
request
.
is_ajax
():
...
...
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