Module: ThemeHelper

Defined in:
app/helpers/theme_helper.rb

Instance Method Summary collapse

Instance Method Details

#content_item_headerObject



18
19
20
# File 'app/helpers/theme_helper.rb', line 18

def content_item_header
  render partial: 'woople-theme/content_item_header'
end

#content_items(items, presenter = nil) ⇒ Object



8
9
10
11
# File 'app/helpers/theme_helper.rb', line 8

def content_items(items, presenter = nil)
  collection = ThemePresentation.wrap_collection(items, ContentItemPresenter, presenter)
  render partial: 'woople-theme/content_item', collection: collection
end


32
33
34
35
# File 'app/helpers/theme_helper.rb', line 32

def menu
  model = ThemePresentation.wrap(send(WoopleTheme.configuration.menu_helper), MenuPresenter)
  render 'woople-theme/menu', menu: model
end

#outline(items, presenter = nil) ⇒ Object



22
23
24
25
# File 'app/helpers/theme_helper.rb', line 22

def outline(items, presenter = nil)
  collection = ThemePresentation.wrap_collection(items, OutlinePresenter, presenter)
  render partial: 'woople-theme/outline', collection: collection
end

#page_header(data, presenter = nil) ⇒ Object

This allows you to generate a page-header component



3
4
5
6
# File 'app/helpers/theme_helper.rb', line 3

def page_header(data, presenter = nil)
  data = ThemePresentation.wrap(data, PageHeaderPresenter, presenter)
  render 'woople-theme/page_header', header: data
end

#profileObject



27
28
29
30
# File 'app/helpers/theme_helper.rb', line 27

def profile
  model = ThemePresentation.wrap(send(WoopleTheme.configuration.profile_helper), ProfilePresenter)
  render 'woople-theme/profile', profile: model
end

#video_modal(video, presenter = nil) ⇒ Object



13
14
15
16
# File 'app/helpers/theme_helper.rb', line 13

def video_modal(video, presenter = nil)
  video = ThemePresentation.wrap(video, presenter)
  render 'woople-theme/video_modal', video: video
end