]> git.agnieray.net Git - galette.git/blob - galette/templates/default/elements/messages_inline.html.twig
Use raw twig filter on messages
[galette.git] / galette / templates / default / elements / messages_inline.html.twig
1 {# Let's see if there are loginfault messages to show #}
2 {% set loginfaults = flash.getMessage('loginfault') %}
3 {% if loginfault_detected is defined and loginfault_detected is iterable %}
4 {% for l in loginfault_detected %}
5 {% set loginfaults = loginfaults|merge([l]) %}
6 {% endfor %}
7 {% endif %}
8
9 {# Let's see if there are error messages to show #}
10 {% set errors = flash.getMessage('error_detected') ?? []|merge(flash.getMessage('error') ?? [])|merge(loginfaults ?? []) %}
11 {% if error_detected is defined and error_detected is iterable %}
12 {% for e in error_detected %}
13 {% set errors = errors|merge([e]) %}
14 {% endfor %}
15 {% endif %}
16 {% if errors is iterable and errors|length > 0 %}
17 <div class="ui error icon message with-transition">
18 <i class="times icon"></i>
19 <i class="window close outline icon"></i>
20 <div class="content">
21 <div class="header">{{ _T("- ERROR -") }}</div>
22 {% if errors|length > 1 %}
23 <ul class="list">
24 {% for error in errors %}
25 <li>{{ error|raw }}</li>
26 {% endfor %}
27 </ul>
28 {% else %}
29 {% for error in errors %}
30 <p>{{ error|raw }}</p>
31 {% endfor %}
32 {% endif %}
33 </div>
34 </div>
35 {% endif %}
36
37 {# Let's see if there are warning messages to show #}
38 {% set warnings = flash.getMessage('warning_detected') ?? []|merge(flash.getMessage('warning') ?? []) %}
39 {% if warning_detected is defined and warning_detected is iterable %}
40 {% for w in warning_detected %}
41 {% set warnings = warnings|merge([w]) %}
42 {% endfor %}
43 {% endif %}
44 {% if warnings is iterable and warnings|length > 0 %}
45 <div class="ui warning icon message with-transition">
46 <i class="exclamation triangle icon"></i>
47 <i class="window close outline icon"></i>
48 <div class="content">
49 <div class="header">{{ _T("- WARNING -") }}</div>
50 {% if warnings|length > 1 %}
51 <ul class="list">
52 {% for warning in warnings %}
53 <li>{{ warning|raw }}</li>
54 {% endfor %}
55 </ul>
56 {% else %}
57 {% for warning in warnings %}
58 <p>{{ warning|raw }}</p>
59 {% endfor %}
60 {% endif %}
61 </div>
62 </div>
63 {% endif %}
64
65 {# Let's see if there are success messages to show #}
66 {% set successs = flash.getMessage('success_detected') ?? []|merge(flash.getMessage('success') ?? []) %}
67 {% if success_detected is defined and success_detected is iterable %}
68 {% for s in success_detected %}
69 {% set successs = successs|merge([s]) %}
70 {% endfor %}
71 {% endif %}
72 {% if successs is iterable and successs|length > 0 %}
73 <noscript>
74 <div class="ui success icon message">
75 <i class="check circle outline icon"></i>
76 <i class="window close outline icon"></i>
77 <div class="content">
78 {% if successs|length > 1 %}
79 <ul class="list">
80 {% for success in successs %}
81 <li>{{ success|raw }}</li>
82 {% endfor %}
83 </ul>
84 {% else %}
85 {% for success in successs %}
86 <p>{{ success|raw }}</p>
87 {% endfor %}
88 {% endif %}
89 </div>
90 </div>
91 </noscript>
92 {% endif %}
93
94 {# Renew telemetry #}
95 {% if renew_telemetry is defined and renew_telemetry %}
96 {% include "modals/telemetry.html.twig" with {part: "dialog"} %}
97 <noscript>
98 <div class="ui info icon message" id="renewbox">
99 <i class="info icon"></i>
100 <div class="content">
101 <div class="header">{{ _T("Your telemetry data are more than one year old.") }}</div>
102 <p>{{ _T("Do you want to send it again?") }}</p>
103 <a href="#" id="telemetry" class="ui large green button">{{ _T("Yes") }}</a>
104 <a href="#" id="norenew" class="ui large red button">{{ _T("No") }}</a>
105 <a href="#" id="renewlater" class="ui large blue button">{{ _T("Later") }}</a>
106 </div>
107 </div>
108 </noscript>
109 {% endif %}