{% for flash_message in app.session.flashbag.get('success') %}
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-check-circle"></i> Success!</h4>
{{ flash_message }}
</div>
{% endfor %}
<script>
(function($) {
$(document).ready(function() {
let flashTimeout = 5000;
let $alert = $('.alert-dismissible');
if ($alert.length > 0) {
setTimeout(function() {
$alert.fadeOut('slow', function() {
$(this).remove();
});
}, flashTimeout);
}
});
})(jQuery);
</script>