Skip to content
Snippets Groups Projects
Commit eced4c36 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Implement alert flashing from javascript

JIRA INFRA-545
parent ddbfdcc5
No related branches found
No related tags found
No related merge requests found
function flash_alert(message, category) {
var htmlString = '<div class="alert alert-' + category + ' alert-dismissible" role="alert">'
htmlString += '<button type="button" class="close" data-dismiss="alert" aria-label="Close">'
htmlString += '<span aria-hidden="true">&times;</span></button>' + message + '</div>'
$(htmlString).prependTo("#mainContent").hide().slideDown();
}
function remove_alerts() {
$(".alert").slideUp("normal", function() {
$(this).remove();
});
}
// Function to dynamically update a select field
function update_selectfield(field_id, data, selected_value) {
var $field = $(field_id);
......
......@@ -34,7 +34,7 @@
</div>
</div>
<div class="col-12 col-md-10 col-xl-10">
<div class="col-12 col-md-10 col-xl-10" id="mainContent">
{{flashed_messages(messages, container=False, dismissible=True)}}
{% block main %}{% endblock %}
</div>
......
......@@ -54,7 +54,7 @@
{% endblock %}
{% block content %}
<div class="container">
<div class="container" id="mainContent">
{{flashed_messages(messages, container=False, dismissible=True)}}
{% block main %}{% endblock %}
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment