debian-mirror-gitlab/app/views/layouts/_flash.html.haml

19 lines
1 KiB
Text
Raw Normal View History

2022-01-26 12:08:38 +05:30
-# We currently only support `alert`, `notice`, `success`, 'toast', and 'raw'
2021-04-29 21:17:54 +05:30
- icons = {'alert' => 'error', 'notice' => 'information-o', 'success' => 'check-circle'}
2022-04-04 11:22:00 +05:30
- type_to_variant = {'alert' => 'danger', 'notice' => 'info', 'success' => 'success'}
2021-01-29 00:20:46 +05:30
.flash-container.flash-container-page.sticky{ data: { qa_selector: 'flash_container' } }
2018-03-17 18:26:18 +05:30
- flash.each do |key, value|
2020-01-01 13:55:28 +05:30
- if key == 'toast' && value
.js-toast-message{ data: { message: value } }
2022-01-26 12:08:38 +05:30
- elsif key == 'raw' && value
= value
2021-09-30 23:02:18 +05:30
- elsif value == I18n.t('devise.failure.unconfirmed')
= render 'shared/confirm_your_email_alert'
2020-01-01 13:55:28 +05:30
- elsif value
2022-04-04 11:22:00 +05:30
%div{ class: "flash-#{key} mb-2", data: { testid: "alert-#{type_to_variant[key]}" } }
2020-10-24 23:57:45 +05:30
= sprite_icon(icons[key], css_class: 'align-middle mr-1') unless icons[key].nil?
2019-12-04 20:38:33 +05:30
%span= value
2020-10-24 23:57:45 +05:30
- if %w(alert notice success).include?(key)
%div{ class: "close-icon-wrapper js-close-icon" }
2020-11-24 15:15:51 +05:30
= sprite_icon('close', css_class: 'close-icon gl-vertical-align-baseline!')