Commit 73536165 by Kálmán Viktor

dashboard: response after mass delete

parent 776c0d14
...@@ -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
/** /**
......
...@@ -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;
}); });
}); });
......
...@@ -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>
......
...@@ -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():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment