<commit_before># frozen_string_literal: true

class Folio::Console::Index::ImagesCell < Folio::ConsoleCell
  include Folio::CellLightbox

  class_name 'f-c-index-images', :cover, :gallery

  def id_class_name
    # needed for separate lightboxes
    "f-c-index-images--id-#{model.class.table_name}-#{model.id}"
  end

  def show
    if options[:cover]
      render
    else
      render if model.images.present?
    end
  end

  def image(placement)
    image_from(placement,
               Folio::Console::FileSerializer::ADMIN_THUMBNAIL_SIZE,
               lightbox(placement).merge(class: 'f-c-index-images__img'))
  end

  def broken_src
    'data:image/svg+xml;base64,<KEY>
  end

  def gallery
    !options[:cover]
  end<commit_msg>fix console/index/images check for better sql<commit_after># frozen_string_literal: true

class Folio::Console::Index::ImagesCell < Folio::ConsoleCell
  include Folio::CellLightbox

  class_name 'f-c-index-images', :cover, :gallery

  def id_class_name
    # needed for separate lightboxes
    "f-c-index-images--id-#{model.class.table_name}-#{model.id}"
  end

  def show
    if options[:cover]
      render
    else
      render if model.image_placements.present?
    end
  end

  def image(placement)
    image_from(placement,
               Folio::Console::FileSerializer::ADMIN_THUMBNAIL_SIZE,
               lightbox(placement).merge(class: 'f-c-index-images__img'))
  end

  def broken_src
    'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAwaDI0djI0SDB6bTAgMGgyNHYyNEgwem0yMSAxOWMwIDEuMS0uOSAyLTIgMkg1Yy0xLjEgMC0yLS45LTItMlY1YzAtMS4xLjktMiAyLTJoMTRjMS4xIDAgMiAuOSAyIDIiLz48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAwaDI0djI0SDB6Ii8+PHBhdGggZD0iTTIxIDV2Ni41OWwtMy0zLjAxLTQgNC4wMS00LTQtNCA0LTMtMy4wMVY1YzAtMS4xLjktMiAyLTJoMTRjMS4xIDAgMiAuOSAyIDJ6bS0zIDYuNDJsMyAzLjAxVjE5YzAgMS4xLS45IDItMiAySDVjLTEuMSAwLTItLjktMi0ydi02LjU4bDMgMi45OSA0LTQgNCA0IDQtMy45OXoiLz48L3N2Zz4='
  end

  def gallery
    !options[:cover]
  end
{'fraction_non_alphanumeric': 0.0834942084942085, 'fraction_numerical': 0.03909266409266409, 'mean_word_length': 4.889204545454546, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6261296', 'n_tokens_mistral': 936, 'n_tokens_neox': 876, 'n_words': 96}