{# Messages flask  (flash) #}

<div class="container flashes">
    {% with messages = get_flashed_messages(with_categories=true) %}
        {% for category, message in messages %}
            <div class="alert alert-info alert-{{ category }}" role="alert">{{ message }}</div>
        {% endfor %}
    {% endwith %}
</div>

<script>
    setTimeout(function() {
        var flashes = document.getElementsByClassName("flashes")[0];
        if (flashes) {
            flashes.style.display = "none";
        }
    }, 5000);
</script>