Module: Refinery::Pages
- Includes:
- ActiveSupport::Configurable
- Defined in:
- lib/refinery/pages.rb,
lib/refinery/pages/tab.rb,
lib/refinery/pages/url.rb,
lib/refinery/pages/type.rb,
lib/refinery/pages/types.rb,
lib/refinery/pages/engine.rb,
lib/refinery/pages/finder.rb,
lib/refinery/pages/configuration.rb,
lib/refinery/pages/render_options.rb,
lib/refinery/pages/instance_methods.rb,
lib/refinery/pages/admin/instance_methods.rb,
app/presenters/refinery/pages/menu_presenter.rb,
app/helpers/refinery/pages/content_pages_helper.rb,
app/presenters/refinery/pages/content_presenter.rb,
app/presenters/refinery/pages/section_presenter.rb,
app/presenters/refinery/pages/content_page_presenter.rb,
app/presenters/refinery/pages/title_section_presenter.rb,
app/controllers/refinery/pages/admin/preview_controller.rb,
app/presenters/refinery/pages/page_part_section_presenter.rb
Defined Under Namespace
Modules: Admin, ContentPagesHelper, InstanceMethods, RenderOptions
Classes: ContentPagePresenter, ContentPresenter, CustomScrubber, Engine, Finder, FinderByPath, FinderByPathOrId, FinderByScopedPath, FinderBySlug, FinderByTitle, FinderByUnscopedPath, MenuPresenter, PagePartSectionPresenter, SectionPresenter, Tab, TitleSectionPresenter, Type, Types, Url
Class Method Summary
collapse
Class Method Details
.default_parts_for(page) ⇒ Object
35
36
37
38
39
|
# File 'lib/refinery/pages.rb', line 35
def default_parts_for(page)
return default_parts unless page.view_template.present?
types.find_by_name(page.view_template).parts
end
|
.factory_paths ⇒ Object
23
24
25
|
# File 'lib/refinery/pages.rb', line 23
def factory_paths
@factory_paths ||= [ root.join('spec', 'factories').to_s ]
end
|
.layout_template_whitelist ⇒ Object
39
40
41
|
# File 'lib/refinery/pages/configuration.rb', line 39
def layout_template_whitelist
Array(config.layout_template_whitelist).map(&:to_s)
end
|
.root ⇒ Object
19
20
21
|
# File 'lib/refinery/pages.rb', line 19
def root
@root ||= Pathname.new(File.expand_path('../../../', __FILE__))
end
|
.tabs ⇒ Object
4
5
6
|
# File 'lib/refinery/pages/tab.rb', line 4
def self.tabs
@tabs ||= []
end
|
.tabs_for_template(template) ⇒ Object
8
9
10
11
12
13
14
|
# File 'lib/refinery/pages/tab.rb', line 8
def self.tabs_for_template(template)
return tabs unless template
tabs.select do |tab|
tab.templates.include?('all') || tab.templates.include?(template)
end
end
|
.valid_templates(*pattern) ⇒ Object
27
28
29
30
31
32
33
|
# File 'lib/refinery/pages.rb', line 27
def valid_templates(*pattern)
([Rails.root] | Refinery::Plugins.registered.pathnames).map { |p|
Dir[p.join(*pattern).to_s].flatten.map do |f|
File.basename(f).split('.').first
end
}.flatten.uniq
end
|
.whitelist_attributes ⇒ Object
35
36
37
|
# File 'lib/refinery/pages/configuration.rb', line 35
def whitelist_attributes
Loofah::HTML5::WhiteList::ALLOWED_ATTRIBUTES.merge(config.add_whitelist_attributes)
end
|
.whitelist_elements ⇒ Object
31
32
33
|
# File 'lib/refinery/pages/configuration.rb', line 31
def whitelist_elements
Loofah::HTML5::WhiteList::ALLOWED_ELEMENTS.merge(config.add_whitelist_elements)
end
|