Sha256: 706372254e82629c0b34432274d48d358aa6fb9a3e09bd0d09ee13b578151c7f

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

module Admin::ReferencesHelper
  def tag_reference
    returning String.new do |output|
      class_of_page.tag_descriptions.sort.each do |tag_name, description|
        output << render(:partial => "admin/references/tag_reference", 
            :locals => {:tag_name => tag_name, :description => description})
      end
    end
  end
  
  def filter_reference
    unless filter.blank?
      if filter.description.blank? 
        "There is no documentation on this filter." 
      else
        filter.description
      end
    else
      "There is no filter on the current page part."
    end
  end
  
  def _display_name
    case params[:id]
    when 'filters'
      filter ? filter.filter_name : '<none>'
    when 'tags'
      class_of_page.display_name
    end
  end
  
  def filter
    @filter ||= begin
      filter_name = params[:filter_name]
      (filter_name.gsub(" ", "") + "Filter").constantize unless filter_name.blank?
    end
  end

  def class_of_page
    @page_class ||= (params[:class_name] || 'Page').constantize
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
radiant-0.7.0 app/helpers/admin/references_helper.rb