Sha256: 2f6160f28938b9799a4a83b32de444f5a40c25372b22bae3b21d050eedff433c

Contents?: true

Size: 718 Bytes

Versions: 25

Compression:

Stored size: 718 Bytes

Contents

module LayoutsHelper
  def current_header_icon_class type
    current_header_icon?(type) ? 'active' : ''
  end

  def current_header_icon? type
    controllers =
      case type
      when :home
        'home'
      when :contacts
        'contacts'
      when :events
        'events'
      when :resources
        'repositories'
      when :messages
        [ 'messages', 'conversations' ]
      end

    Array.wrap(controllers).include? controller.controller_name
  end

  # Sets "out" class to header_signed_out in frontpage and devise's controllers
  # and "in" class in the rest of the application
  def header_logo_class
    controller.controller_path =~ /frontpage|devise/ ?
      'out' :
      'in'
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
social_stream-2.2.2 base/app/helpers/layouts_helper.rb
social_stream-base-2.2.2 app/helpers/layouts_helper.rb
social_stream-2.2.1 base/app/helpers/layouts_helper.rb
social_stream-base-2.2.1 app/helpers/layouts_helper.rb
social_stream-2.2.0 base/app/helpers/layouts_helper.rb
social_stream-base-2.2.0 app/helpers/layouts_helper.rb
social_stream-2.1.1 base/app/helpers/layouts_helper.rb
social_stream-2.1.0 base/app/helpers/layouts_helper.rb
social_stream-base-2.1.0 app/helpers/layouts_helper.rb
social_stream-2.0.4 base/app/helpers/layouts_helper.rb
social_stream-base-2.0.4 app/helpers/layouts_helper.rb
social_stream-2.0.3 base/app/helpers/layouts_helper.rb
social_stream-base-2.0.3 app/helpers/layouts_helper.rb
social_stream-2.0.2 base/app/helpers/layouts_helper.rb
social_stream-base-2.0.2 app/helpers/layouts_helper.rb
social_stream-2.0.1 base/app/helpers/layouts_helper.rb
social_stream-base-2.0.1 app/helpers/layouts_helper.rb
social_stream-2.0.0 base/app/helpers/layouts_helper.rb
social_stream-base-2.0.0 app/helpers/layouts_helper.rb
social_stream-2.0.0.beta3 base/app/helpers/layouts_helper.rb