<commit_before><%= render partial: 'submissions_table', formats: [:'js.jsx'], handlers: [:erb] %>

<% content_for :title do %>
  <%= t('browse_submissions.submissions',
        short_identifier: sanitize(@assignment.short_identifier)) %>
  <div class='title-help submissions_help'>
    <p class='help-message-title submissions_help'>
      <% if @current_user.ta? %>
        <%= t('assignment.help.submissions_graders') %>
      <% else %>
        <%= t('assignment.help.submissions_admins') %>
      <% end %>
    </p>
  </div>
<% end %>



<% @heading_buttons = [] %>

<% if @current_user.admin? %>
  <% @heading_buttons +=
  [
    {
      link_text: t('collect_submissions.collect_all'),
      link_path: collect_all_submissions_assignment_submissions_path(@assignment.id),
      html_options: { confirm: t('collect_submissions.results_loss_warning') }
    },
    {
      link_text: t('browse_submissions.csv_report'),
      link_path: download_simple_csv_report_assignment_submissions_path(@assignment)
    },
    {
      link_text: t('browse_submissions.detailed_csv_report'),
      link_path: download_detailed_csv_report_assignment_submissions_path(@assignment)
    },
    {
      link_text: t('browse_submissions.subversion_repo_list'),
      link_path: download_svn_repo_list_assignment_submissions_path(@assignment)
    },
    {
      link_text: t('browse_submissions.subversion_checkout_file'),
      link_path: download_svn_checkout_commands_assignment_submissions_path(@assignment)
    }
  ] %>
<% end %>

<% # Allow TA submission collection only if all the submissions are
   # assignment to exactly one TA. %>
<% if @current_user.ta? and @assignment.past_collection_date? and
      @groupings.all? {|grouping| grouping.get_ta_names.size == 1} %>
  <% @heading_buttons.push(
    {
      link_text: t('collect_submissions.collect_ta'),
      link_path: collect_ta_submissions_assignment_submissions_path(@assignment),
      html_options: { confirm: t('collect_submissions.results_loss_warning') }
    }) %>
  <span class='menu_bar'></span>
<% elsif @current_user.ta? and @assignment.past_collection_date? %>
  <% @heading_buttons.push(
  {
    link_text: t('collect_submissions.collect_ta'),
    link_path: '#',
    html_options: {
                    id: 'disable',
                    title: t('collect_submissions.disable_collect')
                  }
  }) %>
<% end %>

<% if all_assignments_marked? %>
  <% @heading_buttons.push(
  {
    link_text: t('browse_submissions.download_groupings_files'),
    link_path: download_groupings_files_assignment_submissions_path(
               groupings: @groupings)
  }) %>
<% else %>
  <% @heading_buttons.push(
  {
    link_text: t('browse_submissions.download_groupings_files'),
    link_path: download_groupings_files_assignment_submissions_path(
               groupings: @groupings),
    html_options: {confirm: t('collect_submissions.marking_incomplete_warning')}
  }) %>
<% end %>



<% content_for :additional_headings do %>
  <% if @current_user.ta? %>
    <span class='menu_bar'></span>
    <%= t('browse_submissions.how_many_marked',<commit_msg>Remove ability for TAs to collect all, and restore confirm<commit_after><%= render partial: 'submissions_table', formats: [:'js.jsx'], handlers: [:erb] %>

<% content_for :title do %>
  <%= t('browse_submissions.submissions',
        short_identifier: sanitize(@assignment.short_identifier)) %>
  <div class='title-help submissions_help'>
    <p class='help-message-title submissions_help'>
      <% if @current_user.ta? %>
        <%= t('assignment.help.submissions_graders') %>
      <% else %>
        <%= t('assignment.help.submissions_admins') %>
      <% end %>
    </p>
  </div>
<% end %>



<% @heading_buttons = [] %>

<% if @current_user.admin? %>
  <% @heading_buttons +=
  [
    {
      link_text: t('collect_submissions.collect_all'),
      link_path: collect_all_submissions_assignment_submissions_path(@assignment.id),
      html_options: { data: { confirm: t('collect_submissions.results_loss_warning') } }
    },
    {
      link_text: t('browse_submissions.csv_report'),
      link_path: download_simple_csv_report_assignment_submissions_path(@assignment)
    },
    {
      link_text: t('browse_submissions.detailed_csv_report'),
      link_path: download_detailed_csv_report_assignment_submissions_path(@assignment)
    },
    {
      link_text: t('browse_submissions.subversion_repo_list'),
      link_path: download_svn_repo_list_assignment_submissions_path(@assignment)
    },
    {
      link_text: t('browse_submissions.subversion_checkout_file'),
      link_path: download_svn_checkout_commands_assignment_submissions_path(@assignment)
    }
  ] %>
<% end %>

<% if all_assignments_marked? %>
  <% @heading_buttons.push(
  {
    link_text: t('browse_submissions.download_groupings_files'),
    link_path: download_groupings_files_assignment_submissions_path(
               groupings: @groupings)
  }) %>
<% else %>
  <% @heading_buttons.push(
  {
    link_text: t('browse_submissions.download_groupings_files'),
    link_path: download_groupings_files_assignment_submissions_path(
               groupings: @groupings),
    html_options: { data: { confirm: t('collect_submissions.marking_incomplete_warning') } }
  }) %>
<% end %>



<% content_for :additional_headings do %>
  <% if @current_user.ta? %>
    <span class='menu_bar'></span>
    <%= t('browse_submissions.how_many_marked',
{'fraction_non_alphanumeric': 0.13612083256585006, 'fraction_numerical': 0.0001841959845275373, 'mean_word_length': 4.079513564078578, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5815000', 'n_tokens_mistral': 1955, 'n_tokens_neox': 1761, 'n_words': 230}