{% if app.session is not null and app.session.started %}
    {% set _flash_messages = app.session.flashbag.all %}
    {% if _flash_messages['alert'] is defined and _flash_messages['alert']|length > 0 %}
        <div id="lc-flash-alert">
            {% for alert in _flash_messages['alert'] %}

                <div class="modal fade">
                    <div class="modal-dialog">
                        <div class="modal-content bg-danger">
                            <div class="modal-header">
                                <h4 class="modal-title">{{ alert|trans|striptags }}</h4>
                            </div>
                            <div class="modal-footer align-right">
                                <button type="button" data-dismiss="modal" class="btn btn-outline-light">OK</button>
                            </div>
                        </div>
                    </div>
                </div>
            {% endfor %}
        </div>

    {% endif %}
    {% if _flash_messages|length > 0 %}
        <div id="lc-flash-messages">
            {% for label, messages in _flash_messages %}
                {% if label != 'alert' %}
                    {% for message in messages %}
                        <div class="notice">
                            <span class="type">{{ label }}</span>
                            <span class="message"> {{ message|trans|striptags }}</span>
                        </div>
                    {% endfor %}
                {% endif %}
            {% endfor %}
        </div>
    {% endif %}
{% endif %}
