cosmetic: remove flashed message after 5 secs

This commit is contained in:
Emmanuel Viennet 2023-04-14 16:35:24 +02:00
parent c4f948912b
commit 010583ffc5
3 changed files with 24 additions and 13 deletions

View File

@ -62,7 +62,7 @@
{% endblock %}
{% block content %}
<div class="container">
<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>
@ -72,6 +72,14 @@
{# application content needs to be provided in the app_content block #}
{% block app_content %}{% endblock %}
</div>
<script>
setTimeout(function() {
var flashes = document.getElementsByClassName("flashes")[0];
if (flashes) {
flashes.style.display = "none";
}
}, 5000);
</script>
{% endblock %}
{% block scripts %}

View File

@ -1,9 +1,18 @@
{# Message flask : utilisé uniquement par les anciennes pages ScoDoc #}
{# -*- mode: jinja-html -*- #}
<div class="head_message_container">
{# Messages flask (flash) #}
<div class="container flashes">
{% with messages = get_flashed_messages(with_categories=true) %}
{% for category, message in messages %}
<div class="head_message alert-info alert-{{ category }}" role="alert">{{ message }}</div>
<div class="alert alert-info alert-{{ category }}" role="alert">{{ message }}</div>
{% endfor %}
{% endwith %}
</div>
</div>
<script>
setTimeout(function() {
var flashes = document.getElementsByClassName("flashes")[0];
if (flashes) {
flashes.style.display = "none";
}
}, 5000);
</script>

View File

@ -24,13 +24,7 @@
{% endblock %}
<div id="gtrcontent" class="gtrcontent">
<div class="container">
{% 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>
{% include "flashed_messages.j2" %}
{% if sco.sem %}
{% block formsemestre_header %}
{% include "formsemestre_header.j2" %}