osu-cascades/ecotone-web

View on GitHub
app/views/soil_samples/show.html.haml

Summary

Maintainability
Test Coverage
- content_for_title("Soil Sample ##{@soil_sample.id}")
- content_for(:subnav) do
  .btn-public
    = link_to('« Samples', soil_samples_path, class: 'button primary', method: 'get')
  - if @soil_sample.editable_by?(current_user)
    .btn-admin
      = link_to(content_tag(:i, '', :class => "icon-edit"), edit_soil_sample_path(@soil_sample), class: 'btn-icon')
      - if current_user&.admin?
        = link_to(content_tag(:i, '', :class => "icon-trash"), @soil_sample, method: :delete, data: { confirm: "Delete soil sample #{@soil_sample.id}?" }, class: 'btn-icon')
.content
  .info
    %h2.heading#table-heading Information
    %table.table#vertical-table
      %thead
        %th.citation.italic{colspan: '2'}= last_updated(@soil_sample)
      %tbody
        %tr
          %th{scope: 'row'} Collection Date
          %td= @soil_sample.datestamp
        %tr
          %th{scope: 'row'} Collection Method
          %td= @soil_sample.collection_method
        %tr
          %th{scope: 'row'} Plot
          %td= link_to("#{@soil_sample.plot}", @soil_sample.plot)
        %tr
          %th{scope: 'row'} pH
          %td= @soil_sample.ph_level
        %tr
          %th{scope: 'row'} Temperature
          %td= @soil_sample.temperature
        %tr
          %th{scope: 'row'} Moisture
          %td= @soil_sample.moisture
        %tr
          %th{scope: 'row'} Nitrogen
          %td= nutrient_table_data(@soil_sample, 'Nitrogen')
        %tr
          %th{scope: 'row'} Phosphorus
          %td= nutrient_table_data(@soil_sample, 'Phosphorus')
        %tr
          %th{scope: 'row'} Potassium
          %td= nutrient_table_data(@soil_sample, 'Potassium')