27 lines
784 B
HTML
27 lines
784 B
HTML
<div id="toast-container" class="toast-container">
|
|
<script>
|
|
{% if messages %}
|
|
{% for message in messages %}
|
|
try {
|
|
let Toast = Swal.mixin({
|
|
toast: true,
|
|
position: "top-end",
|
|
showConfirmButton: false,
|
|
timer: 2000,
|
|
timerProgressBar: false,
|
|
didOpen: (toast) => {
|
|
toast.onmouseenter = Swal.stopTimer;
|
|
toast.onmouseleave = Swal.resumeTimer;
|
|
} });
|
|
Toast.fire({
|
|
icon: "{{ message.tags }}",
|
|
titleText: "{{ message| safe }}"});
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
{% endfor %}
|
|
{% endif %}
|
|
function notify(tag,msg){Toast.fire({icon: tag,titleText: msg});}
|
|
</script>
|
|
</div>
|