]> git.agnieray.net Git - galette.git/blobdiff - galette/templates/default/elements/messages_inline.html.twig
Merge branch 'hotfix/1.0.3'
[galette.git] / galette / templates / default / elements / messages_inline.html.twig
index 8645aef37cdaa612a692b1cd0b2ef39d9dae3911..a078ae270bcffda74d8a8d12dbe23d82acdbf2dc 100644 (file)
@@ -7,83 +7,89 @@
 {% endif %}
 
 {# Let's see if there are error messages to show #}
-{% set errors = flash.getMessage('error_detected') ?? []|merge(flash.getMessage('error') ?? [])|merge(loginfaults ?? []) %}
+{% set errors = flash.getMessage('error_detected') ?? [] %}
+{% set errors = errors|merge(flash.getMessage('error') ?? []) %}
+{% set errors = errors|merge(loginfaults ?? []) %}
 {% if error_detected is defined and error_detected is iterable %}
     {% for e in error_detected %}
         {% set errors = errors|merge([e]) %}
     {% endfor %}
 {% endif %}
 {% if errors is iterable and errors|length > 0 %}
-    <div class="ui error icon message with-transition">
-        <i class="times icon" aria-hidden="true"></i>
-        <i class="window close outline icon" aria-hidden="true"></i>
-        <div class="content">
-            <div class="header">{{ _T("- ERROR -") }}</div>
-            {% if errors|length > 1 %}
-                <ul class="list">
-                {% for error in errors %}
-                    <li>{{ error|raw }}</li>
-                {% endfor %}
-                </ul>
-            {% else %}
-                {% for error in errors %}
-                    <p>{{ error|raw }}</p>
-                {% endfor %}
-            {% endif %}
+    <noscript>
+        <div class="ui error icon message">
+            <i class="exclamation circle icon" aria-hidden="true"></i>
+            <div class="content">
+                <div class="header">{{ _T("- ERROR -") }}</div>
+                {% if errors|length > 1 %}
+                    <ul class="list">
+                    {% for error in errors %}
+                        <li>{{ error|raw }}</li>
+                    {% endfor %}
+                    </ul>
+                {% else %}
+                    {% for error in errors %}
+                        <p>{{ error|raw }}</p>
+                    {% endfor %}
+                {% endif %}
+            </div>
         </div>
-    </div>
+    </noscript>
 {% endif %}
 
 {# Let's see if there are warning messages to show #}
-{% set warnings = flash.getMessage('warning_detected') ?? []|merge(flash.getMessage('warning') ?? []) %}
+{% set warnings = flash.getMessage('warning_detected') ?? [] %}
+{% set warnings = warnings|merge(flash.getMessage('warning') ?? []) %}
 {% if warning_detected is defined and warning_detected is iterable %}
     {% for w in warning_detected %}
         {% set warnings = warnings|merge([w]) %}
     {% endfor %}
 {% endif %}
 {% if warnings is iterable and warnings|length > 0 %}
-    <div class="ui warning icon message with-transition">
-        <i class="exclamation triangle icon" aria-hidden="true"></i>
-        <i class="window close outline icon" aria-hidden="true"></i>
-        <div class="content">
-            <div class="header">{{ _T("- WARNING -") }}</div>
-            {% if warnings|length > 1 %}
-                <ul class="list">
-                {% for warning in warnings %}
-                    <li>{{ warning|raw }}</li>
-                {% endfor %}
-                </ul>
-            {% else %}
-                {% for warning in warnings %}
-                    <p>{{ warning|raw }}</p>
-                {% endfor %}
-            {% endif %}
+    <noscript>
+        <div class="ui warning icon message">
+            <i class="exclamation triangle icon" aria-hidden="true"></i>
+            <div class="content">
+                <div class="header">{{ _T("- WARNING -") }}</div>
+                {% if warnings|length > 1 %}
+                    <ul class="list">
+                    {% for warning in warnings %}
+                        <li>{{ warning|raw }}</li>
+                    {% endfor %}
+                    </ul>
+                {% else %}
+                    {% for warning in warnings %}
+                        <p>{{ warning|raw }}</p>
+                    {% endfor %}
+                {% endif %}
+            </div>
         </div>
-    </div>
+    </noscript>
 {% endif %}
 
 {# Let's see if there are success messages to show #}
-{% set successs = flash.getMessage('success_detected') ?? []|merge(flash.getMessage('success') ?? []) %}
+{% set success = flash.getMessage('success_detected') ?? [] %}
+{% set success = success|merge(flash.getMessage('success') ?? []) %}
 {% if success_detected is defined and success_detected is iterable %}
-    {% for s in success_detected %}
-        {% set successs = successs|merge([s]) %}
+    {% for entry in success_detected %}
+        {% set success = success|merge([entry]) %}
     {% endfor %}
 {% endif %}
-{% if successs is iterable and successs|length > 0 %}
+{% if success is iterable and success|length > 0 %}
     <noscript>
         <div class="ui success icon message">
             <i class="check circle outline icon" aria-hidden="true"></i>
             <i class="window close outline icon" aria-hidden="true"></i>
             <div class="content">
-            {% if successs|length > 1 %}
+            {% if success|length > 1 %}
                 <ul class="list">
-                {% for success in successs %}
-                    <li>{{ success|raw }}</li>
+                {% for entry in success %}
+                    <li>{{ entry|raw }}</li>
                 {% endfor %}
                 </ul>
             {% else %}
-                {% for success in successs %}
-                    <p>{{ success|raw }}</p>
+                {% for entry in success %}
+                    <p>{{ entry|raw }}</p>
                 {% endfor %}
             {% endif %}
             </div>
     </noscript>
 {% endif %}
 
+{# Let's see if there are info messages to show #}
+{% set info = flash.getMessage('info_detected') ?? [] %}
+{% set info = info|merge(flash.getMessage('info') ?? []) %}
+{% if info_detected is defined and info_detected is iterable %}
+    {% for i in info_detected %}
+        {% set info = info|merge([i]) %}
+    {% endfor %}
+{% endif %}
+{% if info is iterable and info|length > 0 %}
+    <noscript>
+        <div class="ui info icon message">
+            <i class="info icon" aria-hidden="true"></i>
+            <div class="content">
+                {% if info|length > 1 %}
+                    <ul class="list">
+                        {% for i in info %}
+                            <li>{{ i|raw }}</li>
+                        {% endfor %}
+                    </ul>
+                {% else %}
+                    {% for entry in info %}
+                        {% set info_title = '' %}
+                        {% set info_message = entry %}
+                        {% if entry is iterable %}
+                            {% set info_title = entry.title %}
+                            <p class="header">{{ info_title }}</p>
+                            {% set info_message = entry.message %}
+                        {% endif %}
+                        <p>{{ entry|raw }}</p>
+                    {% endfor %}
+                {% endif %}
+            </div>
+        </div>
+    </noscript>
+{% endif %}
+
 {# Renew telemetry #}
 {% if renew_telemetry is defined and renew_telemetry %}
     {% include "modals/telemetry.html.twig" with {part: "dialog"} %}