<commit_before>= render(:partial => "lab_method")
= render(:partial => "sample_material")
%h1
  New Sample
 
= form_for :sample, @sample, :url => { :action => "create"} do |f|
  Sample Type:
  -sample_type_options = Array.new
  - @sample_types.all(:order => [:term.asc]).each do |samp_type|
    -sample_type_options <<[samp_type.term]
  = f.select('sample_type',  options_for_select(sample_type_options))
  =clear_break
  Lab Sample Code:
  = f.text_field(:lab_sample_code, :label => "Lab Sample Code:")
  =clear_break
  %label{:id => "lab_meth", :onclick=>"dijit.byId('new_lab_method').show();", :class => "icon icon-add", :onmouseover =>"this.style.cursor='hand'"}Lab Method:
  -lab_method_options = Hash.new
  - @lab_methods.all(:order => [:lab_method_name.asc]).each do |lab_meth|
    -lab_method_options = lab_method_options.merge({lab_meth.lab_method_name => lab_meth.id})
  = f.select('lab_method_id',  options_for_select(lab_method_options))
  =clear_break
  %label{:id => "sample_mat", :onclick=>"$('#new_sample_material').toggle('fold');", :class => "icon icon-add", :onmouseover =>"this.style.cursor='hand'"}Sample Medium
  -sample_material_options = Array.new
  - @sample_materials.all(:order => [:material.asc]).each do |mat|
    -sample_material_options << [mat.material]
  - @project_sample_materials.all(:order => [:material.asc]).each do |mat|
    -sample_material_options << [mat.material]  
  = f.select('material',  options_for_select(sample_material_options))
  = clear_break
  Site: 
  -@site_options=""
  -@sites.all(:order => [:name.asc]).each do |site|
    -if site.id != nil
      -@site_options= @site_options + "<option value="+site.id.to_s+">"+site.name.capitalize+"|"+site.code+"</option>"
  =select_tag("site", @site_options.html_safe)
  =clear_break
  Select a Timestamp for this Sample:
  =datetime_select("time", "stamp", :default => DateTime.now, :start_year => 1900)
  =clear_break
  Select the Time Zone this sample was collected in:
  = time_zone_select("time", "zone", nil, :default => "Mountain Time (US & Canada)")
  =clear_break
  = clear_break
  = link_to('I Have Samples and Data to Upload', {:action => 'pre_process_samples_and_data', :controller => 'data_values', :id=>@project.id })
  = clear_break
  = link_to('I Have Varying Samples With Data to Upload', {:action => 'pre_process_varying_samples_with_data', :controller => 'data_values', :id=>@project.id })
  = clear_break
  = link_to('This is the latest Sample and Data Upload', {:action => 'pre_process_samples_file_upload', :controller => 'data_values', :id=>@project.id })
  = clear_break
  = clear_break
  = f.submit('Save', :class => 'icon icon-save')
  = link_to('Cancel', project_path(@project), :class => 'icon icon-cancel') 
#all_variables
  %h3
    Existing Samples    
  = form_for("export", :url => {:controller => '/projects', :action => 'export'}) do 
    = hidden_field_tag('column_array', @label_array.to_json)
    = hidden_field_tag('row_array', @current_samples.to_json)
    = hidden_field_tag('file_name', "project_samples")
    = submit_tag("Export Samples")
  #variables_list
    - visualization("sample-table", 'table', :height => 200) do |table|
      - if @label_array.length > 1
        - @label_array[0..-1].each do |label|
          - table.register_column(:string, label)
        - table.add_rows(@current_samples)<commit_msg>remove "This is the latest Sample and Data Upload" link from Samples New form (#15064)<commit_after>= render(:partial => "lab_method")
= render(:partial => "sample_material")
%h1
  New Sample
 
= form_for :sample, @sample, :url => { :action => "create"} do |f|
  Sample Type:
  -sample_type_options = Array.new
  - @sample_types.all(:order => [:term.asc]).each do |samp_type|
    -sample_type_options <<[samp_type.term]
  = f.select('sample_type',  options_for_select(sample_type_options))
  =clear_break
  Lab Sample Code:
  = f.text_field(:lab_sample_code, :label => "Lab Sample Code:")
  =clear_break
  %label{:id => "lab_meth", :onclick=>"dijit.byId('new_lab_method').show();", :class => "icon icon-add", :onmouseover =>"this.style.cursor='hand'"}Lab Method:
  -lab_method_options = Hash.new
  - @lab_methods.all(:order => [:lab_method_name.asc]).each do |lab_meth|
    -lab_method_options = lab_method_options.merge({lab_meth.lab_method_name => lab_meth.id})
  = f.select('lab_method_id',  options_for_select(lab_method_options))
  =clear_break
  %label{:id => "sample_mat", :onclick=>"$('#new_sample_material').toggle('fold');", :class => "icon icon-add", :onmouseover =>"this.style.cursor='hand'"}Sample Medium
  -sample_material_options = Array.new
  - @sample_materials.all(:order => [:material.asc]).each do |mat|
    -sample_material_options << [mat.material]
  - @project_sample_materials.all(:order => [:material.asc]).each do |mat|
    -sample_material_options << [mat.material]  
  = f.select('material',  options_for_select(sample_material_options))
  = clear_break
  Site: 
  -@site_options=""
  -@sites.all(:order => [:name.asc]).each do |site|
    -if site.id != nil
      -@site_options= @site_options + "<option value="+site.id.to_s+">"+site.name.capitalize+"|"+site.code+"</option>"
  =select_tag("site", @site_options.html_safe)
  =clear_break
  Select a Timestamp for this Sample:
  =datetime_select("time", "stamp", :default => DateTime.now, :start_year => 1900)
  =clear_break
  Select the Time Zone this sample was collected in:
  = time_zone_select("time", "zone", nil, :default => "Mountain Time (US & Canada)")
  =clear_break
  = clear_break
  = link_to('I Have Samples and Data to Upload', {:action => 'pre_process_samples_and_data', :controller => 'data_values', :id=>@project.id })
  = clear_break
  = link_to('I Have Varying Samples With Data to Upload', {:action => 'pre_process_varying_samples_with_data', :controller => 'data_values', :id=>@project.id })
  -#= clear_break
  -#= link_to('This is the latest Sample and Data Upload', {:action => 'pre_process_samples_file_upload', :controller => 'data_values', :id=>@project.id })
  = clear_break
  = clear_break
  = f.submit('Save', :class => 'icon icon-save')
  = link_to('Cancel', project_path(@project), :class => 'icon icon-cancel') 
#all_variables
  %h3
    Existing Samples    
  = form_for("export", :url => {:controller => '/projects', :action => 'export'}) do 
    = hidden_field_tag('column_array', @label_array.to_json)
    = hidden_field_tag('row_array', @current_samples.to_json)
    = hidden_field_tag('file_name', "project_samples")
    = submit_tag("Export Samples")
  #variables_list
    - visualization("sample-table", 'table', :height => 200) do |table|
      - if @label_array.length > 1
        - @label_array[0..-1].each do |label|
          - table.register_column(:string, label)
        - table.add_rows(@current_samples)
{'fraction_non_alphanumeric': 0.1704729630175335, 'fraction_numerical': 0.004272874613231177, 'mean_word_length': 4.959613696224759, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 83, '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': '5308645', 'n_tokens_mistral': 2378, 'n_tokens_neox': 2308, 'n_words': 451}