<commit_before>.columns
  article.maincol
    -if @search_string.present?
      h2 =t('.search_for', search_string: @search_string)
    
    =render 'pages_view'

    -if @review.nil?
      =render(:partial => 'shared/pagination', :locals => { :model => @pages, :entries_info => true })
    -else
      =render(:partial => 'shared/pagination', :locals => { :model => @pages, :entries_info => true, :needs_review => @review })

  -if @collection || @article
    aside.sidecol

      -if @collection
        =form_tag({:controller => 'display', :action => 'search'}, :method => :post, class: 'collection-search') do
          =hidden_field_tag('collection_id', @collection.id)
          =search_field_tag 'search_string', @search_string, :placeholder => t('.search_in_collection')
          =button_tag t('.search')
          =label_tag 'search_string', t('.search_in_collection'), class: 'hidden'

      -if @work
        -if @total != @count
          =button_to t('.view_all_pages'), {action: "read_work", work_id: @work.id, needs_review: 'none'}, class: 'review-button'
        -elsif @collection.active?
          =button_to t('.pages_need_transcription'), {action: "read_work", work_id: @work.id, needs_review: 'transcription' }, class: 'review-button'
          =button_to t('.pages_need_review'), {action: "read_work", work_id: @work.id, needs_review: 'review' }, class: 'review-button'
          =button_to t('.pages_need_indexing'), {action: "read_work", work_id: @work.id, needs_review: 'index' }, class: 'review-button' if @work.supports_indexing?

          -if @work.supports_translation
            =button_to t('.pages_need_translation'), {action: "read_work", work_id: @work.id, needs_review: 'translation' }, class: 'review-button'
            =button_to t('.translations_need_review'), {action: "read_work", work_id: @work.id, needs_review: 'translation_review'}, class: 'review-button'
            =button_to t('.translations_need_indexing'), {action: "read_work", work_id: @work.id, needs_review: 'translation_index'}, class: 'review-button'

      -if @article
        h4 =@article.title
        -if @article.xml_text != nil && !@article.xml_text.empty?
          =raw(xml_to_html(@article.xml_text))
        =render :partial => 'article/article_links'

      -if @collection.categories.present?
        -unless @collection.subjects_disabled
          h3.categories =t('.categories')
          .category-tree
            ==display_categories(@collection.categories, nil, true) do |category|
              -link_url = url_for(:controller => 'article', :action => 'list', :collection_id => @collection.id, :anchor => "category-#{category.id}")
              -ret = "<a href=\"#{link_url}\" class=\"tree-item\">"<commit_msg>lookup collection or document set by slug instead of id<commit_after>.columns
  article.maincol
    -if @search_string.present?
      h2 =t('.search_for', search_string: @search_string)
    
    =render 'pages_view'

    -if @review.nil?
      =render(:partial => 'shared/pagination', :locals => { :model => @pages, :entries_info => true })
    -else
      =render(:partial => 'shared/pagination', :locals => { :model => @pages, :entries_info => true, :needs_review => @review })

  -if @collection || @article
    aside.sidecol

      -if @collection
        =form_tag({:controller => 'display', :action => 'search'}, :method => :post, class: 'collection-search') do
          =hidden_field_tag('collection_id', @collection.slug)
          =search_field_tag 'search_string', @search_string, :placeholder => t('.search_in_collection')
          =button_tag t('.search')
          =label_tag 'search_string', t('.search_in_collection'), class: 'hidden'

      -if @work
        -if @total != @count
          =button_to t('.view_all_pages'), {action: "read_work", work_id: @work.id, needs_review: 'none'}, class: 'review-button'
        -elsif @collection.active?
          =button_to t('.pages_need_transcription'), {action: "read_work", work_id: @work.id, needs_review: 'transcription' }, class: 'review-button'
          =button_to t('.pages_need_review'), {action: "read_work", work_id: @work.id, needs_review: 'review' }, class: 'review-button'
          =button_to t('.pages_need_indexing'), {action: "read_work", work_id: @work.id, needs_review: 'index' }, class: 'review-button' if @work.supports_indexing?

          -if @work.supports_translation
            =button_to t('.pages_need_translation'), {action: "read_work", work_id: @work.id, needs_review: 'translation' }, class: 'review-button'
            =button_to t('.translations_need_review'), {action: "read_work", work_id: @work.id, needs_review: 'translation_review'}, class: 'review-button'
            =button_to t('.translations_need_indexing'), {action: "read_work", work_id: @work.id, needs_review: 'translation_index'}, class: 'review-button'

      -if @article
        h4 =@article.title
        -if @article.xml_text != nil && !@article.xml_text.empty?
          =raw(xml_to_html(@article.xml_text))
        =render :partial => 'article/article_links'

      -if @collection.categories.present?
        -unless @collection.subjects_disabled
          h3.categories =t('.categories')
          .category-tree
            ==display_categories(@collection.categories, nil, true) do |category|
              -link_url = url_for(:controller => 'article', :action => 'list', :collection_id => @collection.id, :anchor => "category-#{category.id}")
              -ret = "<a href=\"#{link_url}\" class=\"tree-item\">"
{'fraction_non_alphanumeric': 0.1643141512848353, 'fraction_numerical': 0.0010857763300760044, 'mean_word_length': 3.4862012987012987, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '6632046', 'n_tokens_mistral': 1713, 'n_tokens_neox': 1700, 'n_words': 360}