osu-cascades/ecotone-web

View on GitHub
app/views/mycorrhizal_fungi_samples/_form.html.haml

Summary

Maintainability
Test Coverage
.form
  = form_for(@mycorrhizal_fungi_sample, html: { multipart: true }) do |form|
    = form_errors_for(@mycorrhizal_fungi_sample)
    .content
      .caption
        %h3 Information 
        %p.italic Provide data about the mycorrhizal fungi sample
      .input
        .data
          = form.label :collected_on, 'Collection Date'
          = form.date_field :collected_on, class: 'form-control'
        .data
          = form.label :plot_id, 'Plot'
          = form.collection_select :plot_id, @plots, :id, :name, {include_blank: 'Choose plot...'}, {class: 'form-control'}
        .data
          = form.label :plant_id, 'Plant'
          = form.collection_select :plant_id, @plants, :id, :form_common_name, {include_blank: 'Choose plant...'}, {class: 'form-control'}
        .data
          = form.label :length
          = form.number_field :length, id: :mycorrhizal_fungi_sample_length, class: 'form-control'
        .data
          = form.label :magnification
          = form.select :magnification, options_for_select(MycorrhizalFungiSample::MAGNIFICATIONS, @mycorrhizal_fungi_sample.magnification), {include_blank: 'Choose magnification...'}, id: :mycorrhizal_fungi_sample_magnification, class: 'form-control'
        .data
          = form.label :vesicle_count, 'Vesicle Count'
          = form.number_field :vesicle_count, id: :mycorrhizal_fungi_sample_vesicle_count, class: 'form-control'
        .data
          = form.label :arbuscule_count, 'Arbuscule Count'
          = form.number_field :arbuscule_count, id: :mycorrhizal_fungi_sample_arbuscule_count, class: 'form-control'
        .data.checkbox-container
          = form.label :visible_hyphae, 'Visible Hyphae?'
          = form.check_box :visible_hyphae, id: :mycorrhizal_fungi_sample_visible_hyphae
        .data
          = form.label :hyphae_coverage, 'Hyphae Coverage (%)'
          = form.number_field :hyphae_coverage, id: :mycorrhizal_fungi_sample_hyphae_coverage, class: 'form-control'
    = render 'layouts/image_gallery', {form: form, entity: @mycorrhizal_fungi_sample, phrase: 'Include reference pictures for the sample'}
    = render 'layouts/form_buttons', {form: form, text: 'Sample'}