<commit_before><% content_for :head do %>
  <%= javascript_include_tag 'file_manager' %>

  <%= render partial: 'shared/navigation_warning',
             formats: [:js],
             handlers: [:erb] %>

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

<div class='title_bar'>
  <h1>
    <%= t('student.submission.file_manager',
          short_identifier: sanitize(@assignment.short_identifier)) %>
  </h1>
</div>

<div id='current_time'>
  <%= render partial: 'server_time' %>

  <script>
    new PeriodicalExecuter(
      function() {
        new Ajax.Updater('current_time',
          '<%= server_time_assignment_submissions_path(@assignment.id) %>',
          {
            asynchronous:true,
            evalScripts:true,
            parameters:'authenticity_token=' + AUTH_TOKEN
          }
        )
    }, 60);
  </script>
</div>

<div class='wrapper'>
  <% if flash[:submit_notice] -%>
    <p class='success'><%= flash[:submit_notice] %></p>
  <% end %>

  <div id='directory_selector' <%=raw('style="display:none;"') unless @grouping.repository_external_commits_only? %>>
    <p>
      <%= I18n.t('student.submission.current_path') %>
      <% path_memory = '/'
         links = []
         @path.split('/').each do |folder|
         path_memory = File.join(path_memory, folder)
         links.push(link_to folder, action: 'file_manager', path: path_memory)
      end %>
      <%= link_to '[root]', action: 'file_manager', path: '/' %>
      <%= links.join('/')%>
    </p>
  </div>

  <% if flash[:transaction_warning] %>
    <div class='warning'><%= flash[:transaction_warning] %></div>
  <% end %>

  <% if flash[:success] %>
    <div class='success'><%= flash[:success] %></div>
  <% end %>

  <% if @assignment.submission_rule.can_collect_now? &&
        flash[:commit_notice] != @assignment.submission_rule.commit_after_collection_message %>
    <div class='warning'>
      <%= @assignment.submission_rule.after_collection_message %>
    </div>
  <% else %>
    <% if @assignment.grouping_past_due_date?(@grouping) %>
      <div class='warning'>
        <%= @assignment.submission_rule.overtime_message(@grouping) %>
      </div>
    <% end %>
  <% end %>

  <% if !@file_manager_errors.nil? && @file_manager_errors[:update_conflicts] %>
    <div class='error'>
      <h2><%= I18n.t('student.submission.conflicts') %></h2>
      <p><%= I18n.t('student.submission.file_conflicts') %></p>
      <ul>
        <% @file_manager_errors[:update_conflicts].each do |conflict| %>
          <li><%= conflict.to_s %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <% if flash[:commit_notice] %>
    <div class='warning'>
      <%= flash[:commit_notice] %>
    </div>
  <% end %>

  <% if !@file_manager_errors.nil? && @file_manager_errors[:commit_error] %>
    <div class='warning'>
      <%= @file_manager_errors[:commit_error] %>
    </div>
  <% end %>

  <% if !@file_manager_errors.nil? && @file_manager_errors[:size_conflict] %>
    <div class='error'>
      <%= @file_manager_errors[:size_conflict] %>
    </div>
  <% end %>

  <% if !@grouping.is_valid? %>
    <div class='error'>
      <%= t(:invalid_group_warning) %>
    </div>
  <% elsif !@missing_assignment_files.nil? && @missing_assignment_files.size > 0 %>
    <div class='warning'>
      <p>
        <%= I18n.t('student.submission.missing_files', file: @missing_assignment_files.size) %>
        <% if @missing_assignment_files.size > 5 %>
          <%= link_to_function I18n.t('student.submission.toggle_file_list'), "$('missing_assignment_files_list').toggle();"%>
        <% end %>
      </p>

      <ul id='missing_assignment_files_list' <%='style="display:none;"' if @missing_assignment_files.size > 5 %>>
        <% @missing_assignment_files.each do |assignment_file| %>
          <li><%= assignment_file.filename %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <% unless !@grouping.is_valid? || @grouping.repository_external_commits_only? %>
    <div id='file_table'></div>
  <% end %>
</div>

<aside class='dialog' id='addnew_dialog'>
  <h2><%= t('add_new') %></h2>

  <%= form_tag update_files_assignment_submissions_path(@assignment.id),
               { multipart: true, id: 'file_form' } do %>
    <%= file_field_tag :new_files, name: 'new_files[]', multiple: true %>

    <% unless !@grouping.is_valid? || @grouping.repository_external_commits_only? %>
      <section class='dialog-actions'>
        <%= submit_tag(I18n.t(:submit),
                       disabled: !@grouping.is_valid?,
                       onclick: 'set_onbeforeunload(false); submitFile(event)') unless @grouping.repository_external_commits_only? %>
        <%= button_to_function t(:close), 'modal_addnew.close();' %>
      </section>
    <% end %>
  <% end %>
</aside><commit_msg>Show file table even if web submits are disabled<commit_after><% content_for :head do %>
  <%= javascript_include_tag 'file_manager' %>

  <%= render partial: 'shared/navigation_warning',
             formats: [:js],
             handlers: [:erb] %>

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

<div class='title_bar'>
  <h1>
    <%= t('student.submission.file_manager',
          short_identifier: sanitize(@assignment.short_identifier)) %>
  </h1>
</div>

<div id='current_time'>
  <%= render partial: 'server_time' %>

  <script>
    new PeriodicalExecuter(
      function() {
        new Ajax.Updater('current_time',
          '<%= server_time_assignment_submissions_path(@assignment.id) %>',
          {
            asynchronous:true,
            evalScripts:true,
            parameters:'authenticity_token=' + AUTH_TOKEN
          }
        )
    }, 60);
  </script>
</div>

<div class='wrapper'>
  <% if flash[:submit_notice] -%>
    <p class='success'><%= flash[:submit_notice] %></p>
  <% end %>

  <div id='directory_selector' <%=raw('style="display:none;"') unless @grouping.repository_external_commits_only? %>>
    <p>
      <%= I18n.t('student.submission.current_path') %>
      <% path_memory = '/'
         links = []
         @path.split('/').each do |folder|
         path_memory = File.join(path_memory, folder)
         links.push(link_to folder, action: 'file_manager', path: path_memory)
      end %>
      <%= link_to '[root]', action: 'file_manager', path: '/' %>
      <%= links.join('/')%>
    </p>
  </div>

  <% if flash[:transaction_warning] %>
    <div class='warning'><%= flash[:transaction_warning] %></div>
  <% end %>

  <% if flash[:success] %>
    <div class='success'><%= flash[:success] %></div>
  <% end %>

  <% if @assignment.submission_rule.can_collect_now? &&
        flash[:commit_notice] != @assignment.submission_rule.commit_after_collection_message %>
    <div class='warning'>
      <%= @assignment.submission_rule.after_collection_message %>
    </div>
  <% else %>
    <% if @assignment.grouping_past_due_date?(@grouping) %>
      <div class='warning'>
        <%= @assignment.submission_rule.overtime_message(@grouping) %>
      </div>
    <% end %>
  <% end %>

  <% if !@file_manager_errors.nil? && @file_manager_errors[:update_conflicts] %>
    <div class='error'>
      <h2><%= I18n.t('student.submission.conflicts') %></h2>
      <p><%= I18n.t('student.submission.file_conflicts') %></p>
      <ul>
        <% @file_manager_errors[:update_conflicts].each do |conflict| %>
          <li><%= conflict.to_s %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <% if flash[:commit_notice] %>
    <div class='warning'>
      <%= flash[:commit_notice] %>
    </div>
  <% end %>

  <% if !@file_manager_errors.nil? && @file_manager_errors[:commit_error] %>
    <div class='warning'>
      <%= @file_manager_errors[:commit_error] %>
    </div>
  <% end %>

  <% if !@file_manager_errors.nil? && @file_manager_errors[:size_conflict] %>
    <div class='error'>
      <%= @file_manager_errors[:size_conflict] %>
    </div>
  <% end %>

  <% if !@grouping.is_valid? %>
    <div class='error'>
      <%= t(:invalid_group_warning) %>
    </div>
  <% elsif !@missing_assignment_files.nil? && @missing_assignment_files.size > 0 %>
    <div class='warning'>
      <p>
        <%= I18n.t('student.submission.missing_files', file: @missing_assignment_files.size) %>
        <% if @missing_assignment_files.size > 5 %>
          <%= link_to_function I18n.t('student.submission.toggle_file_list'), "$('missing_assignment_files_list').toggle();"%>
        <% end %>
      </p>

      <ul id='missing_assignment_files_list' <%='style="display:none;"' if @missing_assignment_files.size > 5 %>>
        <% @missing_assignment_files.each do |assignment_file| %>
          <li><%= assignment_file.filename %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <div id='file_table'></div>
</div>

<aside class='dialog' id='addnew_dialog'>
  <h2><%= t('add_new') %></h2>

  <%= form_tag update_files_assignment_submissions_path(@assignment.id),
               { multipart: true, id: 'file_form' } do %>
    <%= file_field_tag :new_files, name: 'new_files[]', multiple: true %>

    <% unless !@grouping.is_valid? || @grouping.repository_external_commits_only? %>
      <section class='dialog-actions'>
        <%= submit_tag(I18n.t(:submit),
                       disabled: !@grouping.is_valid?,
                       onclick: 'set_onbeforeunload(false); submitFile(event)') unless @grouping.repository_external_commits_only? %>
        <%= button_to_function t(:close), 'modal_addnew.close();' %>
      </section>
    <% end %>
  <% end %>
</aside>
{'fraction_non_alphanumeric': 0.1874092511926986, 'fraction_numerical': 0.004770794440987347, 'mean_word_length': 3.0999149659863945, 'pattern_counts': {'":': 0, '<': 251, '<?xml version=': 0, '>': 257, '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': '6334417', 'n_tokens_mistral': 3530, 'n_tokens_neox': 3227, 'n_words': 501}