<commit_before><%= form_for [:admin, object], html: {multipart: true, class: 'upload-button'} do |f| %>
  <%= f.file_field file_attribute,
    class: 'fileupload fileupload--field', multiple: true,
    name: "#{f.object_name}[#{file_attribute}]" %>
  <%= hidden_field_tag("#{f.object_name}[upload_hash]", Time.current.hash) if object.respond_to?(:upload_hash) %>
  <%= f.label file_attribute, data: {alchemy_hotkey: 'alt+n'} do %>
    <div class="button_with_label">
      <span class="icon_button"><%= render_icon :upload %></span>
      <label>
        <%= local_assigns[:label] ||
          Alchemy.t(:button_label, scope: [:uploader, object.class.model_name.i18n_key]) %>
      </label>
    </div>
  <% end %>
<% end %>

<% file_types = local_assigns[:file_types].presence ||
  configuration(:uploader)['allowed_filetypes'][object.class.model_name.collection] || ['*'] %>

<script type='text/javascript'>
  $(function() {
    var options = {
      file_types: '<%= file_types.join("|") %>',
      dropzone: '<%= local_assigns[:dropzone] || '#main_content' %>',
      complete: function() {
        var url = '<%= redirect_url.html_safe %>';
      <% if local_assigns[:in_dialog] %>
        $.get(url, null, null, 'script');
      <% else %>
        Turbolinks.visit(url);
      <% end %>
      }
    };
    Alchemy.Uploader(options);
  });
</script><commit_msg>Fix the upload button tab focus<commit_after><%= form_for [:admin, object], html: {multipart: true, class: 'upload-button'} do |f| %>
  <%= f.file_field file_attribute,
    class: 'fileupload fileupload--field', multiple: true,
    name: "#{f.object_name}[#{file_attribute}]", tabindex: '-1' %>
  <%= hidden_field_tag("#{f.object_name}[upload_hash]", Time.current.hash) if object.respond_to?(:upload_hash) %>
  <%= f.label file_attribute, data: {alchemy_hotkey: 'alt+n'} do %>
    <div class="button_with_label">
      <span class="icon_button" tabindex="0"><%= render_icon :upload %></span>
      <label>
        <%= local_assigns[:label] ||
          Alchemy.t(:button_label, scope: [:uploader, object.class.model_name.i18n_key]) %>
      </label>
    </div>
  <% end %>
<% end %>

<% file_types = local_assigns[:file_types].presence ||
  configuration(:uploader)['allowed_filetypes'][object.class.model_name.collection] || ['*'] %>

<script type='text/javascript'>
  $(function() {
    var options = {
      file_types: '<%= file_types.join("|") %>',
      dropzone: '<%= local_assigns[:dropzone] || '#main_content' %>',
      complete: function() {
        var url = '<%= redirect_url.html_safe %>';
      <% if local_assigns[:in_dialog] %>
        $.get(url, null, null, 'script');
      <% else %>
        Turbolinks.visit(url);
      <% end %>
      }
    };
    Alchemy.Uploader(options);
  });
</script>
{'fraction_non_alphanumeric': 0.20237666546633057, 'fraction_numerical': 0.0021606049693914295, 'mean_word_length': 3.7084745762711866, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, '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': '6031055', 'n_tokens_mistral': 992, 'n_tokens_neox': 937, 'n_words': 159}