demarches-normaliennes/app/views/layouts/_flash_messages.html.haml
2024-10-23 14:00:24 +02:00

22 lines
1,022 B
Text

#flash_messages
#flash_message.center
- if flash.any?
- flash.each do |key, value|
- sticky = defined?(sticky) ? sticky : false
- fixed = defined?(fixed) ? fixed : false
- if flash_role(key) == 'status'
.alert.alert-success{ role: 'status', class: flash_class(sticky: sticky, fixed: fixed), tabindex: '-1', data: { controller: 'autofocus' } }
- if value.class == Array
- value.each do |message|
= sanitize_with_link(message)
%br
- elsif value.present?
= sanitize_with_link(value)
- elsif flash_role(key) == 'alert'
.alert.alert-danger{ role: 'alert', class: flash_class(sticky: sticky, fixed: fixed), tabindex: '-1', data: { controller: 'autofocus' } }
- if value.class == Array
- value.each do |message|
= sanitize_with_link(message)
%br
- elsif value.present?
= sanitize_with_link(value)