Module: PufferPagesHelper

Defined in:
app/helpers/puffer_pages_helper.rb

Instance Method Summary collapse

Instance Method Details

#application_layoutsObject



7
8
9
# File 'app/helpers/puffer_pages_helper.rb', line 7

def application_layouts
  Dir.glob("#{view_paths.first}/layouts/[^_]*").flatten.map {|path| File.basename(path).gsub(/\..*$/, '')}.uniq
end

#inherited_layoutObject



15
16
17
# File 'app/helpers/puffer_pages_helper.rb', line 15

def inherited_layout
  record.inherited_layout_name && !record.root? ? [[t('puffer_pages.inherited_layout', :name => record.inherited_layout_name), '']] : []
end

#possible_layoutsObject



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

def possible_layouts
  inherited_layout + (application_layouts + puffer_layouts).uniq.sort
end

#possible_statusesObject



19
20
21
# File 'app/helpers/puffer_pages_helper.rb', line 19

def possible_statuses
  Page.statuses
end

#puffer_layoutsObject



11
12
13
# File 'app/helpers/puffer_pages_helper.rb', line 11

def puffer_layouts
  Layout.order(:name).all.map(&:name)
end

#tree_pageObject



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

def tree_page
  render :partial => 'tree_page', :object => record
end