Sha256: 3c6399814f37cff6956eb9b38ae7460963fa95424fcf8a75f769ee250f4f4380

Contents?: true

Size: 954 Bytes

Versions: 51

Compression:

Stored size: 954 Bytes

Contents

module Noodall::Admin::BaseHelper
  include Noodall::LayoutHelper
  include SortableTable::App::Helpers::ApplicationHelper

  def admin_page_title
    @page_title ||= controller.controller_name.titleize +
      (controller.action_name == 'index' ? ' ' : " | #{controller.action_name.titleize}" ) +
      " | #{Noodall::UI.app_name}"
  end

  def admin_menu_items
    Noodall::UI.menu_items.map do |title, link|
      content_tag :li, link_to( title, send(link) )
    end.join.html_safe
  end

  # Monkey-patch for the thoughtbot/sortabletable headers, adding 'colspan' option
  def sortable_table_header(opts = {})
    raise ArgumentError if opts[:name].nil? || opts[:sort].nil?
    anchor = opts[:anchor].blank? ? "" : "##{opts[:anchor]}"
    content_tag :th,
      link_to(opts[:name],
        sortable_url(opts) + anchor,
        :title => opts[:title]),
      :class => sortable_table_header_classes(opts),
      :colspan => opts[:colspan]
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
noodall-ui-0.5.15 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.14 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.13 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.12 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.11 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.4.11 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.4.10 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.10 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.9 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.4.9 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.8 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.4.8 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.4.7 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.7 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.6 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.5 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.4 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.3 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.2 app/helpers/noodall/admin/base_helper.rb
noodall-ui-0.5.1 app/helpers/noodall/admin/base_helper.rb