<script>
{% for type, messages in app.flashes() %}
{% for message in messages %}
$.notify({
message: "{{ message|trans }}"
}, {
// settings
type: "{{ type }}",
placement: {
from: "top",
align: "right",
},
delay: 5000,
timer: 1000,
animate: {
enter: 'animate__animated animate__fadeIn',
exit: 'animate__animated animate__fadeOutRight'
},
});
{% endfor %}
{% endfor %}
{% if form is defined and not form.vars.valid %}
$.notify({
message: `<strong>{{ 'erreur lors de la validation!'|trans }}</strong><br>{{ 'merci de vérifier les champs en rouge'|trans }}`
}, {
// settings
type: "danger",
placement: {
from: "top",
align: "right",
},
delay: 5000,
timer: 1000,
animate: {
enter: 'animate__animated animate__fadeIn',
exit: 'animate__animated animate__fadeOutRight'
},
});
{% endif %}
</script>