<commit_before>module JJane
  module Helpers
    module LayoutHelper

      # put this into your _title_ tag:
      #   <title><%= site_title %></title>
      def site_title
	@page.title if controller_name=='site'
      end

      # Показывает напоминания типа: "вы успешно авторизировались"
      def notice
	partial 'shared/notice' if flash
      end

      # alias for stylesheet_link_tag
      def stylesheet(*args)
	stylesheet_link_tag(*args.map(&:to_s))
      end

      # alias for javascript_include_tag
      def javascript(*args)
	args = args.map { |arg| arg == :defaults ? arg : arg.to_s }
	javascript_include_tag(*args)
      end

      # defualt engine head(css's javascripts and other tags)
      def engine_head
	partial 'shared/engine_head'
      end

      def hide_me_if(something)
	yield unless something
      end

      # put thin in place where you want admin panel appear
      def admin_panel
	partial 'shared/administrator_panel' if logged_in?('roots')
      end

      #--
      #подумать_нужно ли он сдесь_start
      def login_form#:nodoc:
	partial 'shared/login_form' unless logged_in?
      end

      def nodes_from(page, count=5)#:nodoc:
	nodes = Page.find_by_link(page.to_s).nodes.find(:all, :limit => count, :order => "created_at DESC")
	partial 'shared/news', :nodes => nodes
      rescue
        %Q(no such page '#{page.to_s}')
      end
      #поддумать_нужно ли он сдесь__end
      #++

      # writes snippet content to page
      #   snippet('name_of_snippet')
      # options:
      # * :compile - if true content of snippet will be compiled like ERB template
      def snippet(name='',args={})
	defaults = { :compile => false }
	args = defaults.merge(args)
	content = Snippet.find_by_name(name).content
	content = render(:inline => content) if args[:compile]
	return content
      rescue
	%(<p style='color:red;'>snippet not found</p>)
      end

    end
  end
end
<commit_msg>removed unneeded methods from layout_helper<commit_after>module JJane
  module Helpers
    module LayoutHelper

      # put this into your _title_ tag:
      #   <title><%= site_title %></title>
      def site_title
	@page.title if controller_name=='site'
      end

      # Показывает напоминания типа: "вы успешно авторизировались"
      def notice
	partial 'shared/notice' if flash
      end

      # alias for stylesheet_link_tag
      def stylesheet(*args)
	stylesheet_link_tag(*args.map(&:to_s))
      end

      # alias for javascript_include_tag
      def javascript(*args)
	args = args.map { |arg| arg == :defaults ? arg : arg.to_s }
	javascript_include_tag(*args)
      end

      # defualt engine head(css's javascripts and other tags)
      def engine_head
	partial 'shared/engine_head'
      end

      def hide_me_if(something)
	yield unless something
      end

      # put thin in place where you want admin panel appear
      def admin_panel
	partial 'shared/administrator_panel' if logged_in?('roots')
      end

      # writes snippet content to page
      #   snippet('name_of_snippet')
      # options:
      # * :compile - if true content of snippet will be compiled like ERB template
      def snippet(name='',args={})
	defaults = { :compile => false }
	args = defaults.merge(args)
	content = Snippet.find_by_name(name).content
	content = render(:inline => content) if args[:compile]
	return content
      rescue
	%(<p style='color:red;'>snippet not found</p>)
      end

    end
  end
end

{'fraction_non_alphanumeric': 0.09615384615384616, 'fraction_numerical': 0.0002913752913752914, 'mean_word_length': 2.8834841628959276, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 20, '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': '4804117', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1095, 'n_words': 307}