Module: Pageflow::InfoBoxHelper

Defined in:
app/helpers/pageflow/info_box_helper.rb

Instance Method Summary collapse

Instance Method Details

#info_box(configuration) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/helpers/pageflow/info_box_helper.rb', line 3

def info_box(configuration)
  css_classes = ['add_info_box']

  if configuration['additional_title'].blank? &&
     configuration['additional_description'].blank?

    css_classes << 'empty'
  end

  if configuration['additional_title'].blank?
    css_classes << 'title_empty'
  end

  if configuration['additional_description'].blank?
    css_classes << 'description_empty'
  end

  render('pageflow/pages/info_box',
         configuration: configuration,
         css_class: css_classes * ' ')
end

#info_box_title(title) ⇒ Object



25
26
27
28
29
# File 'app/helpers/pageflow/info_box_helper.rb', line 25

def info_box_title(title)
  if title.present?
    (:h3, title)
  end
end