<commit_before>module LogoHelper
  def logo_classes(options = {})
    logo_class = ['organisation-logo']
    logo_class << 'stacked' if options[:stacked]
    if options[:use_identity] == false
      logo_class << 'no-identity'
    else
      class_name = options[:class_name] || options.fetch(:organisation).organisation_logo_type.class_name
      logo_class << class_name
    end
    logo_class = logo_class.join('-')

    classes = ['organisation-logo']
    classes << logo_class
    classes << "#{logo_class}-#{options[:size]}" if options[:size]
    classes.join(" ")
  end

  def organisation_logo(organisation, options = {})
    logo = if organisation.logo?
      image_tag(organisation.logo.url, alt: organisation.name, class: 'organisation-logo-custom')
    else
      organisation_logo_name(organisation)
    end
    linked_logo = link_to_if(options[:linked], logo, organisation_path(organisation))
    if organisation.logo?
      linked_logo
    else
      css_classes = logo_classes(organisation: organisation, size: options[:size], stacked: true)
      content_tag(:span, class: css_classes) { linked_logo }<commit_msg>Don't rely on file presence check on frontend code<commit_after>module LogoHelper
  def logo_classes(options = {})
    logo_class = ['organisation-logo']
    logo_class << 'stacked' if options[:stacked]
    if options[:use_identity] == false
      logo_class << 'no-identity'
    else
      class_name = options[:class_name] || options.fetch(:organisation).organisation_logo_type.class_name
      logo_class << class_name
    end
    logo_class = logo_class.join('-')

    classes = ['organisation-logo']
    classes << logo_class
    classes << "#{logo_class}-#{options[:size]}" if options[:size]
    classes.join(" ")
  end

  def organisation_logo(organisation, options = {})
    logo = if organisation.custom_logo_selected?
      image_tag(organisation.logo.url, alt: organisation.name, class: 'organisation-logo-custom')
    else
      organisation_logo_name(organisation)
    end
    linked_logo = link_to_if(options[:linked], logo, organisation_path(organisation))
    if organisation.custom_logo_selected?
      linked_logo
    else
      css_classes = logo_classes(organisation: organisation, size: options[:size], stacked: true)
      content_tag(:span, class: css_classes) { linked_logo }
{'fraction_non_alphanumeric': 0.11721768999570631, 'fraction_numerical': 0.0, 'mean_word_length': 4.098468271334792, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 3, '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': '6687620', 'n_tokens_mistral': 688, 'n_tokens_neox': 688, 'n_words': 142}