Module: Admin::PagesHelper
Instance Method Summary
collapse
#_display_name, #filter_reference, #tag_reference
Methods included from NodeHelper
#expanded, #expanded_rows, #expander, #homepage, #icon, #node_title, #page_type, #prepare_page, #render_node, #render_nodes, #render_search_node, #show_all?, #spinner
Methods included from UrlHelper
#build_url, #default_route?, #extract_base_url, #format_path, #generate_page_url, #lookup_page_path
Instance Method Details
#class_of_page ⇒ Object
5
6
7
|
# File 'app/helpers/admin/pages_helper.rb', line 5
def class_of_page
@page.class
end
|
#clean_page_description(page) ⇒ Object
17
18
19
|
# File 'app/helpers/admin/pages_helper.rb', line 17
def clean_page_description(page)
page.description.to_s.strip.gsub(/\t/, '').gsub(/\s+/, ' ')
end
|
#filter ⇒ Object
9
10
11
|
# File 'app/helpers/admin/pages_helper.rb', line 9
def filter
@page.parts.first.filter if @page.parts.respond_to?(:any?) && @page.parts.any?
end
|
13
14
15
|
# File 'app/helpers/admin/pages_helper.rb', line 13
def meta_errors?
!!(@page.errors[:slug] or @page.errors[:breadcrumb])
end
|
#parent_page_options(current_site, page) ⇒ Object
21
22
23
24
25
26
27
|
# File 'app/helpers/admin/pages_helper.rb', line 21
def parent_page_options(current_site, page)
parent_pages = []
parent_pages.concat(Page.parent_pages(current_site.homepage_id))
parent_pages << page.parent if page.parent
selected_page_id = page.parent_id
options_for_select(parent_pages.map { |p| [p.title, p.id] }, selected_page_id)
end
|
#revert_confirmation_message(version) ⇒ Object
29
30
31
32
33
|
# File 'app/helpers/admin/pages_helper.rb', line 29
def revert_confirmation_message(version)
date = version[:update_date]
time = version[:update_time]
"Are you sure you want to revert the page to the version before the change made on #{date} at #{time}? All changes made after that will be lost."
end
|