firefly-iii/resources/views/partials/flashes.twig

83 lines
3.3 KiB
Twig
Raw Normal View History

<!-- SUCCESS MESSAGE (ALWAYS SINGULAR) -->
2015-05-01 11:44:49 -05:00
{% if Session.has('success') %}
2015-06-27 01:06:24 -05:00
<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>{{ 'flash_success'|_ }}</strong> {{ session('success') }}
2015-06-27 01:06:24 -05:00
</div>
2015-05-01 11:44:49 -05:00
{% endif %}
<!-- INFO MESSAGE (CAN BE MULTIPLE) -->
2015-05-01 11:44:49 -05:00
{% if Session.has('info') %}
2015-06-27 01:06:24 -05:00
<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>
2015-07-19 06:46:34 -05:00
<!-- MULTIPLE INFO MESSAGE -->
{% if session('info') is iterable and session('info')|length > 1 %}
<strong>
{{ Lang.choice('firefly.flash_info_multiple', session('info')|length, {count: session('info')|length}) }}:</strong>
2015-07-19 06:46:34 -05:00
<ul class="list-unstyled">
{% for inf in session('info') %}
<li>{{ inf|raw }}</li>
2015-07-19 06:46:34 -05:00
{% endfor %}
</ul>
{% endif %}
<!-- SET OF MULTIPLE INFO MESSAGES, BUT THERE IS JUST ONE -->
{% if session('info') is iterable and session('info')|length == 1 %}
<strong>{{ 'flash_info'|_ }}:</strong> {{ session('info')[0]|raw }}
2015-07-19 06:46:34 -05:00
{% endif %}
<!-- SINGLE INFO MESSAGE -->
{% if session('info') is not iterable %}
<strong>{{ 'flash_info'|_ }}:</strong> {{ session('info')|raw }}
2015-07-19 06:46:34 -05:00
{% endif %}
2015-06-27 01:06:24 -05:00
</div>
2015-07-19 06:46:34 -05:00
2015-05-01 11:44:49 -05:00
{% endif %}
<!-- WARNING MESSAGE (ALWAYS SINGULAR) -->
2015-05-01 11:44:49 -05:00
{% if Session.has('warning') %}
2015-06-27 01:06:24 -05:00
<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>{{ 'flash_warning'|_ }}</strong> {{ session('warning') }}
2015-06-27 01:06:24 -05:00
</div>
2015-05-01 11:44:49 -05:00
{% endif %}
<!-- ERROR MESSAGE (CAN BE MULTIPLE) -->
2015-05-01 11:44:49 -05:00
{% if Session.has('error') %}
2015-06-27 01:06:24 -05:00
<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>
2015-07-19 06:46:34 -05:00
<!-- MULTIPLE ERRORS (BAD) -->
{% if session('error') is iterable and session('error')|length > 1 %}
<strong>
{{ Lang.choice('firefly.flash_error_multiple', session('error')|length, {count: session('error')|length}) }}:
</strong>
2015-07-19 06:46:34 -05:00
<ul class="list-unstyled">
{% for err in session('error') %}
2015-07-19 06:46:34 -05:00
<li>{{ err }}</li>
{% endfor %}
</ul>
{% endif %}
<!-- SET OF MULTIPLE ERRORS, BUT THERE IS JUST ONE -->
{% if session('error') is iterable and session('error')|length == 1 %}
<strong>{{ 'flash_error'|_ }}</strong>
{{ session('error')[0]|raw }}
2015-07-19 06:46:34 -05:00
{% endif %}
<!-- SINGLE ERROR -->
{% if session('error') is not iterable %}
<strong>{{ 'flash_error'|_ }}</strong> {{ session('error')|raw }}
2015-07-19 06:46:34 -05:00
{% endif %}
2015-06-27 01:06:24 -05:00
</div>
2015-05-01 11:44:49 -05:00
{% endif %}