<commit_before><%- 
  index ||= @i
  Rails.logger.debug "[DEBUG] in partial, index: #{index}"
  checked ||= false
  synclink_base ||= nil
  sound_identity ||= nil
  local_sounds ||= false
-%>
<% if @reauthorization_needed -%>
  <p class="notice ui">
    <%= t(:soundcloud_needs_to_confirm, :site_name => @site.preferred_site_name_short) %>
    <%= link_to t(:confirm_now), ProviderAuthorization::AUTH_URLS['soundcloud'], :class => "readmore" %>
  </p>
<% elsif @timeout %>
  <p class="error ui">
    <%=t 'sounds.request_timed_out' %>
  </p>
<% elsif @soundcloud_error %>
  <p class="error ui">
    <%=t 'sounds.soundcloud_replied_with_an_error' %>
  </p>
<% else %>
  <h4><%= t :'sounds.select_one_or_more_sounds' %></h4>
  <%= hidden_field_tag :editing_sounds, true %>
  <% sounds.each do |sound| %>
    <% if sound.is_a?( SoundcloudSound ) %>
      <%- 
        unique_id = serial_id
        input_name = "soundcloud_sounds#{"["+index.to_s+"]" if index}[]"
        input_id = "soundcloud_sound#{"_"+index.to_s if index}#{sound.native_sound_id}_#{unique_id}"
      -%>
      <div class="sound" data-sound-class="soundcloud_sound">
        <%= check_box_tag input_name, 
          sound.native_sound_id, 
          checked, 
          {:id => input_id, :class => "checkbox"} %>
        <label for="<%= input_id %>">
          <%= sound.native_response['title'] %>
        </label>
        <span class='small view_sound'><%= link_to(t(:'sounds.listen'), sound.native_page_url, :target => '_blank') %></span>
      </div>
    <% else %>
      <%- 
        unique_id = serial_id
        input_name = "local_sounds#{"["+index.to_s+"]" if index}[]"
        input_id = "local_sound#{"_"+index.to_s if index}#{sound.id}_#{unique_id}"
      -%>
      <div class="sound" data-sound-class="local_sound">
        <%= check_box_tag input_name, 
          sound.id, 
          checked, 
          {:id => input_id, :class => "checkbox"} %>
        <label for="<%= input_id %>">
          <%= sound.file_file_name %>
        </label>
        <span class='small view_sound'><%= link_to(t(:'sounds.listen'), sound.file.url, :target => '_blank') %></span>
      </div>
    <% end %>
  <% end %>
<% end %>

<% if local_sounds -%>
  <div class="clear local_sounds">
    <% sound_file_field = capture do %>
      <%- uid = serial_id -%>
      <div class="sound_file_field clear quiet box stacked">
        <%= file_field_tag("local_sounds[#{index}][]", :accept => ".mp3,.wav", :multiple => "") %>
        <div class="clear">
          <%= link_to_function t(:clear), "$(this).siblings('input[type=file]').val('')", :class => "right" %>
          <% if synclink_base %>
            <nobr title="<%= t(:import_date_time_location_taxonomic) %>">
              <%= check_box_tag "local_sounds_to_sync[#{index}][]", 1, false, :class => "sync_check",
                :id => "local_sounds_to_sync_#{uid}" %>
              <label for="local_sounds_to_sync_<%= uid %>"><%=t :sync_obs_with_sound_metadata %></label>
            </nobr>
          <% end -%>
        </div>
      </div>
    <% end %>
    <%= sound_file_field %>
    <%#= link_to_function t(:add_another_sound), "$(this).before('#{escape_javascript(sound_file_field)}')" %>
  </div>
<% end -%><commit_msg>Allow m4a and aac from the old obs form.<commit_after><%- 
  index ||= @i
  Rails.logger.debug "[DEBUG] in partial, index: #{index}"
  checked ||= false
  synclink_base ||= nil
  sound_identity ||= nil
  local_sounds ||= false
