sanger/sequencescape

View on GitHub
app/views/admin/studies/_edit.html.erb

Summary

Maintainability
Test Coverage

<%= form_for :study,
             url: managed_update_admin_study_path(study),
             html: { id: "update_form", method: "put", multipart: true, class: 'form-horizontal' } do |form| %>
  <% if study %>
    <h2>Study : <%= link_to study.name, study_path(study) %></h2>
    <div class="subtitle">
      Study <%= study.id %> &middot; Created on <%= study.created_at.to_formatted_s(:long) %> &middot; <%= study.state.capitalize %>
    </div>

    <div class='columnize'>
      <%= panel(:info,title:'Study state') do %>
        <%= form_group do %>
          <%= form.label :state, "State", class: 'col-md-4' %>
          <div class='col-md-8'>
            <%= form.select :state, Study.aasm.states_for_select, {}, {class: 'custom-select'} %>
          </div>
        <% end %>
      <% end %>

      <%= panel(:info,title:'Contacts') do %>
          <%= link_to "View Study Contacts", collaborators_study_path(study) %>
      <% end %>
    </div>

    <%= render partial: "studies/managed_study", locals: {read_only: false, form: form, study: study} %>

  <% end %>
<% end %>