Sha256: 4b80f09ac64b4a9de6c554ecc98f0325671f4d2c7f5f068679230158b49fe3da

Contents?: true

Size: 1.6 KB

Versions: 34

Compression:

Stored size: 1.6 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 partial: "ama_layout/notice", locals: { message: notice } if notice
  end

  def alert(alert)
    render partial: "ama_layout/alert", locals: { message: alert } if alert
  end

  def success_message(success)
    render partial: "ama_layout/success", locals: { message: success } if success
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
ama_layout-5.11.0 app/helpers/ama_layout_content_helper.rb
ama_layout-6.10.0.pre app/helpers/ama_layout_content_helper.rb
ama_layout-5.10.0 app/helpers/ama_layout_content_helper.rb
ama_layout-5.9.0 app/helpers/ama_layout_content_helper.rb
ama_layout-5.8.0 app/helpers/ama_layout_content_helper.rb
ama_layout-5.7.0 app/helpers/ama_layout_content_helper.rb
ama_layout-5.6.0 app/helpers/ama_layout_content_helper.rb
ama_layout-5.5.0 app/helpers/ama_layout_content_helper.rb
ama_layout-5.4.0 app/helpers/ama_layout_content_helper.rb
ama_layout-6.3.0.pre app/helpers/ama_layout_content_helper.rb
ama_layout-5.2.0 app/helpers/ama_layout_content_helper.rb
ama_layout-5.1.1 app/helpers/ama_layout_content_helper.rb
ama_layout-5.1.0 app/helpers/ama_layout_content_helper.rb
ama_layout-5.0.2 app/helpers/ama_layout_content_helper.rb