Module: MobileHelper

Defined in:
lib/forge/app/helpers/mobile_helper.rb

Instance Method Summary collapse

Instance Method Details

#mobile_colorObject



17
18
19
# File 'lib/forge/app/helpers/mobile_helper.rb', line 17

def mobile_color
  MySettings.mobile_color.blank? ? "#ee3124" : MySettings.mobile_color
end

#mobile_logoObject



13
14
15
# File 'lib/forge/app/helpers/mobile_helper.rb', line 13

def 
  MySettings.logo_url.blank? ? MySettings.site_title : image_tag(MySettings.logo_url)
end

#mobile_menu_item(title, link, options = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
11
# File 'lib/forge/app/helpers/mobile_helper.rb', line 2

def mobile_menu_item(title, link, options = {})
  li_class = ""
  #set the link class to active if it matches the current link or any of the alternate supplied links
  options[:alt_links].each { |a| li_class = request.fullpath.match(a) ? "active" : "" unless li_class == "active" } if options[:alt_links].is_a?(Array)
  li_class = "active" if link == request.fullpath
  li_class += " #{options[:icon]}" unless options[:icon].blank?
  li_class += " #{options[:class]}" unless options[:class].blank?
  icon = image_tag(options[:icon].blank? ? "mobile/arrow-nav.png" : "mobile/#{options[:icon]}.png", :class => "icon")
  return (:li, link_to(title, link) + icon, :class => li_class)
end