<commit_before><%= javascript_include_tag "sharing.js" -%>

<%= f.error_messages %>



<h2>Specimen Details</h2>

<div style="text-align: center;">
  <div style="width: 95%;">
    <p>
      <%= f.label :donor_number -%><span class="required">*</span><br/>
      <%= f.text_field :donor_number, :style => "width: 350px;" -%>
    </p>

    <p>
      <%= f.label "Choose an organism" %><span class="required">*</span><br/>
      <%= collection_select(:specimen, :organism_id, Organism.all, :id, :title) %>
    </p>

    <p>
      <%= f.label "Choose a strain" %><span class="required">*</span><br/>
      <%= collection_select(:specimen, :strain_id, Strain.all, :id, :title) %>
    </p>

    <p>
      <%= f.label :age -%><br/>
      <%= f.text_field :age, :style => "width: 150px;" -%> weeks

    </p>

    <p>
      <%= f.label :treatment -%><br/>
      <%= f.text_field :treatment, :style => "width: 350px;" -%>
    </p>

    <p>
      <%= f.label :lab_internal_number -%><span class="required">*</span><br/>
      <%= f.text_field :lab_internal_number, :style => "width: 350px;" -%>
    </p>


    <p>
      <%= f.label :project %><span class="required">*</span><br/>
      <%
         selected_project=@specimen.project.try(:id)
      %>
      <%=
          select_tag :project_id,
                     options_for_select([["Select project ..", 0]]|current_user.person.projects.collect { |p| [h(p.name), p.id] }, selected_project),
                     {:onchange=>remote_function(
                             :url=>{:action=>"project_selected_ajax"},
                             :with=>"'project_id='+this.value",
                             :before=>"show_ajax_loader('institution_collection')"
                     ), :style=>"width:82%"

                     }
      %>
    </p>

    <p>
      <%= f.label :institution %><span class="required">*</span><br/>

    <div id="institution_collection">
      <% ins = @specimen.project ? @specimen.project.institutions : [] -%>
      <%= render :partial=>"specimens/institutions_list", :locals=>{:ins => ins} -%>
    </div>
    </p>

    <%= render :partial=>"assets/asset_form_bottom", :locals=> {
            :resource_type => "Specimen",
            :attribution_enable => false,
            :show_publications => false,
            :existing_creators=>@specimen.creators,
            :other_creators=>@specimen.other_creators,
    } -%>

    <p>
      <%= f.label :description -%><br/>
      <%= f.text_area :comments, :style => "width: 85%;", :rows => 5 -%>
    </p>


  </div>
</div>



<p style="margin-top: 2em; text-align: center;">
  <%= f.submit(action==:edit ? "Update" : "Create", :disable_with=>(action==:edit ? "Updating..." : "Creating...")) -%>
  or <%= link_to 'Cancel', (@specimen.id ? specimen_path(@specimen.id) : specimens_path) -%>
</p><commit_msg>specimen: institutions are not constrained to one specific project<commit_after><%= javascript_include_tag "sharing.js" -%>

<%= f.error_messages %>



<h2>Specimen Details</h2>

<div style="text-align: center;">
  <div style="width: 95%;">
    <p>
      <%= f.label :donor_number -%><span class="required">*</span><br/>
      <%= f.text_field :donor_number, :style => "width: 350px;" -%>
    </p>

    <p>
      <%= f.label "Choose an organism" %><span class="required">*</span><br/>
      <%= collection_select(:specimen, :organism_id, Organism.all, :id, :title, {:prompt => true}) %>
    </p>

    <p>
      <%= f.label "Choose a strain" %><span class="required">*</span><br/>
      <%= collection_select(:specimen, :strain_id, Strain.all, :id, :title, {:prompt => true}) %>
    </p>

    <p>
      <%= f.label :age -%><br/>
      <%= f.text_field :age, :style => "width: 150px;" -%> weeks

    </p>

    <p>
      <%= f.label :treatment -%><br/>
      <%= f.text_field :treatment, :style => "width: 350px;" -%>
    </p>

    <p>
      <%= f.label :lab_internal_number -%><span class="required">*</span><br/>
      <%= f.text_field :lab_internal_number, :style => "width: 350px;" -%>
    </p>


    <p>
      <%= f.label :project %><span class="required">*</span><br/>
      <%
         selected_project=@specimen.project.try(:id)
      %>
      <%=
          select_tag :project_id,
                     options_for_select([["Select project ..", 0]]|current_user.person.projects.collect { |p| [h(p.name), p.id] }, selected_project),
                     {:onchange=>remote_function(
                             :url=>{:action=>"project_selected_ajax"},
                             :with=>"'project_id='+this.value"
                     ), :style=>"width:82%"

                     }
      %>
    </p>
     <p>
    <%= f.label "Institution" %><span class="required">*</span><br/>
    <%= collection_select(:specimen, :institution_id, Institution.all, :id, :name, {:prompt => true}) %>
  </p>


    <%= render :partial=>"assets/asset_form_bottom", :locals=> {
            :resource_type => "Specimen",
            :attribution_enable => false,
            :show_publications => false,
            :existing_creators=>@specimen.creators,
            :other_creators=>@specimen.<EMAIL>_creators,
    } -%>

    <p>
      <%= f.label :description -%><br/>
      <%= f.text_area :comments, :style => "width: 85%;", :rows => 5 -%>
    </p>


  </div>
</div>



<p style="margin-top: 2em; text-align: center;">
  <%= f.submit(action==:edit ? "Update" : "Create", :disable_with=>(action==:edit ? "Updating..." : "Creating...")) -%>
  or <%= link_to 'Cancel', (@specimen.id ? specimen_path(@specimen.id) : specimens_path) -%>
</p>
{'fraction_non_alphanumeric': 0.21693693693693694, 'fraction_numerical': 0.008288288288288289, 'mean_word_length': 2.491194968553459, 'pattern_counts': {'":': 0, '<': 149, '<?xml version=': 0, '>': 194, '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': '4759339', 'n_tokens_mistral': 2099, 'n_tokens_neox': 1907, 'n_words': 329}