Sha256: f8e098135edd2677bc7e7778c210fa2c1f30a1d08a18784ed280d45d8b41c01b

Contents?: true

Size: 933 Bytes

Versions: 8

Compression:

Stored size: 933 Bytes

Contents

module Voluntary
  module Helpers
    module Layout
      def breadcrumbs
        result = render_navigation context: :main, renderer: :breadcrumbs_without_method_links, join_with: ' > '
        result && result.split('<a').length > 2 ? result : ''
      end
      
      def sidenav
        result = render_navigation context: :main, renderer: :twitter_sidenav, level: @twitter_sidenav_level
        result && result.split('<a').length > 2 ? result : ''
      end
      
      def footer_navigation
        links = []
        
        ['privacy-policy', 'terms-of-use', 'about-us'].each do |page_name|
          text = t("pages.#{page_name.gsub('-', '_')}.title")
          path = "#{controller_name}/#{params[:id]}"
          active = path == "#{controller_name}/#{page_name}"
          links << (active ? text : link_to(text, page_path(page_name)))
        end
        
        raw links.join(' | ')
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
voluntary-0.1.0 lib/voluntary/helpers/layout.rb
voluntary-0.1.0.rc4 lib/voluntary/helpers/layout.rb
voluntary-0.1.0.rc3 lib/voluntary/helpers/layout.rb
voluntary-0.1.0.rc2 lib/voluntary/helpers/layout.rb
voluntary-0.1.0.rc1 lib/voluntary/helpers/layout.rb
voluntary-0.0.3 lib/voluntary/helpers/layout.rb
voluntary-0.0.2 lib/voluntary/helpers/layout.rb
voluntary-0.0.1 lib/voluntary/helpers/layout.rb