Sha256: 8f96ca6e2bc54ec49aec79461fdd9273596174bb0ff049a181724e073d25de92

Contents?: true

Size: 951 Bytes

Versions: 24

Compression:

Stored size: 951 Bytes

Contents

module MobileHelper
  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 content_tag(:li, link_to(title, link) + icon, :class => li_class)
  end

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

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

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
forge-cli-0.1.10 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.1.9 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.1.8 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.1.7 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.1.6 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.1.5 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.1.4 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.1.3 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.1.2 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.1.1 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.1.0 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.0.18 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.0.17 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.0.16 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.0.15 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.0.14 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.0.13 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.0.12 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.0.11 lib/forge/app/helpers/mobile_helper.rb
forge-cli-0.0.10 lib/forge/app/helpers/mobile_helper.rb