<commit_before><%
   select_truncate_length=120
   all_organisms = Organism.order(:title)
   all_tissue_and_cell_types = TissueAndCellType.order(:title)
   culture_growth_options=options_for_select(CultureGrowthType.order(:title).collect{|cg| [cg.title,cg.id]}.insert(0,"Not specified"))
-%>
<%= folding_panel('Organisms', false, :body_options => {:id => 'organisms_fold_content'},
                  :help_text => "Here you can associate the #{t('assays.assay').downcase} with specific organisms and cell types/tissues.") do %>
    <p style="color: #666666;">
      The following Organism and cell types/tissues are involved in this <%= "#{@assay_text}" -%>:
    </p>
    <div id="organism_to_list" class="box_editing_inner" style="line-height: 1.5">
      <span class="none_text" id="organisms">Loading...</span>
    </div>

    <div class="association_step form-group">
      <label>Step 1 - <span class="assay_organism_info">Choose an organism</span></label>
      <%= select_tag :possible_organisms,
                     options_for_select([["Select Organism ...", 0]]|all_organisms.collect{|o| [truncate(h(o.title), :length=>select_truncate_length), o.id]}),
                     {:class=>"form-control",
                      :onchange=>"if (this.value!='0'){"+remote_function(
                              :url=>{:action=>"existing_strains_for_assay_organism", :controller=>"strains"},
                              :with=>"'organism_id='+this.value",
                              :before=>"show_ajax_loader('existing_strains_for_assay_organism')",
                              :method=>:get
                      )+
                              "};check_show_add_organism();return(false);",
                     } -%>
      <%= select_tag :assay_organism_ids, options_from_collection_for_select([], :id, :title), {:multiple=>true, :style=>"display:none;"} -%>
    </div>

    <div id="extra_organism_details" style="display:none;">
      <div class="association_step form-group">
        <label>Step 2 - <span class="assay_item_sup_info">Select method of cell culture (optional)</span></label>
        <%= select_tag :culture_growth, culture_growth_options, :class=>"form-control" -%>
      </div>

      <div class="association_step form-group">
        <label>Step 3 - <span class="assay_strain_info">Specify a strain (optional)</span></label>
        <div id="existing_strains_for_assay_organism"></div>
        <%= link_to_function image("destroy", :alt => "Remove", :title => "Remove this strain", :id => 'destroy_image', :style => 'display:none;'), "removeStrain()" %>
      </div>

      <% if Seek::Config.is_virtualliver %>
          <div class="association_step">
            <b>Step 4</b> - <span class="assay_tissue_and_cell_type_info">  Select or specify a cell type or tissue (optional)</span> <br/>
            <%= select_tag :possible_tissue_and_cell_types,
                           options_for_select([["Select Tissue or Cell Type ...", 0]]|all_tissue_and_cell_types.collect { |o| [truncate(h(o.title), :length=>select_truncate_length), o.id] }),
                           {:style=>"width:90%",
                            :onchange=> "$('tissue_and_cell_type').clear();return(false);"} -%>
            <div id="existing_tissue_and_cell_types"></div>
            <%= text_field_tag :tissue_and_cell_type,nil,{:onfocus=>"$('possible_tissue_and_cell_types').selectedIndex = 0;"}%>
          </div>
      <% end %>

      <%= button_link_to "Include in the #{@assay_text}", 'new', "javascript: addSelectedOrganism(); return(false);", :id=>"add_organism_link" %>
    </div>
<% end %>

<script type="text/javascript">
    function setSelectedStrain(id,strain_info){
        $('strain_id').value = id;
        $('strain_info').value = strain_info;
        new Effect.Highlight('strain_info');
        $('destroy_image').style['display']='block';
    }

    <% @assay.assay_organisms.each do |o| -%>
    organism_id = '<%= o.organism.id -%>';
    organism_title = '<%= escape_javascript(o.organism.title) -%>';<commit_msg>Fixed add organism link on assays form<commit_after><%
   select_truncate_length=120
   all_organisms = Organism.order(:title)
   all_tissue_and_cell_types = TissueAndCellType.order(:title)
   culture_growth_options=options_for_select(CultureGrowthType.order(:title).collect{|cg| [cg.title,cg.id]}.insert(0,"Not specified"))
