summaryrefslogtreecommitdiff
path: root/app/views/layouts/_flash.html.haml
blob: 07c271be2f01dd97c91d58d7e769e8bd3241db6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
-# We currently only support `alert`, `notice`, `success`, 'toast'
- icons = {'alert' => 'error', 'notice' => 'information-o', 'success' => 'check-circle'};
.flash-container.flash-container-page.sticky
  - flash.each do |key, value|
    - if key == 'toast' && value
      .js-toast-message{ data: { message: value } }
    - elsif value
      %div{ class: "flash-#{key} mb-2" }
        = sprite_icon(icons[key], size: 16, css_class: 'align-middle mr-1') unless icons[key].nil?
        %span= value
        %div{ class: "close-icon-wrapper js-close-icon" }
          = sprite_icon('close', size: 16, css_class: 'close-icon')