Module: Admin::PagesHelper

Includes:
NodeHelper, ReferencesHelper
Defined in:
app/helpers/admin/pages_helper.rb

Instance Method Summary collapse

Instance Method Details

#class_of_pageObject



5
6
7
# File 'app/helpers/admin/pages_helper.rb', line 5

def class_of_page
  @page.class
end

#clean_page_description(page) ⇒ Object



22
23
24
# File 'app/helpers/admin/pages_helper.rb', line 22

def clean_page_description(page)
  page.description.to_s.strip.gsub(/\t/, '').gsub(/\s+/, ' ')
end

#filterObject



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

#meta_errors?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/helpers/admin/pages_helper.rb', line 13

def meta_errors?
  !!(@page.errors[:slug] or @page.errors[:breadcrumb])
end

#status_to_displayObject



17
18
19
20
# File 'app/helpers/admin/pages_helper.rb', line 17

def status_to_display
  @page.status_id = 100 if @page.status_id == 90
  @display_status = Status.selectable.map { |s| [I18n.translate(s.name.downcase), s.id] }
end