<commit_before>= dialog_tag('Spreadsheet', {:icon => 'fa fa-upload', :class => "header-part"}) do
  = simple_form_for(@upload,
    :html => {:multipart => true, :class => 'form-vertical' },                                                                                                                            :wrapper => :vertical_form,                                                                                                                                                           :wrapper_mappings => {:check_boxes => :vertical_radio_and_checkboxes, :radio_buttons => :vertical_radio_and_checkboxes, :file => :vertical_file_input, :boolean => :vertical_boolean}) do |f|

    .row
      - if current_user.organizations.count > 1
        .col-sm-6
          = f.association :organization, :required => true, :collection => current_user.organizations, :label_method => 'coded_name'
      .col-sm-6
        = f.association :file_content_type, :collection => FileContentType.active, :required => true, :label => 'Spreadsheet Content', :prompt => 'Set the spreadsheet contents...'
    .row
      .col-sm-6
        = f.input :file, :required => true, :label => 'Spreadsheet', :hint => 'Select a spreadsheet that has been downloaded from TransAM, edited, then saved.'
      .col-sm-6.force_update{style: 'display: none;'}
        = f.input :force_update, :collection => [['No', false],['Yes', true]], :include_blank => false
    .row
      .col-sm-6
        = f.button :submit, 'Upload spreadsheet', :class=>"btn btn-primary"

:javascript
  var max_file_size_mb = #{Rails.application.config.max_upload_file_size};

  $(document).ready(function() {

    transam.make_same_height('.header-part');

    // Insert a change listener to validate the file size before uploading.
    $('#upload_file').change(function() {
      transam.validate_file_size(this, max_file_size_mb);
    });
  });

  // jquery validations
  $('#new_upload').validate({
    ignore: [], //validate hidden fields
    submitHandler: function(form) {
      form.submit();
    }
  });

  //Hide force_update unless the user is uploading new inventory and then display so the user can choose if they want to force the update
  var new_inventory_file_content_type_id = #{FileContentType.find_by(:class_name => 'NewInventoryFileHandler').id};

  $(function(){
    $('#upload_file_content_type_id').change(function() {
      if($(this).val() == new_inventory_file_content_type_id) {
        $(".force_update").show();
      } else {
        $(".force_update").hide();
      }
    });
  });<commit_msg>call seed by name not class_name<commit_after>= dialog_tag('Spreadsheet', {:icon => 'fa fa-upload', :class => "header-part"}) do
  = simple_form_for(@upload,
    :html => {:multipart => true, :class => 'form-vertical' },                                                                                                                            :wrapper => :vertical_form,                                                                                                                                                           :wrapper_mappings => {:check_boxes => :vertical_radio_and_checkboxes, :radio_buttons => :vertical_radio_and_checkboxes, :file => :vertical_file_input, :boolean => :vertical_boolean}) do |f|

    .row
      - if current_user.organizations.count > 1
        .col-sm-6
          = f.association :organization, :required => true, :collection => current_user.organizations, :label_method => 'coded_name'
      .col-sm-6
        = f.association :file_content_type, :collection => FileContentType.active, :required => true, :label => 'Spreadsheet Content', :prompt => 'Set the spreadsheet contents...'
    .row
      .col-sm-6
        = f.input :file, :required => true, :label => 'Spreadsheet', :hint => 'Select a spreadsheet that has been downloaded from TransAM, edited, then saved.'
      .col-sm-6.force_update{style: 'display: none;'}
        = f.input :force_update, :collection => [['No', false],['Yes', true]], :include_blank => false
    .row
      .col-sm-6
        = f.button :submit, 'Upload spreadsheet', :class=>"btn btn-primary"

:javascript
  var max_file_size_mb = #{Rails.application.config.max_upload_file_size};

  $(document).ready(function() {

    transam.make_same_height('.header-part');

    // Insert a change listener to validate the file size before uploading.
    $('#upload_file').change(function() {
      transam.validate_file_size(this, max_file_size_mb);
    });
  });

  // jquery validations
  $('#new_upload').validate({
    ignore: [], //validate hidden fields
    submitHandler: function(form) {
      form.submit();
    }
  });

  //Hide force_update unless the user is uploading new inventory and then display so the user can choose if they want to force the update
  var new_inventory_file_content_type_id = #{FileContentType.find_by(name: 'New Inventory').id};

  $(function(){
    $('#upload_file_content_type_id').change(function() {
      if($(this).val() == new_inventory_file_content_type_id) {
        $(".force_update").show();
      } else {
        $(".force_update").hide();
      }
    });
  });
{'fraction_non_alphanumeric': 0.14007782101167315, 'fraction_numerical': 0.0023346303501945525, 'mean_word_length': 2.3601307189542484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2259086', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1388, 'n_words': 326}