firefly-iii/resources/views/partials/flashes.twig
2016-01-08 13:35:27 +01:00

63 lines
2.6 KiB
Twig

{% if Session.has('success') %}
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">{{ 'close'|_ }}</span></button>
<strong>Success!</strong> {{ Session.get('success') }}
</div>
{% endif %}
{% if Session.has('info') %}
<div class="alert alert-info alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">{{ 'close'|_ }}</span></button>
{% if Session.get('info') is iterable and Session.get('info')|length > 1 %}
<strong>{{ Session.get('info')|length }} messages:</strong>
<ul class="list-unstyled">
{% for err in Session.get('info') %}
<li>{{ err }}</li>
{% endfor %}
</ul>
{% endif %}
{% if Session.get('info') is iterable and Session.get('info')|length == 1 %}
<strong>Message:</strong> {{ Session.get('info')[0]|raw }}
{% endif %}
{% if Session.get('info') is not iterable %}
<strong>Message:</strong> {{ Session.get('info')|raw }}
{% endif %}
</div>
{% endif %}
{% if Session.has('warning') %}
<div class="alert alert-warning alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">{{ 'close'|_ }}</span></button>
<strong>Warning!</strong> {{ Session.get('warning') }}
</div>
{% endif %}
{% if Session.has('error') %}
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">{{ 'close'|_ }}</span></button>
{% if Session.get('error') is iterable and Session.get('error')|length > 1 %}
<strong>{{ Session.get('error')|length }} errors:</strong>
<ul class="list-unstyled">
{% for err in Session.get('error') %}
<li>{{ err }}</li>
{% endfor %}
</ul>
{% endif %}
{% if Session.get('error') is iterable and Session.get('error')|length == 1 %}
<strong>Error!</strong>
{{ Session.get('error')[0]|raw }}
{% endif %}
{% if Session.get('error') is not iterable %}
<strong>Error!</strong> {{ Session.get('error')|raw }}
{% endif %}
</div>
{% endif %}