-%>
<% if @reauthorization_needed -%>
  <p class="notice ui">
    <%= t(:soundcloud_needs_to_confirm, :site_name => @site.preferred_site_name_short) %>
    <%= link_to t(:confirm_now), ProviderAuthorization::AUTH_URLS['soundcloud'], :class => "readmore" %>
  </p>
<% elsif @timeout %>
  <p class="error ui">
    <%=t 'sounds.request_timed_out' %>
  </p>
<% elsif @soundcloud_error %>
  <p class="error ui">
    <%=t 'sounds.soundcloud_replied_with_an_error' %>
  </p>
<% else %>
  <h4><%= t :'sounds.select_one_or_more_sounds' %></h4>
  <%= hidden_field_tag :editing_sounds, true %>
  <% sounds.each do |sound| %>
    <% if sound.is_a?( SoundcloudSound ) %>
      <%- 
        unique_id = serial_id
        input_name = "soundcloud_sounds#{"["+index.to_s+"]" if index}[]"
        input_id = "soundcloud_sound#{"_"+index.to_s if index}#{sound.native_sound_id}_#{unique_id}"
      -%>
      <div class="sound" data-sound-class="soundcloud_sound">
        <%= check_box_tag input_name, 
          sound.native_sound_id, 
          checked, 
          {:id => input_id, :class => "checkbox"} %>
        <label for="<%= input_id %>">
          <%= sound.native_response['title'] %>
        </label>
        <span class='small view_sound'><%= link_to(t(:'sounds.listen'), sound.native_page_url, :target => '_blank') %></span>
      </div>
    <% else %>
      <%- 
        unique_id = serial_id
        input_name = "local_sounds#{"["+index.to_s+"]" if index}[]"
        input_id = "local_sound#{"_"+index.to_s if index}#{sound.id}_#{unique_id}"
      -%>
      <div class="sound" data-sound-class="local_sound">
        <%= check_box_tag input_name, 
          sound.id, 
          checked, 
          {:id => input_id, :class => "checkbox"} %>
        <label for="<%= input_id %>">
          <%= sound.file_file_name %>
        </label>
        <span class='small view_sound'><%= link_to(t(:'sounds.listen'), sound.file.url, :target => '_blank') %></span>
      </div>
    <% end %>
  <% end %>
<% end %>

<% if local_sounds -%>
  <div class="clear local_sounds">
    <% sound_file_field = capture do %>
      <%- uid = serial_id -%>
      <div class="sound_file_field clear quiet box stacked">
        <%= file_field_tag("local_sounds[#{index}][]", :accept => ".mp3,.wav,.m4a,.aac", :multiple => "") %>
        <div class="clear">
          <%= link_to_function t(:clear), "$(this).siblings('input[type=file]').val('')", :class => "right" %>
          <% if synclink_base %>
            <nobr title="<%= t(:import_date_time_location_taxonomic) %>">
              <%= check_box_tag "local_sounds_to_sync[#{index}][]", 1, false, :class => "sync_check",
                :id => "local_sounds_to_sync_#{uid}" %>
              <label for="local_sounds_to_sync_<%= uid %>"><%=t :sync_obs_with_sound_metadata %></label>
            </nobr>
          <% end -%>
        </div>
      </div>
    <% end %>
    <%= sound_file_field %>
    <%#= link_to_function t(:add_another_sound), "$(this).before('#{escape_javascript(sound_file_field)}')" %>
  </div>
<% end -%>
{'fraction_non_alphanumeric': 0.2005524014116925, 'fraction_numerical': 0.0015344483658124904, 'mean_word_length': 2.964720194647202, 'pattern_counts': {'":': 0, '<': 147, '<?xml version=': 0, '>': 173, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4543214', 'n_tokens_mistral': 2470, 'n_tokens_neox': 2303, 'n_words': 392}