Sha256: e52697781cc9bd1cf3cb5a7a72a1251fffbd4287f11c87fd654936905224ea50

Contents?: true

Size: 633 Bytes

Versions: 11

Compression:

Stored size: 633 Bytes

Contents

module PufferPagesHelper

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

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

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

  def inherited_layout
    record.inherited_layout_name ? [[t('puffer.inherited_layout', :name => record.inherited_layout_name), '']] : []
  end

  def possible_statuses
    Page.statuses
  end

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

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
puffer_pages-0.0.13 app/helpers/puffer_pages_helper.rb
puffer_pages-0.0.12 app/helpers/puffer_pages_helper.rb
puffer_pages-0.0.11 app/helpers/puffer_pages_helper.rb
puffer_pages-0.0.10 app/helpers/puffer_pages_helper.rb
puffer_pages-0.0.9 app/helpers/puffer_pages_helper.rb
puffer_pages-0.0.8 app/helpers/puffer_pages_helper.rb
puffer_pages-0.0.7 app/helpers/puffer_pages_helper.rb
puffer_pages-0.0.6 app/helpers/puffer_pages_helper.rb
puffer_pages-0.0.5 app/helpers/puffer_pages_helper.rb
puffer_pages-0.0.4 app/helpers/puffer_pages_helper.rb
puffer_pages-0.0.3 app/helpers/puffer_pages_helper.rb