{% set alert = {'success': 'success', 'error': 'error', 'info': 'info', 'warning': 'warning'} %}
{% for flashType in alert %}
{% for flashMessage in app.session.flashbag.get(flashType) %}
<script>
toastr.options = {
"closeButton": true,
"debug": false,
"newestOnTop": true,
"progressBar": false,
"positionClass": "toast-top-right",
"preventDuplicates": false,
"onclick": null,
"showDuration": "400",
"hideDuration": "800",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "slideDown",
"hideMethod": "slideUp"
};
toastr["{{ alert[flashType] }}"]("{{ flashMessage | raw }}");
</script>
{% endfor %}
{% endfor %}