emory-libraries/dlp-selfdeposit

View on GitHub
app/views/hyrax/publications/_creator_fields.html.erb

Summary

Maintainability
Test Coverage
<div class="nested-fields row">
  <% creator_parts = parse_creator_string(f.object) %>
  <div class="col-md-6">
    <%= f.input :first_name, label: 'First Name', input_html: { class: 'form-control', value: creator_parts[:first_name] || '' }, required: true %>
  </div>
  <div class="col-md-6">
    <%= f.input :last_name, label: 'Last Name', input_html: { class: 'form-control', value: creator_parts[:last_name] || '' }, required: true %>
  </div>
  <div class="col-md-6">
    <%= f.input :institution, label: 'Institution', input_html: { class: 'form-control', value: creator_parts[:institution] || '' }, required: true %>
  </div>
  <div class="col-md-6">
    <%= f.input :orcid_id, label: 'ORCID ID', input_html: { class: 'form-control', value: creator_parts[:orcid] || '' }, required: false %>
  </div>
  <span class="input-group-btn field-controls">
    <button type="button" onClick="removeCreator()" class="btn btn-link remove">
      <span class="glyphicon glyphicon-remove"></span>
      <span class="controls-remove-text">Remove</span>
    </button>
  </span>
</div>