notification_helper.rb 511 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module NotificationHelper
  def notification_warning_bubble(text)
    tag.div(class: 'alert alert-warning alert-dismissible', role: 'alert') do
      concat notification_close_button
      concat text
    end
  end

  def notification_close_button(text = nil)
    tag.button(
      class: 'close', aria: { label: 'Schliessen' }, data: { dismiss: 'alert' }, type: 'button'
    ) do
      if text.present?
        concat text
      else
16
        tag.span('x', aria: { hidden: 'true' })
17
18
19
20
      end
    end
  end
end