Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
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() {
});
}
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
/**
...
...
circle/dashboard/static/dashboard/vm-list.js
View file @
73536165
...
...
@@ -101,13 +101,14 @@ $(function() {
// reset group buttons
selected
=
[]
$
(
'.vm-list-group-control .btn'
).
attr
(
'disabled'
,
true
);
addMessage
(
data
[
'message'
],
'success'
);
});
console
.
log
(
data
);
},
error
:
function
(
xhr
,
textStatus
,
error
)
{
// TODO this
}
});
return
false
;
});
});
...
...
circle/dashboard/templates/dashboard/base.html
View file @
73536165
...
...
@@ -30,16 +30,16 @@
<div
class=
"container"
>
{% block messages %}
{% if messages %}
<div
class=
"messagelist"
>
{% if messages %}
{% for message in messages %}
<div
class=
"alert
{% if message.tags %} alert-{% if message.tags == "
error
"
%}
danger
{%
else
%}{{
message
.
tags
}}{%
endif
%}{%
endif
%}"
>
{{ message }}
</div>
{% endfor %}
</div>
{% endif %}
</div>
{% endblock messages %}
{% block content %}
<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):
names
.
append
(
i
.
name
)
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 ...
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