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

102 lines
3.8 KiB
Twig
Raw Normal View History

2017-09-14 16:12:07 +02:00
{# LOCALE ERROR MESSAGE #}
{% if invalidMonetaryLocale %}
<div class="alert alert-info alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
<span>&times;</span><span class="sr-only">{{ 'close'|_ }}</span>
</button>
<strong>{{ 'invalid_server_configuration'|_ }}:</strong> <i class="fa fa-money"></i> {{ 'invalid_locale_settings'|_ }}
</div>
{% endif %}
2017-03-18 11:02:02 +01:00
{# SUCCESS MESSAGE (ALWAYS SINGULAR) #}
2017-12-13 18:46:30 +01:00
{% if session_has('success') %}
2015-06-27 08:06:24 +02:00
<div class="alert alert-success alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
2017-08-20 12:43:31 +02:00
<span>&times;</span><span class="sr-only">{{ 'close'|_ }}</span>
</button>
<strong>{{ 'flash_success'|_ }}</strong>
2018-08-20 13:45:30 -04:00
{% if session_has('success_uri') %}
<a href="{{ session('success_uri') }}">
{% endif %}
{{ session('success') }}
2018-08-20 13:45:30 -04:00
{% if session_has('success_uri') %}
</a>
{% endif %}
</div>
{% endif %}
2017-03-18 11:02:02 +01:00
{# INFO MESSAGE (CAN BE MULTIPLE) #}
2017-12-13 18:46:30 +01:00
{% if session_has('info') %}
2015-06-27 08:06:24 +02:00
<div class="alert alert-info alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
2017-08-20 12:43:31 +02:00
<span>&times;</span><span class="sr-only">{{ 'close'|_ }}</span>
</button>
2015-07-19 13:46:34 +02:00
2017-03-18 11:02:02 +01: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 13:46:34 +02:00
<ul class="list-unstyled">
{% for inf in session('info') %}
<li>{{ inf|raw }}</li>
2015-07-19 13:46:34 +02:00
{% endfor %}
</ul>
{% endif %}
2017-03-18 11:02:02 +01:00
{# 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 13:46:34 +02:00
{% endif %}
2017-03-18 11:02:02 +01:00
{# SINGLE INFO MESSAGE #}
{% if session('info') is not iterable %}
<strong>{{ 'flash_info'|_ }}:</strong> {{ session('info')|raw }}
2015-07-19 13:46:34 +02:00
{% endif %}
2015-06-27 08:06:24 +02:00
</div>
2015-07-19 13:46:34 +02:00
2015-05-01 18:44:49 +02:00
{% endif %}
2017-03-18 11:02:02 +01:00
{# WARNING MESSAGE (ALWAYS SINGULAR) #}
2017-12-13 18:46:30 +01:00
{% if session_has('warning') %}
2015-06-27 08:06:24 +02:00
<div class="alert alert-warning alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
2017-08-20 12:43:31 +02:00
<span>&times;</span><span class="sr-only">{{ 'close'|_ }}</span>
</button>
<strong>{{ 'flash_warning'|_ }}</strong> {{ session('warning') }}
2015-06-27 08:06:24 +02:00
</div>
2015-05-01 18:44:49 +02:00
{% endif %}
2017-03-18 11:02:02 +01:00
{# ERROR MESSAGE (CAN BE MULTIPLE) #}
2017-12-13 18:46:30 +01:00
{% if session_has('error') %}
2015-06-27 08:06:24 +02:00
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">
2017-08-20 12:43:31 +02:00
<span>&times;</span><span class="sr-only">{{ 'close'|_ }}</span>
</button>
2015-07-19 13:46:34 +02:00
2017-03-18 11:02:02 +01: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 13:46:34 +02:00
<ul class="list-unstyled">
{% for err in session('error') %}
2015-07-19 13:46:34 +02:00
<li>{{ err }}</li>
{% endfor %}
</ul>
{% endif %}
2017-03-18 11:02:02 +01:00
{# 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 13:46:34 +02:00
{% endif %}
2017-03-18 11:02:02 +01:00
{# SINGLE ERROR #}
{% if session('error') is not iterable %}
<strong>{{ 'flash_error'|_ }}</strong> {{ session('error')|raw }}
2015-07-19 13:46:34 +02:00
{% endif %}
2015-06-27 08:06:24 +02:00
</div>
2015-05-01 18:44:49 +02:00
{% endif %}
2017-09-14 16:12:07 +02:00