Sha256: 5dde8a3e8e8d4fa9aa6f8d19eec550df02922e6f3c52792cc2f38b4c0f9f518e

Contents?: true

Size: 1.57 KB

Versions: 32

Compression:

Stored size: 1.57 KB

Contents

module Lentil
  module ApplicationHelper
    def application_name
      Lentil::Engine::APP_CONFIG["application_name"] || 'My #HuntLibrary'
    end

    def division_name
      Lentil::Engine::APP_CONFIG["division_name"] || 'Division Name'
    end

    def division_url
      Lentil::Engine::APP_CONFIG["division_url"] || 'Division URL'
    end

    def organization_name
      Lentil::Engine::APP_CONFIG["organization_name"] || 'Organization Name'
    end

    def contact_email
      Lentil::Engine::APP_CONFIG["contact_email"] || 'admin@example.com'
    end

    def feed_description
      Lentil::Engine::APP_CONFIG["feed_description"] || 'Description of this feed'
    end

    def title(page_title = nil)
      page_title ||= ''
      page_title << ' - ' unless page_title.empty?
      page_title << application_name unless application_name.empty?
      page_title << " - #{division_name}" unless division_name.empty?
      page_title << " - #{organization_name}" unless organization_name.empty?

      content_for :title, page_title
    end

    def body_class
      "#{params[:controller].parameterize}_#{params[:action]}"
    end

    def nav_link(link_text, link_path)
      class_name = current_page?(link_path) ? 'active' : nil

      content_tag(:li, :class => class_name) do
        link_to link_text, link_path
      end
    end

    def meta_description_tag
      tag('meta', :name => 'description', :content => Lentil::Engine::APP_CONFIG["meta_description"] || '')
    end

    def google_analytics_tracker
      Lentil::Engine::APP_CONFIG["google_analytics_tracker"]
    end

  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
lentil-1.0.5 app/helpers/lentil/application_helper.rb
lentil-1.0.4 app/helpers/lentil/application_helper.rb
lentil-1.0.3 app/helpers/lentil/application_helper.rb
lentil-1.0.2 app/helpers/lentil/application_helper.rb
lentil-1.0.1 app/helpers/lentil/application_helper.rb
lentil-1.0.0 app/helpers/lentil/application_helper.rb
lentil-0.9.1 app/helpers/lentil/application_helper.rb
lentil-0.9.0 app/helpers/lentil/application_helper.rb
lentil-0.8.0 app/helpers/lentil/application_helper.rb
lentil-0.7.1 app/helpers/lentil/application_helper.rb
lentil-0.6.0 app/helpers/lentil/application_helper.rb
lentil-0.5.2 app/helpers/lentil/application_helper.rb
lentil-0.5.1 app/helpers/lentil/application_helper.rb
lentil-0.5.0 app/helpers/lentil/application_helper.rb
lentil-0.4.2 app/helpers/lentil/application_helper.rb
lentil-0.4.0 app/helpers/lentil/application_helper.rb
lentil-0.3.1 app/helpers/lentil/application_helper.rb
lentil-0.3.0 app/helpers/lentil/application_helper.rb
lentil-0.2.3 app/helpers/lentil/application_helper.rb
lentil-0.2.2 app/helpers/lentil/application_helper.rb