]> git.agnieray.net Git - galette.git/blob - galette/templates/default/elements/messages_inline.html.twig
e6b553506746a27a1e3ee4085f396002f887c2e5
[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 <noscript>
18 <div class="ui error icon message">
19 <i class="times icon" aria-hidden="true"></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 </noscript>
36 {% endif %}
37
38 {# Let's see if there are warning messages to show #}
39 {% set warnings = flash.getMessage('warning_detected') ?? []|merge(flash.getMessage('warning') ?? []) %}
40 {% if warning_detected is defined and warning_detected is iterable %}
41 {% for w in warning_detected %}
42 {% set warnings = warnings|merge([w]) %}
43 {% endfor %}
44 {% endif %}
45 {% if warnings is iterable and warnings|length > 0 %}
46 <noscript>
47 <div class="ui warning icon message">
48 <i class="exclamation triangle icon" aria-hidden="true"></i>
49 <div class="content">
50 <div class="header">{{ _T("- WARNING -") }}</div>
51 {% if warnings|length > 1 %}
52 <ul class="list">
53 {% for warning in warnings %}
54 <li>{{ warning|raw }}</li>
55 {% endfor %}
56 </ul>
57 {% else %}
58 {% for warning in warnings %}
59 <p>{{ warning|raw }}</p>
60 {% endfor %}
61 {% endif %}
62 </div>
63 </div>
64 </noscript>
65 {% endif %}
66
67 {# Let's see if there are success messages to show #}
68 {% set successs = flash.getMessage('success_detected') ?? []|merge(flash.getMessage('success') ?? []) %}
69 {% if success_detected is defined and success_detected is iterable %}
70 {% for s in success_detected %}
71 {% set successs = successs|merge([s]) %}
72 {% endfor %}
73 {% endif %}
74 {% if successs is iterable and successs|length > 0 %}
75 <noscript>
76 <div class="ui success icon message">
77 <i class="check circle outline icon" aria-hidden="true"></i>
78 <i class="window close outline icon" aria-hidden="true"></i>
79 <div class="content">
80 {% if successs|length > 1 %}
81 <ul class="list">
82 {% for success in successs %}
83 <li>{{ success|raw }}</li>
84 {% endfor %}
85 </ul>
86 {% else %}
87 {% for success in successs %}
88 <p>{{ success|raw }}</p>
89 {% endfor %}
90 {% endif %}
91 </div>
92 </div>
93 </noscript>
94 {% endif %}
95
96 {# Let's see if there are info messages to show #}
97 {% set info = flash.getMessage('info_detected') ?? []|merge(flash.getMessage('info') ?? []) %}
98 {% if info_detected is defined and info_detected is iterable %}
99 {% for i in info_detected %}
100 {% set info = info|merge([i]) %}
101 {% endfor %}
102 {% endif %}
103 {% if info is iterable and info|length > 0 %}
104 <noscript>
105 <div class="ui info icon message">
106 <i class="info icon" aria-hidden="true"></i>
107 <div class="content">
108 {% if info|length > 1 %}
109 <ul class="list">
110 {% for i in info %}
111 <li>{{ i|raw }}</li>
112 {% endfor %}
113 </ul>
114 {% else %}
115 {% for i in info %}
116 {% set info_title = '' %}
117 {% if i is iterable %}
118 {% set info_title = i.title %}
119 <p class="header">{{ info_title }}</p>
120 {% set i = i.message %}
121 {% endif %}
122 <p>{{ i|raw }}</p>
123 {% endfor %}
124 {% endif %}
125 </div>
126 </div>
127 </noscript>
128 {% endif %}
129
130 {# Renew telemetry #}
131 {% if renew_telemetry is defined and renew_telemetry %}
132 {% include "modals/telemetry.html.twig" with {part: "dialog"} %}
133 <noscript>
134 <div class="ui info icon message" id="renewbox">
135 <i class="info icon" aria-hidden="true"></i>
136 <div class="content">
137 <div class="header">{{ _T("Your telemetry data are more than one year old.") }}</div>
138 <p>{{ _T("Do you want to send it again?") }}</p>
139 <a href="#" id="telemetry" class="ui large green button">{{ _T("Yes") }}</a>
140 <a href="#" id="norenew" class="ui large red button">{{ _T("No") }}</a>
141 <a href="#" id="renewlater" class="ui large blue button">{{ _T("Later") }}</a>
142 </div>
143 </div>
144 </noscript>
145 {% endif %}