{% if app.session.flashBag.has('error') or app.session.flashBag.has('notice') or app.session.flashBag.has('js') or app.session.flashBag.has('popup') or app.session.flashBag.has('modal') or app.session.flashBag.has('html') %}
<div class="{% if app.session.flashBag.has('error') %}messages errors{% endif %} {% if app.session.flashBag.has('notice') %}messages notices{% endif %}">
{% if app.session.flashBag.has('notice') %}
<div class="notice success" role="alert">
{% for msg in app.session.flashBag.get('notice') %}
{{ msg|raw }}
{% endfor %}
</div>
{% endif %}
{% if app.session.flashBag.has('error') %}
<div class="alert error" role="alert">
{% for msg in app.session.flashBag.get('error') %}
{{ msg|raw }}
{% endfor %}
</div>
{% endif %}
{% if app.session.flashBag.has('popup') %}
<script>
$(window).load(function(){
{% for msg in app.session.flashBag.get('modal') %}
$.fancybox.open({
content:'{{ msg|e('js') }}',
type:'html',
baseClass:'message-popup',
modal:false
});
{% endfor %}
});
</script>
{% endif %}
{% if app.session.flashBag.has('js') %}
<script>
$(document).ready(function(){
{% for msg in app.session.flashBag.get('js') %}
{{ msg|raw }}
{% endfor %}
});
</script>
{% endif %}
{% if app.session.flashBag.has('html') %}
{% for msg in app.session.flashBag.get('html') %}
{{ msg|raw }}
{% endfor %}
{% endif %}
</div>
{% endif %}