osu-cascades/ecotone-web

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

Summary

Maintainability
Test Coverage
- content_for_title("Macroinvertebrate Sample ##{@macroinvertebrate_sample.id}")
- content_for(:subnav) do
  .btn-public
    = link_to('« Samples', macroinvertebrate_samples_path, class: 'button primary', method: 'get')
  - if @macroinvertebrate_sample.editable_by?(current_user)
    .btn-admin
      = link_to(content_tag(:i, '', :class => "icon-edit"), edit_macroinvertebrate_sample_path(@macroinvertebrate_sample), class: 'btn-icon')
      - if current_user&.admin?
        = link_to(content_tag(:i, '', :class => "icon-trash"), @macroinvertebrate_sample, method: :delete, data: { confirm: "Delete macroinvertebrate sample #{@macroinvertebrate_sample.id}?" }, class: 'btn-icon')
.content
  = render 'layouts/image_carousel', entity: @macroinvertebrate_sample
  .info
    %h2.heading#table-heading Information
    %table.table#vertical-table
      %thead
        %th.citation.italic{colspan: '2'}= last_updated(@macroinvertebrate_sample)
      %tbody
        %tr
          %th{scope: 'row'} Collection Date
          %td= @macroinvertebrate_sample.datestamp
        %tr
          %th{scope: 'row'} Plot
          %td= link_to("#{@macroinvertebrate_sample.plot}", @macroinvertebrate_sample.plot)
        %tr
          %th{scope: 'row'} Location in Plot
          %td= @macroinvertebrate_sample.location_within_plot
        %tr
          %th{scope: 'row'} Phylum
          %td= @macroinvertebrate_sample.phylum
        %tr
          %th{scope: 'row'} Quantity
          %td= @macroinvertebrate_sample.quantity
        %tr
          %th{scope: 'row'} Ecosystem Service
          %td= @macroinvertebrate_sample.ecosystem_service