module Enjoy::Pages::Models::Page
Public Instance Methods
clean_regexp()
click to toggle source
# File lib/enjoy/pages/models/page.rb, line 80 def clean_regexp if regexp.blank? /^#{regexp_prefix}#{Regexp.escape(fullpath)}$/ else begin /#{regexp}/ rescue # not a valid regexp - treat as literal search string /#{Regexp.escape(regexp)}/ end end end
get_fullpath()
click to toggle source
# File lib/enjoy/pages/models/page.rb, line 45 def get_fullpath redirect.blank? ? fullpath : redirect end
has_content?()
click to toggle source
# File lib/enjoy/pages/models/page.rb, line 49 def has_content? @content_used.nil? && !content.blank? end
is_current?(url)
click to toggle source
# File lib/enjoy/pages/models/page.rb, line 68 def is_current?(url) if fullpath == '/' url == '/' else url.match(clean_regexp) end end
page_content()
click to toggle source
# File lib/enjoy/pages/models/page.rb, line 53 def page_content if @content_used.nil? @content_used = true if content.nil? '' else content.gsub(/\{\{(.*?)\}\}/) do Settings ? Settings.get($1).val : "" #temp end end else '' end end
page_h1()
click to toggle source
# File lib/enjoy/pages/models/page.rb, line 38 def page_h1 _ret = seo ? seo.h1 : nil _ret = name if _ret.blank? _ret = title if _ret.blank? _ret end
regexp_prefix()
click to toggle source
# File lib/enjoy/pages/models/page.rb, line 76 def regexp_prefix Enjoy::Pages.config.localize ? "(?:#{I18n.available_locales.map { |l| "\\/#{l}"}.join("|")})?" : "" end