<commit_before>module ApplicationHelper

  def body_template
    return @body_template if @body_template
    resource_action = %w(new create edit update show).include?(action_name)
    if resource_action || controller_name == "activities"
      :body_resource
    else
      :body_collection
    end
  end

  def filter_form(filtered_param = nil, *args, &block)
    filter_params = params.merge(:page => nil, :controller => nil, :action => nil, :utf8 => nil, filtered_param => nil)
    render :layout => "shared/index/filter_form", :locals => {:filter_params => filter_params}, &block
  end

  def html_title
    domain_title = current_domain.presence.try(:title).to_s
    generic_title = if @page_header.present?
      inline_user_text @page_header
    elsif defined?(resource) && !resource_is_context_resource? && resource.respond_to?(:title) && !resource.new_record?
      inline_user_text resource.title
    else
      t("#{controller_name}.#{action_name}.page_header")
    end
    if generic_title.present?
      "#{generic_title} - #{domain_title}"
    else
      domain_title
    end
  end
<commit_msg>Fix ApplicationHelper#html_title: Omit domain_title if not present<commit_after>module ApplicationHelper

  def body_template
    return @body_template if @body_template
    resource_action = %w(new create edit update show).include?(action_name)
    if resource_action || controller_name == "activities"
      :body_resource
    else
      :body_collection
    end
  end

  def filter_form(filtered_param = nil, *args, &block)
    filter_params = params.merge(:page => nil, :controller => nil, :action => nil, :utf8 => nil, filtered_param => nil)
    render :layout => "shared/index/filter_form", :locals => {:filter_params => filter_params}, &block
  end

  def html_title
    domain_title = current_domain.presence.try(:title).to_s
    generic_title = if @page_header.present?
      inline_user_text @page_header
    elsif defined?(resource) && !resource_is_context_resource? && resource.respond_to?(:title) && !resource.new_record?
      inline_user_text resource.title
    else
      t("#{controller_name}.#{action_name}.page_header")
    end
    if generic_title.present?
      if domain_title.present?
        "#{generic_title} - #{domain_title}"
      else
        generic_title
      end
    else
      domain_title
    end
  end

{'fraction_non_alphanumeric': 0.10651896037494674, 'fraction_numerical': 0.0008521516829995739, 'mean_word_length': 3.7820773930753564, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '5916145', 'n_tokens_mistral': 712, 'n_tokens_neox': 709, 'n_words': 159}