{% if app.request.hasPreviousSession %}
<div class="messages">
{% for type, messages in app.flashes %}
{% for message in messages %}
{# Bootstrap alert, see https://getbootstrap.com/docs/3.4/components/#alerts #}
<div class="alert alert-dismissible alert-{{ type }}" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
{{ message|trans }}
</div>
{% endfor %}
{% endfor %}
</div>
{% endif %}
{% if formPurchase is defined and formPurchase.vars is defined %}
{% set formErrors = formPurchase.vars.errors.form.getErrors(true) %}
{% if formErrors|length %}
<div class="alert alert-dismissible alert-danger" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
{% for error in formErrors %}
{{ error.message }}
{% endfor %}
</div>
{% endif %}
{% endif %}
{% if error.messageKey is defined %}
<div class="alert alert-dismissible alert-danger" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
{{ error.messageKey|trans(error.messageData, 'security') }}
</div>
{% endif %}