Skip to content

Instantly share code, notes, and snippets.

@grachevko
Created August 15, 2015 14:55
Show Gist options
  • Save grachevko/254341bd55fa7ef5334c to your computer and use it in GitHub Desktop.
Save grachevko/254341bd55fa7ef5334c to your computer and use it in GitHub Desktop.
{% if app.session.flashbag.peekAll|length > 0 %}
{% set flashbag = app.session.flashbag.all %}
<script>
init.push(function () {
{% for type,messages in flashbag %}
{% for message in messages %}
PixelAdmin.plugins.alerts.add('<strong>{{ message[0]|trans }}</strong> {{ message[1]|trans(message[2], 'backend')|raw }}', {
type: '{{ type }}',
namespace: 'pa_page_alerts_dark',
{% if message[3] is not null %}
'auto_close': {{ message[3] }},
{% endif %}
classes: 'alert-dark'
});
{% endfor %}
{% endfor %}
});
</script>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment