<commit_before><%= content_for :modal_id, 'upload_dialog' %>
<%= content_for :modal_title, t('annotation_categories.upload.title') %>
<%= content_for :modal_content do %>

  <!-- Script for switching content on radio buttons. -->
  <%= javascript_include_tag 'switch_content_control.js' %>
  <%= javascript_tag do %>
    LIB.init(['#annotation_upload_csv', '#annotation_upload_yml']);
  <% end %>

  <%= label_tag :csv, 'CSV'  %>
    <%= radio_button_tag :upload_file_type, 'csv', checked: true  %>
    <%= radio_button_tag :upload_file_type, 'yml' %>
  <%= label_tag :yml, 'YML' %>

  <div id='annotation_upload_csv'>
    <%= t('annotations.upload.csv_instructions_html').html_safe %>
    <%= form_tag({ action: 'csv_upload',
                   id: @assignment.id },
                 { multipart: true }) do %>
      <!-- Script for disabling upload buttons. -->
      <%= javascript_include_tag 'upload_button_control.js',
                                 id: 'upload_csv_script',
                                 upload_id: 'annotation_category_list_csv',
                                 button_id: 'button_upload_csv' %>
      <p><%= file_field_tag :annotation_category_list_csv, size: 0 %></p>
      <div>
        <%= label_tag t('encoding') %>
        <%= select_tag(:encoding, options_for_select(@encodings)) %>
      </div>
      <section class='dialog-actions'>
        <%= submit_tag t(:upload),
                       data: { disable_with: t(:uploading_please_wait) },
                       id: 'button_upload_csv',
                       disabled: true %>
        <input type='reset' value='<%= t(:cancel) %>'/>
      </section>
    <% end %>
  </div>
  <div id='annotation_upload_yml'>
    <%= t('annotations.upload.yml_instructions_html').html_safe %>
    <%= form_tag({ action: 'yml_upload',
                   id: @assignment.id },
                 { multipart: true }) do %>

      <!-- Script for disabling upload buttons. -->
      <%= javascript_include_tag 'upload_button_control.js',
                                 id: 'upload_yml_script',
                                 upload_id: 'annotation_category_list_yml',
                                 button_id: 'upload_yml' %>
      <p><%= file_field_tag :annotation_category_list_yml, size: 0 %></p>
      <div>
        <%= label_tag t('encoding') %>
        <%= select_tag(:encoding, options_for_select(@encodings)) %>
      </div>
    <% end %>
    <section class='dialog-actions'>
      <%= submit_tag t(:upload),
                     data: { disable_with: t(:uploading_please_wait) },
                     id: 'upload_yml',
                     disabled: true %>
      <input type='reset' value='<%= t(:cancel) %>'/>
    </section>
  </div>
<% end %>
<commit_msg>Fix annotations yml upload<commit_after><%= content_for :modal_id, 'upload_dialog' %>
<%= content_for :modal_title, t('annotation_categories.upload.title') %>
<%= content_for :modal_content do %>

  <!-- Script for switching content on radio buttons. -->
  <%= javascript_include_tag 'switch_content_control.js' %>
  <%= javascript_tag do %>
    LIB.init(['#annotation_upload_csv', '#annotation_upload_yml']);
  <% end %>

  <%= label_tag :csv, 'CSV'  %>
    <%= radio_button_tag :upload_file_type, 'csv', checked: true  %>
    <%= radio_button_tag :upload_file_type, 'yml' %>
  <%= label_tag :yml, 'YML' %>

  <div id='annotation_upload_csv'>
    <%= t('annotations.upload.csv_instructions_html').html_safe %>
    <%= form_tag({ action: 'csv_upload',
                   id: @assignment.id },
                 { multipart: true }) do %>
      <!-- Script for disabling upload buttons. -->
      <%= javascript_include_tag 'upload_button_control.js',
                                 id: 'upload_csv_script',
                                 upload_id: 'annotation_category_list_csv',
                                 button_id: 'button_upload_csv' %>
      <p><%= file_field_tag :annotation_category_list_csv, size: 0 %></p>
      <div>
        <%= label_tag t('encoding') %>
        <%= select_tag(:encoding, options_for_select(@encodings)) %>
      </div>
      <section class='dialog-actions'>
        <%= submit_tag t(:upload),
                       data: { disable_with: t(:uploading_please_wait) },
                       id: 'button_upload_csv',
                       disabled: true %>
        <input type='reset' value='<%= t(:cancel) %>'/>
      </section>
    <% end %>
  </div>
  <div id='annotation_upload_yml'>
    <%= t('annotations.upload.yml_instructions_html').html_safe %>
    <%= form_tag({ action: 'yml_upload',
                   id: @assignment.id },
                 { multipart: true }) do %>

      <!-- Script for disabling upload buttons. -->
      <%= javascript_include_tag 'upload_button_control.js',
                                 id: 'upload_yml_script',
                                 upload_id: 'annotation_category_list_yml',
                                 button_id: 'upload_yml' %>
      <p><%= file_field_tag :annotation_category_list_yml, size: 0 %></p>
      <div>
        <%= label_tag t('encoding') %>
        <%= select_tag(:encoding, options_for_select(@encodings)) %>
      </div>
      <section class='dialog-actions'>
        <%= submit_tag t(:upload),
                       data: { disable_with: t(:uploading_please_wait) },
                       id: 'upload_yml',
                       disabled: true %>
        <input type='reset' value='<%= t(:cancel) %>'/>
      </section>
    <% end %>
  </div>
<% end %>

{'fraction_non_alphanumeric': 0.15563214220932342, 'fraction_numerical': 0.0007255577725376383, 'mean_word_length': 2.1762672811059907, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 0, '>': 103, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6987248', 'n_tokens_mistral': 1786, 'n_tokens_neox': 1604, 'n_words': 297}