Sha256: 90c71074822d73a22571a0e714b8f8510124a22cb07ad3bfc79c96a886307d12

Contents?: true

Size: 1004 Bytes

Versions: 10

Compression:

Stored size: 1004 Bytes

Contents

module Admin::BaseHelper

  def title(page_title)
    content_for(:title) { page_title }
  end

  def header
    locals = { :admin_title => admin_title }
    render "helpers/admin/base/header", locals
  end

  def admin_title
    setting = defined?(Admin::Setting) && Admin::Setting.admin_title
    setting || Typus.admin_title
  end

  def has_root_path?
    Rails.application.routes.routes.map(&:name).include?("root")
  end

  def apps
    render "helpers/admin/base/apps"
  end

  def login_info
    render "helpers/admin/base/login_info" unless admin_user.is_a?(FakeUser)
  end

  def admin_sign_out_path
    case Typus.authentication
    when :devise
      send("destroy_#{Typus.user_class_name.underscore}_session_path")
    else
      destroy_admin_session_path
    end
  end

  def display_flash_message(message = flash)
    if message.keys.any?
      locals = { :flash_type => message.keys.first, :message => message }
      render "helpers/admin/base/flash_message", locals
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
typus-3.1.8 app/helpers/admin/base_helper.rb
typus-3.1.7 app/helpers/admin/base_helper.rb
typus-3.1.6 app/helpers/admin/base_helper.rb
typus-3.1.5 app/helpers/admin/base_helper.rb
typus-3.1.4 app/helpers/admin/base_helper.rb
typus-3.1.3 app/helpers/admin/base_helper.rb
typus-3.1.2 app/helpers/admin/base_helper.rb
typus-3.1.1 app/helpers/admin/base_helper.rb
typus-3.1.0 app/helpers/admin/base_helper.rb
typus-3.1.0.rc19 app/helpers/admin/base_helper.rb