Commit 73536165 by Kálmán Viktor

dashboard: response after mass delete

parent 776c0d14
......@@ -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
/**
......
......@@ -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;
});
});
......
......@@ -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>
......
......@@ -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():
......
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