Module: Refinery::Pages

Includes:
ActiveSupport::Configurable
Defined in:
pages/lib/refinery/pages.rb,
pages/lib/refinery/pages/tab.rb,
pages/lib/refinery/pages/type.rb,
pages/lib/refinery/pages/types.rb,
pages/lib/refinery/pages/engine.rb,
pages/lib/refinery/pages/configuration.rb,
pages/lib/refinery/pages/instance_methods.rb,
pages/lib/refinery/pages/content_presenter.rb,
pages/lib/refinery/pages/section_presenter.rb,
pages/spec/lib/pages/section_presenter_spec.rb,
pages/spec/lib/pages/content_presenter_spec.rb,
pages/lib/refinery/pages/admin/instance_methods.rb,
pages/lib/refinery/pages/content_page_presenter.rb,
pages/spec/lib/pages/content_page_presenter_spec.rb,
pages/lib/refinery/pages/title_section_presenter.rb,
pages/spec/lib/pages/title_section_presenter_spec.rb,
pages/lib/refinery/pages/page_part_section_presenter.rb,
pages/app/helpers/refinery/pages/content_pages_helper.rb,
pages/spec/lib/pages/page_part_section_presenter_spec.rb,
pages/spec/helpers/refinery/pages/content_pages_helper_spec.rb

Defined Under Namespace

Modules: Admin, ContentPagesHelper, InstanceMethods Classes: ContentPagePresenter, ContentPresenter, Engine, PagePartSectionPresenter, SectionPresenter, Tab, TitleSectionPresenter, Type, Types

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#tabsObject

Returns the value of attribute tabs



4
5
6
# File 'pages/lib/refinery/pages/tab.rb', line 4

def tabs
  @tabs
end

Class Method Details

.default_parts_for(page) ⇒ Object



38
39
40
41
42
# File 'pages/lib/refinery/pages.rb', line 38

def default_parts_for(page)
  return default_parts unless page.view_template.present?

  types.find_by_name(page.view_template).parts.map &:titleize
end

.factory_pathsObject



22
23
24
# File 'pages/lib/refinery/pages.rb', line 22

def factory_paths
  @factory_paths ||= [ root.join('spec', 'factories').to_s ]
end

.rootObject



18
19
20
# File 'pages/lib/refinery/pages.rb', line 18

def root
  @root ||= Pathname.new(File.expand_path('../../../', __FILE__))
end

.tabsObject



6
7
8
# File 'pages/lib/refinery/pages/tab.rb', line 6

def self.tabs
  @tabs ||= []
end

.valid_templates(*pattern) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
# File 'pages/lib/refinery/pages.rb', line 26

def valid_templates(*pattern)
  [Rails.root, Refinery::Plugins.registered.pathnames].flatten.uniq.map { |p|
    p.join(*pattern)
  }.map(&:to_s).map { |p|
    Dir[p]
  }.select(&:any?).flatten.map { |f|
    File.basename(f)
  }.map { |p|
    p.split('.').first
  }
end