<commit_before>module Honcho
  module ApplicationHelper

    def browser_title
      Honcho.configuration[:browser_title] || 'Honcho'
    end

    # Dashboard Title can be configured in config/honcho.rb
  	def application_title
  		Honcho.configuration[:title] || "Honcho"
  	end	

    # Resources, you want to manage unde admin panel, 
    # can be configured in config/honcho.rb
    def nav_bar_options
      options = []
      models = Honcho.configuration[:admin_models]
      unless models.empty?
        # content_tag(:ul, class: "right") do
        #   content_tag(:li, class: "divider")
          models.each do |h|
            # Check if nested resources
            # if h.is_a?(Hash)            
            #   content_tag(:li) do
            #     link_to "#{h.to_s.capitalize}"
            #   end             
            options << h.to_s.capitalize
            # content_tag(:li, class: "divider")
            #end          
          end
        #end  
      end 
      options
    end

    # Main content  
  	def main_content
  		yield
  	end

    # Side Bar
  	def side_bar
  		yield :sidebar
  	end

    def resource_name
      params[:controller].split("/").last.capitalize
    end 

    def resource_url(action, resource)
      honcho.send("#{action}_#{singularize_resource}_path", resource)
    end

    def singularize_resource
      resource_name.singularize.downcase
    end

  end
end<commit_msg>comments added to honcho/view helper methods<commit_after>module Honcho
  module ApplicationHelper

    # get browser title for the Honcho Dashboard
    def browser_title
      Honcho.configuration[:browser_title] || 'Honcho'
    end

    # Dashboard Title can be configured in config/honcho.rb
  	def application_title
  		Honcho.configuration[:title] || "Honcho"
  	end	

    # Resources, you want to manage under admin panel,
    # can be configured in config/honcho.rb
    def nav_bar_options
      options = []
      models = Honcho.configuration[:admin_models]
      unless models.empty?
        # content_tag(:ul, class: "right") do
        #   content_tag(:li, class: "divider")
          models.each do |h|
            # Check if nested resources
            # if h.is_a?(Hash)            
            #   content_tag(:li) do
            #     link_to "#{h.to_s.capitalize}"
            #   end             
            options << h.to_s.capitalize
            # content_tag(:li, class: "divider")
            #end          
          end
        #end  
      end 
      options
    end

    # Main content  
  	def main_content
  		yield
  	end

    # Side Bar
  	def side_bar
  		yield :sidebar
  	end

    # get resource name from string like 'honcho/posts' => Posts
    def resource_name
      params[:controller].split("/").last.capitalize
    end 

    # create a path for a given resource and action
    def resource_url(action, resource)
      honcho.send("#{action}_#{singularize_resource}_path", resource)
    end

    # singularize and lowercase the resultant of method: resource_name
    def singularize_resource
      resource_name.singularize.downcase
    end

  end
end
{'fraction_non_alphanumeric': 0.08114175753688262, 'fraction_numerical': 0.0, 'mean_word_length': 1.993282149712092, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6706235', 'n_tokens_mistral': 942, 'n_tokens_neox': 899, 'n_words': 240}