Class: Krant::Views::HeaderWithBroadcastMessages

Inherits:
Arbre::Component
  • Object
show all
Defined in:
lib/krant/views/header_with_broadcast_messages.rb

Overview

Extends the normal Active Admin header to include broadcast messages.

Instance Method Summary collapse

Instance Method Details

#build(*args) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/krant/views/header_with_broadcast_messages.rb', line 8

def build(*args)
  insert_tag(ActiveAdmin::Views::Header, *args)
  div do
    TranslatedBroadcastMessage.active.each do |broadcast_message|
      div class: 'krant-broadcast-messages-bar' do
        Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true)
          .render(broadcast_message.text)
          .html_safe
      end
    end
  end
end