sanger/sequencescape

View on GitHub
app/views/shared/_ethical_approval_upload.html.erb

Summary

Maintainability
Test Coverage

<h3>Ethical approval</h3>
<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="40%" class="item"><%= form.label :ethically_approved, "HMDMC approved" %></td>
    <td width="60%"><%= form.check_box :ethically_approved, disabled: !can?(:change_ethically_approved, @study) %></td>
  </tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0">
  <% unless study.documents.empty? %>
    <tr>
      <td width="40%" class="item">Listing <%= pluralize(study.documents.size, "document") %>:</label></td>
      <td width="60%">
        <% study.documents.each do |document| %>
          <div id='<%= document.filename.underscore %>_listing' class="ListingDocuments">
            <%= display_file_icon(document) %>
            <%= link_to document.filename, study_document_path(study, document) %>
            <% if can? :delete, document %>
              <%= link_to(icon('fas', 'trash-alt', id: "delete_file_#{document.id}", class: 'text-danger'), [study, document], method: :delete, title: "Delete #{ document.filename }", alt: "Delete") %>
            <% end %>
          </div>
        <% end %>
      </td>
    </tr>
  <% end %>
  <tr>
    <td width="40%" class="item"><%= form.label :uploaded_data, "Attach HMDMC approval" %></td>
    <td width="60%"><%= form.file_field :uploaded_data %></td>
  </tr>
</table>