{% if app.session.flashbag.peek('success')|length %}
{% for message in app.flashes('success') %}
<script>
Swal.fire(
'',
'{{ message|raw }}',
'success'
);
</script>
{% endfor %}
{% endif %}
{% if app.session.flashbag.peek('success_toast')|length %}
{% for message in app.flashes('success_toast') %}
<script>
Swal.fire({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 1500,
timerProgressBar: true,
icon: 'success',
html: '{{ message|raw }}'
});
</script>
{% endfor %}
{% endif %}
{% if app.session.flashbag.peek('error')|length %}
{% for message in app.flashes('error') %}
<script>
Swal.fire(
'',
'{{ message|raw }}',
'error'
);
</script>
{% endfor %}
{% endif %}
{% if app.session.flashbag.peek('error_toast')|length %}
{% for message in app.flashes('error_toast') %}
<script>
Swal.fire({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 1500,
timerProgressBar: true,
icon: 'error',
html: '{{ message|raw }}'
});
</script>
{% endfor %}
{% endif %}
{% if app.session.flashbag.peek('warning')|length %}
{% for message in app.flashes('warning') %}
<script>
Swal.fire(
'',
'{{ message|raw }}',
'warning'
);
</script>
{% endfor %}
{% endif %}
{% if app.session.flashbag.peek('warning_toast')|length %}
{% for message in app.flashes('warning_toast') %}
<script>
Swal.fire({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 1500,
timerProgressBar: true,
icon: 'warning',
html: '{{ message|raw }}'
});
</script>
{% endfor %}
{% endif %}
{% if app.session.flashbag.peek('info')|length %}
{% for message in app.flashes('info') %}
<script>
Swal.fire(
'',
'{{ message|raw }}',
'info'
);
</script>
{% endfor %}
{% endif %}
{% if app.session.flashbag.peek('info_toast')|length %}
{% for message in app.flashes('info_toast') %}
<script>
Swal.fire({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 1500,
timerProgressBar: true,
icon: 'info',
html: '{{ message|raw }}'
});
</script>
{% endfor %}
{% endif %}
{% if app.session.flashBag.has(getParam('session_name')~'_cookies') %}
{% set message = '' %}
{% for msg in app.session.flashBag.get(getParam('session_name')~'_cookies') %}
{% set message = msg %}
{% endfor %}
<style>
._swal_popup_custom {background: none;}
._swal_blur_bg {backdrop-filter: blur(5px); background-color: rgba(0, 0, 0, 0.9)!important; z-index: 99999999999;}
@media (max-width: 430px) {
.swal2-html-container {margin: 0;}
._wp_container ._wp_msg_container {padding: 0!important;}
._wp_container ._wp_msg_container h2 {padding: 10px 20px 0 0;}
._wp_container ._wp_msg_container p {padding: 0 10px 10px 10px;}
._wp_container ._wp_TOS_content {padding: 0 5px!important;}
}
</style>
<div class="_cookies_content" style="display: none;">
{% include 'cookies_warning.html.twig' %}
</div>
<script>
$(document).ready(function(){
Swal.fire({
title: '',
html: $('._cookies_content').html(),
showDenyButton: false,
showConfirmButton: false,
allowOutsideClick: false,
showCloseButton: false,
didOpen: () => {
$('.swal2-popup').addClass('_swal_popup_custom');
$('.swal2-backdrop-show').addClass('_swal_blur_bg');
$('.swal2-close').blur();
$('._wp_confirm').on('click', function(){
$.cookie('{{ getParam('session_name') }}_cookies', 1, { path: '/', secure: true });
Swal.close();
});
$('._wp_deny').on('click', function(){
parent.location.href = 'https://www.google.com';
Swal.close();
});
},
willClose: () => {}
}).then(() => {});
});
</script>
{% endif %}