-%>
<%= folding_panel('Organisms', false, :body_options => {:id => 'organisms_fold_content'},
                  :help_text => "Here you can associate the #{t('assays.assay').downcase} with specific organisms and cell types/tissues.") do %>
    <p style="color: #666666;">
      The following Organism and cell types/tissues are involved in this <%= "#{@assay_text}" -%>:
    </p>
    <div id="organism_to_list" class="box_editing_inner" style="line-height: 1.5">
      <span class="none_text" id="organisms">Loading...</span>
    </div>

    <div class="association_step form-group">
      <label>Step 1 - <span class="assay_organism_info">Choose an organism</span></label>
      <%= select_tag :possible_organisms,
                     options_for_select([["Select Organism ...", 0]]|all_organisms.collect{|o| [truncate(h(o.title), :length=>select_truncate_length), o.id]}),
                     {:class=>"form-control",
                      :onchange=>"if (this.value!='0'){"+remote_function(
                              :url=>{:action=>"existing_strains_for_assay_organism", :controller=>"strains"},
                              :with=>"'organism_id='+this.value",
                              :before=>"show_ajax_loader('existing_strains_for_assay_organism')",
                              :method=>:get
                      )+
                              "};check_show_add_organism();return(false);",
                     } -%>
      <%= select_tag :assay_organism_ids, options_from_collection_for_select([], :id, :title), {:multiple=>true, :style=>"display:none;"} -%>
    </div>

    <div id="extra_organism_details" style="display:none;">
      <div class="association_step form-group">
        <label>Step 2 - <span class="assay_item_sup_info">Select method of cell culture (optional)</span></label>
        <%= select_tag :culture_growth, culture_growth_options, :class=>"form-control" -%>
      </div>

      <div class="association_step form-group">
        <label>Step 3 - <span class="assay_strain_info">Specify a strain (optional)</span></label>
        <div id="existing_strains_for_assay_organism"></div>
        <%= link_to_function image("destroy", :alt => "Remove", :title => "Remove this strain", :id => 'destroy_image', :style => 'display:none;'), "removeStrain()" %>
      </div>

      <% if Seek::Config.is_virtualliver %>
          <div class="association_step">
            <b>Step 4</b> - <span class="assay_tissue_and_cell_type_info">  Select or specify a cell type or tissue (optional)</span> <br/>
            <%= select_tag :possible_tissue_and_cell_types,
                           options_for_select([["Select Tissue or Cell Type ...", 0]]|all_tissue_and_cell_types.collect { |o| [truncate(h(o.title), :length=>select_truncate_length), o.id] }),
                           {:style=>"width:90%",
                            :onchange=> "$('tissue_and_cell_type').clear();return(false);"} -%>
            <div id="existing_tissue_and_cell_types"></div>
            <%= text_field_tag :tissue_and_cell_type,nil,{:onfocus=>"$('possible_tissue_and_cell_types').selectedIndex = 0;"}%>
          </div>
      <% end %>

      <%= button_link_to "Include in the #{@assay_text}", 'new', "javascript: addSelectedOrganism();", :id=>"add_organism_link" %>
    </div>
<% end %>

<script type="text/javascript">
    function setSelectedStrain(id,strain_info){
        $('strain_id').value = id;
        $('strain_info').value = strain_info;
        new Effect.Highlight('strain_info');
        $('destroy_image').style['display']='block';
    }

    <% @assay.assay_organisms.each do |o| -%>
    organism_id = '<%= o.organism.id -%>';
    organism_title = '<%= escape_javascript(o.organism.title) -%>';
{'fraction_non_alphanumeric': 0.1691757156959526, 'fraction_numerical': 0.005429417571569595, 'mean_word_length': 3.1267820773930755, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 0, '>': 159, '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': '2224031', 'n_tokens_mistral': 2689, 'n_tokens_neox': 2488, 'n_words': 409}