osu-cascades/ecotone-web

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

Summary

Maintainability
Test Coverage
- content_for_title("Fungi Sample ##{@fungi_sample.id}")
- content_for(:subnav) do
  .btn-public
    = link_to('« Samples', fungi_samples_path, class: 'button primary', method: 'get')
  - if @fungi_sample.editable_by?(current_user)
    .btn-admin
      = link_to(content_tag(:i, '', :class => "icon-edit"), edit_fungi_sample_path(@fungi_sample), class: 'btn-icon')
      - if current_user&.admin?
        = link_to(content_tag(:i, '', :class => "icon-trash"), @fungi_sample, method: :delete, data: { confirm: "Delete fungi sample #{@fungi_sample.id}?" }, class: 'btn-icon')
.content
  = render 'layouts/image_carousel', entity: @fungi_sample
  .info
    %h2.heading#table-heading Information
    %table.table#vertical-table
      %thead
        %th.citation.italic{colspan: '2'}= last_updated(@fungi_sample)
      %tbody
        %tr
          %th{scope: 'row'} Collection Date
          %td= @fungi_sample.datestamp
        %tr
          %th{scope: 'row'} Plot
          %td= link_to("#{@fungi_sample.plot}", @fungi_sample.plot)
        %tr
          %th{scope: 'row'} Location in Plot
          %td= @fungi_sample.location_within_plot
        %tr
          %th{scope: 'row'} Size
          %td= @fungi_sample.size
        %tr
          %th{scope: 'row'} Description
          %td= @fungi_sample.description