Sha256: cf4dada7336e0ed3638a3d8409f3e1cd386d901dbb3e944a2245a8170521face

Contents?: true

Size: 1.41 KB

Versions: 89

Compression:

Stored size: 1.41 KB

Contents

module AmaLayoutContentHelper
  def greeting
    cookies["logged_in_meta"]
  end

  def utm_source
    Rails.configuration.site_name.downcase.gsub(/\W/, "")
  end

  def active_section(nav_item)
    paths = [nav_item.link]
    paths += nav_item.sub_nav.map(&:link)
    active_page(*paths)
  end

  def active_page(*path)
    "activepage" if path.include?(request.fullpath) || path.include?(request.url)
  end

  def active_domain(domain)
    "active" if request.url.include?(domain)
  end

  def renew_or_join_path(logged_in)
    return "" if logged_in
    link_to("Become a Member", "http://www.ama.ab.ca/membership/join-ama-online", target: "_blank")
  end

  def gift_or_pricing_path(logged_in)
    return "" if logged_in
    link_to("Gift Membership", "http://www.ama.ab.ca/membership-rewards/ama-gift-membership", target: "_blank")
  end

  def dropdown_menu(logged_in, greeting)
    return "" unless logged_in
    render partial: "ama_layout/dropdown_menu", locals: { logged_in: logged_in, greeting: greeting }
  end

  def tablet_menu(logged_in, greeting)
    return "" unless logged_in
    render partial: "ama_layout/tablet_menu", locals: { logged_in: logged_in, greeting: greeting }
  end

  def tablet_signout(logged_in)
    return "" unless logged_in
    render "ama_layout/tablet_signout"
  end

  def notice(notice)
    render "ama_layout/notice" if notice
  end

  def alert(alert)
    render "ama_layout/alert" if alert
  end
end

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
ama_layout-5.0.0 app/helpers/ama_layout_content_helper.rb
ama_layout-4.10.1 app/helpers/ama_layout_content_helper.rb
ama_layout-4.10.0 app/helpers/ama_layout_content_helper.rb
ama_layout-4.9.0 app/helpers/ama_layout_content_helper.rb
ama_layout-4.8.7 app/helpers/ama_layout_content_helper.rb
ama_layout-4.8.6 app/helpers/ama_layout_content_helper.rb
ama_layout-4.8.5 app/helpers/ama_layout_content_helper.rb
ama_layout-4.8.4 app/helpers/ama_layout_content_helper.rb
ama_layout-4.8.3 app/helpers/ama_layout_content_helper.rb
ama_layout-4.8.2 app/helpers/ama_layout_content_helper.rb
ama_layout-4.8.1 app/helpers/ama_layout_content_helper.rb
ama_layout-4.8.0 app/helpers/ama_layout_content_helper.rb
ama_layout-4.7.1 app/helpers/ama_layout_content_helper.rb
ama_layout-4.7.0 app/helpers/ama_layout_content_helper.rb
ama_layout-4.6.5 app/helpers/ama_layout_content_helper.rb
ama_layout-4.6.4 app/helpers/ama_layout_content_helper.rb
ama_layout-4.6.3 app/helpers/ama_layout_content_helper.rb
ama_layout-4.6.2 app/helpers/ama_layout_content_helper.rb
ama_layout-4.6.1 app/helpers/ama_layout_content_helper.rb
ama_layout-4.5.1 app/helpers/ama_layout_content_helper.rb