<commit_before>-tabs = [{\
  :name => t('.overview'),
  :selected => 1,
  :path => metadata_overview_collection_work_path(@work.slug),
}]
-tabs += [{\
  :name => t('.describe'),
  :selected => 2,
  :path => describe_collection_work_path(@work.slug),
}]
-if @work.metadata_description_versions.present?
  -tabs += [{\
    :name => t('.versions'),
    :selected => 3,
    :path => description_versions_collection_work_path(@work.slug),
  }]
-tabs += [{\
  :name => t('.help'),
  :selected => 9,
  :path => "#{collection_work_help_path(@collection.owner, @collection, @work)}",
}]


-selected_tab = tabs.find { |tab| tab[:selected] == selected }[:name] rescue ""

-@display_context ||= ''

.headline
  h1.headline_title =@work.title
  .headline_aside
    -unless @display_context == 'preview'
      nav.page-nav
        =link_to({ :page_id => @work.pages.last.id }, class: 'page-nav_prev', title: 'Previous page', 'aria-label' => 'Previous page', onclick: 'unsavedTranscription(event);')
          =svg_symbol '#icon-arrow-left', class: 'icon', title: 'Previous page'

        =link_to(collection_next_untranscribed_page_path(@collection.owner, @collection, @work), class: 'page-nav_next', title: 'Next page', 'aria-label' => 'Next page', onclick: 'unsavedTranscription(event);')
          =svg_symbol '#icon-arrow-right', class: 'icon', title: 'Next page'
.tabs
  -for tab in tabs
      =link_to_unless tab[:selected] == selected, tab[:name], tab[:path]
        a.active =tab[:name]
<commit_msg>Tab navigation for description only<commit_after>-tabs = [{\
  :name => t('.overview'),
  :selected => 1,
  :path => metadata_overview_collection_work_path(@work.slug),
}]
-tabs += [{\
  :name => t('.describe'),
  :selected => 2,
  :path => describe_collection_work_path(@work.slug),
}]
-if @work.metadata_description_versions.present?
  -tabs += [{\
    :name => t('.versions'),
    :selected => 3,
    :path => description_versions_collection_work_path(@work.slug),
  }]
-tabs += [{\
  :name => t('.help'),
  :selected => 9,
  :path => "#{collection_work_help_path(@collection.owner, @collection, @work)}",
}]


-selected_tab = tabs.find { |tab| tab[:selected] == selected }[:name] rescue ""

-@display_context ||= ''

.headline
  h1.headline_title =@work.title
  .headline_aside
    -unless @display_context == 'preview'
      nav.page-nav
        -if @collection.text_entry?
          =link_to({ :page_id => @work.pages.last.id }, class: 'page-nav_prev', title: 'Previous page', 'aria-label' => 'Previous page', onclick: 'unsavedTranscription(event);')
            =svg_symbol '#icon-arrow-left', class: 'icon', title: 'Previous page'

          =link_to(collection_next_untranscribed_page_path(@collection.owner, @collection, @work), class: 'page-nav_next', title: 'Next page', 'aria-label' => 'Next page', onclick: 'unsavedTranscription(event);')
            =svg_symbol '#icon-arrow-right', class: 'icon', title: 'Next page'
        -else
          -index = @collection.works.index(@work)
          -if index > 0
            =link_to(describe_collection_work_path(@collection.owner, @collection, @collection.works[index-1]), class: 'page-nav_prev', title: 'Previous work', 'aria-label' => 'Previous work', onclick: 'unsavedTranscription(event);')
              =svg_symbol '#icon-arrow-left', class: 'icon', title: 'Previous work'
          -if index < (@collection.works.size - 1)
            =link_to(describe_collection_work_path(@collection.owner, @collection, @collection.works[index+1]), class: 'page-nav_next', title: 'Next work', 'aria-label' => 'Next work', onclick: 'unsavedTranscription(event);')
              =svg_symbol '#icon-arrow-right', class: 'icon', title: 'Next work'

.tabs
  -for tab in tabs
      =link_to_unless tab[:selected] == selected, tab[:name], tab[:path]
        a.active =tab[:name]

{'fraction_non_alphanumeric': 0.18574796960964107, 'fraction_numerical': 0.0036678019386953103, 'mean_word_length': 3.9973821989528795, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 36, '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': '6335282', 'n_tokens_mistral': 1265, 'n_tokens_neox': 1232, 'n_words': 256}